This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix "make check" failure to build on Ubuntu 14.04 LTS
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Mon, 18 Jan 2016 13:24:40 -0800
- Subject: Re: [patch] Fix "make check" failure to build on Ubuntu 14.04 LTS
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobPf=6Lc=1=ZTRK3SuRnfhQw1HChGg96MF_yWx=_iB7zLw at mail dot gmail dot com> <569D5563 dot 6030800 at linaro dot org>
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