From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CCA97384B12C; Thu, 27 Oct 2022 21:06:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCA97384B12C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666904760; bh=YtKPgEM+bW/1q2T1VhpKKhdEsInDdXxzYX5cLjq54Vw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YrRFndbmmmjTAVfRvX9Gcb2/Q32c/F4bGQOB+L4p569CHro0hhyqfXlR86P9e37WH r9dl41gcvX5f6qoKkTEl0oVL7/FfjRATPrr3vJHC3/tQ1HSdabYNSNbqFgh4u0xpvy E93mXM5ZMbn383DmExR+MWkQ/NVkLEBoEBNCtDto= From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/29621] librtld.os: in function `__register_frame': libgcc/unwind-dw2-fde.c:136: undefined reference to `malloc' Date: Thu, 27 Oct 2022 21:05:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.36 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29621 --- Comment #9 from Adhemerval Zanella --- (In reply to James Hilliard from comment #8) > (In reply to Adhemerval Zanella from comment #7) > > (In reply to James Hilliard from comment #6) > > >=20 > > > Full commands: > > > git clone https://github.com/buildroot/buildroot.git > > > cd buildroot > > > git checkout e4ecf82f99f53e55d51e6f74ae5021473aa2bb1d > > > wget > > > http://autobuild.buildroot.net/results/883/ > > > 883b171a856a63540908976592683527fdb21cd2/config > > > mv config .config > > > make glibc > >=20 > > Ok, with this one I can see the buildroot failure. It seems that it is > > misconfiguring the stage1 gcc, where the libgcc.a generated is relying = on > > the libc for unwinding (thus why ld.so link is failing). > >=20 > > I mimic what build-many-glibcs.py [1] does (which is canonical way to b= uild > > complete toolchain for glibc) and build a stage1 on buildroot system wi= th: > >=20 > > --- > > ./configure \ > > --prefix=3D/tmp/buildroot/output/host \ > > --build=3Dx86_64-pc-linux-gnu \ > > --host=3Dx86_64-pc-linux-gnu \ > > --target=3Dmips64el-glibc-linux-gnu \ >=20 > This looks wrong, we aren't building for mips64el(which our autobuilders > also indicate does not have this particular build failure). Our script builds only one toolchain with multilib enabled (which I think i= t is not the case for buildroot). In any case, for stage1 either mips64el-glibc-linux-gnu or mipsel-glibc-linux-gnu works (since for mips64el gcc still can generates -mabi=3D32 code). >=20 > > --sysconfdir=3D/tmp/buildroot/output/host/etc \ > > --localstatedir=3D/tmp/buildroot/output/host/var \ > > --target=3Dmipsel-buildroot-linux-gnu \ >=20 > Setting target a second time? I copy/paste from the stage1 config we use in your script and forget to rem= ove the mips64el one, using only mipsel-buildroot-linux-gnu should be suffice. >=20 > >=20=20 > > --with-sysroot=3D/tmp/buildroot/output/host/mipsel-buildroot-linux-gnu/= sysroot > > \ > > --with-gmp=3D/tmp/buildroot/output/host \ > > --with-mpc=3D/tmp/buildroot/output/host \ > > --with-mpfr=3D/tmp/buildroot/output/host \ > > --with-pkgversion=3D"Buildroot 2022.08-383-ge4ecf82f99-dirty" \ > > --with-bugurl=3Dhttp://bugs.buildroot.net/ \ > > --enable-initfini-array \ > > --disable-libssp \ > > --disable-shared \ > > --disable-threads \ > > --disable-libatomic \ > > --disable-decimal-float \ > > --disable-libffi \ > > --disable-libgomp \ > > --disable-libitm \ > > --disable-libmpx \ > > --disable-libquadmath \ > > --disable-libsanitizer \ > > --without-headers\ > > --with-newlib \ > > --enable-languages=3Dc, \ > > --with-arch=3Dmips32r3 --with-abi=3D32 --with-nan=3Dlegacy --with-fp-= 32=3Dxx > > --- >=20 > I've attempted to make a build using this configuration but have not been > able to get a working build. >=20 > >=20 > > And with this stage1 gcc I could finish the glibc build. I am afraid you > > will need to sort this out on buildroot stage1 configuration flags used= on > > gcc. >=20 > I've tested by patching our gcc stage1 > configure(package/gcc/gcc-initial/gcc-initial.mk). >=20 > Replacing HOST_GCC_INITIAL_CONF_OPTS with this for testing: > HOST_GCC_INITIAL_CONF_OPTS =3D \ > --build=3Dx86_64-pc-linux-gnu \ > --host=3Dx86_64-pc-linux-gnu \ > --target=3D$(GNU_TARGET_NAME) \ > --with-sysroot=3D$(STAGING_DIR) \ > --with-gmp=3D$(HOST_DIR) \ > --with-mpc=3D$(HOST_DIR) \ > --with-mpfr=3D$(HOST_DIR) \ > --with-pkgversion=3D"Buildroot $(BR2_VERSION_FULL)" \ > --with-bugurl=3Dhttp://bugs.buildroot.net/ \ > --enable-initfini-array \ > --disable-libssp \ > --disable-shared \ > --disable-threads \ > --disable-libatomic \ > --disable-decimal-float \ > --disable-libffi \ > --disable-libgomp \ > --disable-libitm \ > --disable-libmpx \ > --disable-libquadmath \ > --disable-libsanitizer \ > --without-headers \ > --with-newlib \ > --enable-languages=3Dc, \ > --with-arch=3Dmips32r3 --with-abi=3D32 --with-nan=3Dlegacy --with-fp-32= =3Dxx >=20 > With this I get the same failure as before. Does this successfully build = for > you? >=20 I did not actually patches the buildroot build system, but rather rebuild t= he stage1 gcc at output/build/host-gcc-initial-11.3.0/build with the configuration, issued make install and rebuild the glibc (output/build/glibc-2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3/build= ). It does show to work: $ file elf/ld.so elf/ld.so: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, with debug_info, not stripped $ ./elf/ld.so --version ld.so (Buildroot) stable release version 2.36. Copyright (C) 2022 Free Software Foundation, Inc. [...] $ ./elf/ld.so ./libc.so GNU C Library (Buildroot) stable release version 2.36. [...] At least qemu mips usermode can actually run the resulting loader. > After patching gcc-initial.mk to test I do: > make clean > make glibc >=20 > >=20 > > [1] > > https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dscripts/build-ma= ny-glibcs. > > py;h=3D5af6f369ae04027911b3407c64716dd1571eae6a;hb=3DHEAD I tried to hack the builroot system without much success, I also tried to m= imic what build-many-glibcs.py does, but I keep seeing the build failure. However, if I rebuild the gcc with my hacked config: ./configure --prefix=3D/tmp/buildroot/output/host --sysconfdir=3D/tmp/buildroot/output/host/etc --localstatedir=3D/tmp/buildroot/output/host/var --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --disable-debug --with-xmlto=3Dno --with-fop=3Dno --disable-nls --disable-dependency-tracking --target=3Dmipsel-buildroot-linux-gnu --with-sysroot=3D/tmp/buildroot/output/host/mipsel-buildroot-linux-gnu/sysr= oot --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=3D/tmp/buildroot/output/host --with-mpc=3D/tmp/buildroot/output/= host --with-mpfr=3D/tmp/buildroot/output/host --with-pkgversion=3D"Buildroot 2022.08-383-ge4ecf82f99-dirty" --with-bugurl=3Dhttp://bugs.buildroot.net/ --without-zstd --disable-libquadmath --disable-libquadmath-support --without-isl --without-cloog --with-arch=3Dmips32r3 --with-abi=3D32 --with-nan=3Dlegacy --with-fp-32=3Dxx --enable-languages=3Dc --enable-initf= ini-array --disable-libssp --disable-shared --without-headers --disable-threads --disable-libatomic --disable-decimal-float --disable-libffi --disable-libg= omp --disable-libitm --disable-libmpx --disable-libquadmath --disable-libsaniti= zer --with-newlib on the buildroot directory, reinstall it, and the glibc does finish. That's= why I think there is something bogues on buildroot that I can't figure out. --=20 You are receiving this mail because: You are on the CC list for the bug.=