Message ID | CALoOobPf=6Lc=1=ZTRK3SuRnfhQw1HChGg96MF_yWx=_iB7zLw@mail.gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 6548 invoked by alias); 18 Jan 2016 20:41:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 6537 invoked by uid 89); 18 Jan 2016 20:41:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=GLOBAL, Archive X-HELO: mail-wm0-f44.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-type; bh=aU7j5UCXw+2W3oVhCbRvSP8xu+Ll0M5xDiVTxvpk8O8=; b=YcAASbEUU2ES0/ocu73l546FbCaxKWeyhOz0nQLuXQihaGDwsjETrxqfX4dT38FKkm Wdcny8BgIFMPmmXyVyJ5pBzS+aSYvUn4fEvYECM5zIu7QJH1vRa4COd5ScUEu4RX0tJE 15s4wCQAC3ak3jnlIRAMfkW35y85tijs0FKJZjR4YA32GPTxfwEEO1zY9NJCA118krH2 aZBViYtj4mQ41h24/BLRYKBRnVIISyZrTXY+srp1am1fJhgEmAqJvnLbDishk5RPZKiI 6Sy7uOVpZGSPGWMqsyGLr4YqzVrcedYMR1DHSuiFMFGmpQ9qAI8ieMqJQS0FpHT69c4b ylsw== X-Gm-Message-State: ALoCoQkiS5tYmsUHd9G9SXk+2Ua36XKKkFw14mN15FWRVn41Gw1qZzM/Po44JTyFIhZ5eZ/85br1ApGEruYZ04yBs2x9BtqLfsBUs+r57yP/H0Bfb8SWqfE= X-Received: by 10.194.86.71 with SMTP id n7mr25942686wjz.107.1453149681502; Mon, 18 Jan 2016 12:41:21 -0800 (PST) MIME-Version: 1.0 From: Paul Pluzhnikov <ppluzhnikov@google.com> Date: Mon, 18 Jan 2016 12:40:51 -0800 Message-ID: <CALoOobPf=6Lc=1=ZTRK3SuRnfhQw1HChGg96MF_yWx=_iB7zLw@mail.gmail.com> Subject: [patch] Fix "make check" failure to build on Ubuntu 14.04 LTS To: GLIBC Devel <libc-alpha@sourceware.org> Cc: Joseph Myers <joseph@codesourcery.com>, andrew.senkevich@intel.com Content-Type: multipart/mixed; boundary=089e0102e3de935b0e0529a1c6f9 |
Commit Message
Paul Pluzhnikov
Jan. 18, 2016, 8:40 p.m. UTC
On Mon, Dec 7, 2015 at 10:13 AM, Joseph Myers <joseph@codesourcery.com> wrote: > On Mon, 7 Dec 2015, Paul Pluzhnikov wrote: > >> Testing with (gcc-4.8 Ubuntu 4.8.4-2ubuntu1~14.04) 4:4.8.2-1ubuntu6 >> fails for apparently unrelated reasons: >> >> build/math/test-double-vlen2-wrappers.o: In function `cos_vlen2': >> /glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:24: >> undefined reference to `_ZGVbN2v_cos' >> /glibc-git/build-system-gcc/math/test-double-vlen2-wrappers.o: In >> function `sin_vlen2': >> /glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:25: >> undefined reference to `_ZGVbN2v_sin' >> ... etc. > > You should raise that with Andrew Senkevich, including details of whether > libmvec got built, what symbols it exports, the command line used for that > link, etc. This continues to fail. mkdir /tmp/build; cd /tmp/build; ~/Archive/glibc-git/configure --prefix=/usr make -j40 && make check ... gcc -nostdlib -nostartfiles -o /tmp/glibc-build/math/test-double-vlen2 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /tmp/glibc-build/csu/crt1.o /tmp/glibc-build/csu/crti.o `gcc --print-file-name=crtbegin.o` /tmp/glibc-build/math/test-double-vlen2.o /tmp/glibc-build/math/libm.so.6 /tmp/glibc-build/mathvec/libmvec.so.1 /tmp/glibc-build/math/test-double-vlen2-wrappers.o -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -Wl,-rpath-link=/tmp/glibc-build:/tmp/glibc-build/math:/tmp/glibc-build/elf:/tmp/glibc-build/dlfcn:/tmp/glibc-build/nss:/tmp/glibc-build/nis:/tmp/glibc-build/rt:/tmp/glibc-build/resolv:/tmp/glibc-build/crypt:/tmp/glibc-build/mathvec:/tmp/glibc-build/nptl /tmp/glibc-build/libc.so.6 /tmp/glibc-build/libc_nonshared.a -Wl,--as-needed /tmp/glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s -Wl,--no-as-needed `gcc --print-file-name=crtend.o` /tmp/glibc-build/csu/crtn.o /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `cos_vlen2': /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:24: undefined reference to `_ZGVbN2v_cos' /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `sin_vlen2': /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:25: undefined reference to `_ZGVbN2v_sin' /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `sincos_vlen2': /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:26: undefined reference to `_ZGVbN2vvv_sincos' /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `log_vlen2': /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:27: undefined reference to `_ZGVbN2v_log' /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `exp_vlen2': /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:28: undefined reference to `_ZGVbN2v_exp' /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `pow_vlen2': /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:29: undefined reference to `_ZGVbN2vv_pow' collect2: error: ld returned 1 exit status ../Rules:154: recipe for target '/tmp/glibc-build/math/test-double-vlen2' failed make[2]: *** [/tmp/glibc-build/math/test-double-vlen2] Error 1 make[2]: Leaving directory '/Archive/glibc-git/math' Makefile:214: recipe for target 'math/tests' failed make[1]: *** [math/tests] Error 2 make[1]: Leaving directory '/Archive/glibc-git' Makefile:9: recipe for target 'check' failed make: *** [check] Error 2 $ readelf -Ws /tmp/glibc-build/mathvec/libmvec.so.1 | grep _ZGVbN2vvv_sincos 26: 0000000000001ec0 35 IFUNC GLOBAL DEFAULT 13 _ZGVbN2vvv_sincos@@GLIBC_2.22 54: 0000000000001ec0 35 IFUNC LOCAL DEFAULT 13 __GI__ZGVbN2vvv_sincos 105: 0000000000001ef0 109 FUNC LOCAL DEFAULT 13 _ZGVbN2vvv_sincos_sse2 108: 0000000000003f40 874 FUNC LOCAL DEFAULT 13 _ZGVbN2vvv_sincos_sse4 196: 0000000000001ec0 35 IFUNC GLOBAL DEFAULT 13 _ZGVbN2vvv_sincos The problem appears to be that test-double-vlen2-wrappers.o is on the link line after libmvec.so.1, and indeed if I move libmvec.so.1 after test-double-vlen2-wrappers.o, the link succeeds. Attached patch fixes the problem. Ok for trunk? Thanks, 2016-01-18 Paul Pluzhnikov <ppluzhnikov@google.com> * math/Makefile (libm-vec-tests): Move libraries after wrappers.o
Comments
On 18-01-2016 18:40, Paul Pluzhnikov wrote: > On Mon, Dec 7, 2015 at 10:13 AM, Joseph Myers <joseph@codesourcery.com> wrote: >> On Mon, 7 Dec 2015, Paul Pluzhnikov wrote: >> >>> Testing with (gcc-4.8 Ubuntu 4.8.4-2ubuntu1~14.04) 4:4.8.2-1ubuntu6 >>> fails for apparently unrelated reasons: >>> >>> build/math/test-double-vlen2-wrappers.o: In function `cos_vlen2': >>> /glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:24: >>> undefined reference to `_ZGVbN2v_cos' >>> /glibc-git/build-system-gcc/math/test-double-vlen2-wrappers.o: In >>> function `sin_vlen2': >>> /glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:25: >>> undefined reference to `_ZGVbN2v_sin' >>> ... etc. >> >> You should raise that with Andrew Senkevich, including details of whether >> libmvec got built, what symbols it exports, the command line used for that >> link, etc. > > This continues to fail. > > mkdir /tmp/build; cd /tmp/build; > ~/Archive/glibc-git/configure --prefix=/usr > make -j40 && make check > ... > gcc -nostdlib -nostartfiles -o /tmp/glibc-build/math/test-double-vlen2 > -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both > /tmp/glibc-build/csu/crt1.o /tmp/glibc-build/csu/crti.o `gcc > --print-file-name=crtbegin.o` > /tmp/glibc-build/math/test-double-vlen2.o > /tmp/glibc-build/math/libm.so.6 /tmp/glibc-build/mathvec/libmvec.so.1 > /tmp/glibc-build/math/test-double-vlen2-wrappers.o > -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 > -Wl,-rpath-link=/tmp/glibc-build:/tmp/glibc-build/math:/tmp/glibc-build/elf:/tmp/glibc-build/dlfcn:/tmp/glibc-build/nss:/tmp/glibc-build/nis:/tmp/glibc-build/rt:/tmp/glibc-build/resolv:/tmp/glibc-build/crypt:/tmp/glibc-build/mathvec:/tmp/glibc-build/nptl > /tmp/glibc-build/libc.so.6 /tmp/glibc-build/libc_nonshared.a > -Wl,--as-needed /tmp/glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc > -Wl,--as-needed -lgcc_s -Wl,--no-as-needed `gcc > --print-file-name=crtend.o` /tmp/glibc-build/csu/crtn.o > /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `cos_vlen2': > /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:24: > undefined reference to `_ZGVbN2v_cos' > /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `sin_vlen2': > /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:25: > undefined reference to `_ZGVbN2v_sin' > /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `sincos_vlen2': > /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:26: > undefined reference to `_ZGVbN2vvv_sincos' > /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `log_vlen2': > /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:27: > undefined reference to `_ZGVbN2v_log' > /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `exp_vlen2': > /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:28: > undefined reference to `_ZGVbN2v_exp' > /tmp/glibc-build/math/test-double-vlen2-wrappers.o: In function `pow_vlen2': > /Archive/glibc-git/math/../sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c:29: > undefined reference to `_ZGVbN2vv_pow' > collect2: error: ld returned 1 exit status > ../Rules:154: recipe for target '/tmp/glibc-build/math/test-double-vlen2' failed > make[2]: *** [/tmp/glibc-build/math/test-double-vlen2] Error 1 > make[2]: Leaving directory '/Archive/glibc-git/math' > Makefile:214: recipe for target 'math/tests' failed > make[1]: *** [math/tests] Error 2 > make[1]: Leaving directory '/Archive/glibc-git' > Makefile:9: recipe for target 'check' failed > make: *** [check] Error 2 > > $ readelf -Ws /tmp/glibc-build/mathvec/libmvec.so.1 | grep _ZGVbN2vvv_sincos > 26: 0000000000001ec0 35 IFUNC GLOBAL DEFAULT 13 > _ZGVbN2vvv_sincos@@GLIBC_2.22 > 54: 0000000000001ec0 35 IFUNC LOCAL DEFAULT 13 > __GI__ZGVbN2vvv_sincos > 105: 0000000000001ef0 109 FUNC LOCAL DEFAULT 13 > _ZGVbN2vvv_sincos_sse2 > 108: 0000000000003f40 874 FUNC LOCAL DEFAULT 13 > _ZGVbN2vvv_sincos_sse4 > 196: 0000000000001ec0 35 IFUNC GLOBAL DEFAULT 13 _ZGVbN2vvv_sincos > > > The problem appears to be that test-double-vlen2-wrappers.o is on the > link line after libmvec.so.1, and indeed if I move libmvec.so.1 after > test-double-vlen2-wrappers.o, the link succeeds. > > Attached patch fixes the problem. Ok for trunk? > > Thanks, Is this tied to an specific make/binutils/gcc version that only shows itself on Ubuntu 14.04? > > > > 2016-01-18 Paul Pluzhnikov <ppluzhnikov@google.com> > > * math/Makefile (libm-vec-tests): Move libraries after wrappers.o >
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
On Mon, Jan 18, 2016 at 1:24 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote: > 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 I looked some more. What's happening is that this gcc driver adds '--as-needed' at the beginning of the link command line. With that --as-needed there, the problem reproduces with current trunk binutils (and probably any other version of binutils). You should be able to reproduce this as well with: gcc -Wl,--as-needed ./foo.so t.c P.S. To be clear, I don't care if this patch goes in after the hard freeze is lifted, though it's trivially correct and may help anyone with similarly configured GCC.
On 01/18/2016 03:40 PM, Paul Pluzhnikov wrote: > 2016-01-18 Paul Pluzhnikov <ppluzhnikov@google.com> > > * math/Makefile (libm-vec-tests): Move libraries after wrappers.o As you identified this is a search order issue. In practice we should follow: - Object files. - Archive files. - Shared objects. This results in the most compatible search order possible on all possible systems and allows archive symbols to override shared objects. I think your fix is correct. Please check this in to fix Ubuntu. Cheers, Carlos. > diff --git a/math/Makefile b/math/Makefile > index 8bedef7..222ee6b 100644 > --- a/math/Makefile > +++ b/math/Makefile > @@ -295,8 +295,8 @@ $(objpfx)libieee.a: $(objpfx)ieee-math.o > > $(addprefix $(objpfx),$(filter-out $(tests-static) $(libm-vec-tests),$(tests))): $(libm) > $(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a > -$(addprefix $(objpfx), $(libm-vec-tests)): $(objpfx)%: $(libm) $(libmvec) \ > - $(objpfx)%-wrappers.o > +$(addprefix $(objpfx), $(libm-vec-tests)): $(objpfx)%: $(objpfx)%-wrappers.o $(libm) \ > + $(libmvec) > > gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\ > add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \
On 01/18/2016 04:41 PM, Paul Pluzhnikov wrote: > On Mon, Jan 18, 2016 at 1:24 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote: >> 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 > > I looked some more. What's happening is that this gcc driver adds > '--as-needed' at the beginning of the link command line. With that > --as-needed there, the problem reproduces with current trunk binutils > (and probably any other version of binutils). > > You should be able to reproduce this as well with: > > gcc -Wl,--as-needed ./foo.so t.c > > P.S. To be clear, I don't care if this patch goes in after the hard > freeze is lifted, though it's trivially correct and may help anyone > with similarly configured GCC. This should go in now. Cheers, Carlos.
On Mon, 18 Jan 2016, Paul Pluzhnikov wrote: > The problem appears to be that test-double-vlen2-wrappers.o is on the > link line after libmvec.so.1, and indeed if I move libmvec.so.1 after > test-double-vlen2-wrappers.o, the link succeeds. > > Attached patch fixes the problem. Ok for trunk? If this is bug 19451 then you should include that bug number in the ChangeLog entry and change that bug to FIXED with the appropriate milestone set.
On Mon, Jan 18, 2016 at 2:30 PM, Joseph Myers <joseph@codesourcery.com> wrote: > On Mon, 18 Jan 2016, Paul Pluzhnikov wrote: > >> The problem appears to be that test-double-vlen2-wrappers.o is on the >> link line after libmvec.so.1, and indeed if I move libmvec.so.1 after >> test-double-vlen2-wrappers.o, the link succeeds. >> >> Attached patch fixes the problem. Ok for trunk? > > If this is bug 19451 then you should include that bug number in the > ChangeLog entry and change that bug to FIXED with the appropriate > milestone set. It is; done; done. Thanks.
diff --git a/math/Makefile b/math/Makefile index 8bedef7..222ee6b 100644 --- a/math/Makefile +++ b/math/Makefile @@ -295,8 +295,8 @@ $(objpfx)libieee.a: $(objpfx)ieee-math.o $(addprefix $(objpfx),$(filter-out $(tests-static) $(libm-vec-tests),$(tests))): $(libm) $(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a -$(addprefix $(objpfx), $(libm-vec-tests)): $(objpfx)%: $(libm) $(libmvec) \ - $(objpfx)%-wrappers.o +$(addprefix $(objpfx), $(libm-vec-tests)): $(objpfx)%: $(objpfx)%-wrappers.o $(libm) \ + $(libmvec) gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\ add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \