[patch] Fix "make check" failure to build on Ubuntu 14.04 LTS

Paul Pluzhnikov ppluzhnikov@google.com
Mon Jan 18 21:25:00 GMT 2016


On Mon, Jan 18, 2016 at 1:13 PM, Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:

> Is this tied to an specific make/binutils/gcc version that only shows itself
> on Ubuntu 14.04?

That seems likely, as nobody else appears to be affected (or this
would have probably been fixed many months ago).

For the record:
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
GNU ld (GNU Binutils for Ubuntu) 2.24 (2.24-5ubuntu14)

My understanding is that the order of shared libraries on command line
shouldn't matter, but somehow does in this particular configuration.

This is trivially reproduced with:

echo "int foo() { return 0; }" | gcc -fPIC -shared -o foo.so -xc -
cat > t.c <<EOF
int main() { return foo(); }
EOF

gcc t.c ./foo.so
# success

gcc ./foo.so t.c
/tmp/ccKY0qMa.o: In function `main':
t.c:(.text+0xa): undefined reference to `foo'
collect2: error: ld returned 1 exit status



-- 
Paul Pluzhnikov



More information about the Libc-alpha mailing list