I get the same error with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
(Ubuntu 10.04). The problem occurs when compiling using both '--static'
and '--export-dynamic' flags in gcc. If I compile with the flags
separately everything works fine.
In older version of gcc, version 4.2.4 (Ubuntu 4.2.4-1ubuntu4) (Ubuntu
8.04), everything works perfectly.

Could it be that the error message is true and strcmp.o is compiled in
the wrong way? I can compile program using strcmp with static links.

Example:

The problem can be reproduced with any program (i.e the simple program
below).

#include <stdio.h>
int main(){
     printf("Hello Ubuntu!\n");
     return 0;
}

***Build on Ubuntu 10.04***
simon@simon-laptop ~/temp/ $ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

simon@simon-laptop ~/temp $ gcc example.c -static -export-dynamic
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in 
`/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libc.a(strcmp.o)' can not 
be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
simon@simon-laptop ~/temp $


***Build on Ubuntu 8.04***
simon@simon-laptop ~/temp $ gcc --version
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

simon@simon-laptop ~/temp $ gcc example.c -static -export-dynamic
simon@simon-laptop ~/temp $

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/667470

Title:
  Linking against libc built with profiling fails

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to