From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F1A44384A804; Thu, 27 Oct 2022 21:35:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1A44384A804 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666906521; bh=IdUCsMTzT262PJaZhDkrVfZK+EAsOdQkuS0itfkQaqs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sOPXokT1Zf3Yd1F64HvcPkUgsamvx4J0PPE4Eo2x6AKskLv+EycAFwnWWamKn3AsL D4A8Us5Rn+9JVx5m6bGBj4JRdpBHUCilhG3an0Z0KttriqrQjI9O2eRZlZPZFI04YB 9rk28QZ4BXXv/StCcPKVa6mtE65zuM82KOemx7XI= From: "james.hilliard1 at gmail dot com" 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:35:21 +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: james.hilliard1 at gmail dot com 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 #10 from James Hilliard --- (In reply to Adhemerval Zanella from comment #9) > (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 relyin= g 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= build > > > complete toolchain for glibc) and build a stage1 on buildroot system = with: > > >=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). >=20 > Our script builds only one toolchain with multilib enabled (which I think= it > is not the case for buildroot). In any case, for stage1 either > mips64el-glibc-linux-gnu or mipsel-glibc-linux-gnu works (since for mips6= 4el > gcc still can generates -mabi=3D32 code). We're building with multilib disabled I think in buildroot here. Maybe there's something in glibc broken for non-multilib builds? >=20 > >=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? >=20 > I copy/paste from the stage1 config we use in your script and forget to > remove the mips64el one, using only mipsel-buildroot-linux-gnu should be > suffice. >=20 > >=20 > > >=20=20 > > > --with-sysroot=3D/tmp/buildroot/output/host/mipsel-buildroot-linux-gn= u/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-f= p-32=3Dxx > > > --- > >=20 > > I've attempted to make a build using this configuration but have not be= en > > 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 us= ed 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-3= 2=3Dxx > >=20 > > With this I get the same failure as before. Does this successfully buil= d for > > you? > >=20 >=20 > I did not actually patches the buildroot build system, but rather rebuild > the 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/bui= ld). >=20 > It does show to work: >=20 > $ file elf/ld.so > elf/ld.so: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYS= V), > 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. > [...] >=20 > At least qemu mips usermode can actually run the resulting loader. >=20 > > 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-= many-glibcs. > > > py;h=3D5af6f369ae04027911b3407c64716dd1571eae6a;hb=3DHEAD >=20 > I tried to hack the builroot system without much success, I also tried to > mimic what build-many-glibcs.py does, but I keep seeing the build failure. >=20 > However, if I rebuild the gcc with my hacked config: >=20 > ./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-documentati= on > --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/sy= sroot > --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float > --with-gmp=3D/tmp/buildroot/output/host --with-mpc=3D/tmp/buildroot/outpu= t/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-initfini-array --disable-libssp --disable-shared --without-heade= rs > --disable-threads --disable-libatomic --disable-decimal-float > --disable-libffi --disable-libgomp --disable-libitm --disable-libmpx > --disable-libquadmath --disable-libsanitizer --with-newlib >=20 > 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 ou= t. Yeah, so building manually like that tends to bypass a lot of our build environment and often ends up with built in host os utilities/dependencies getting pulled in instead of the intended buildroot toolchain versions. So a build succeeding outside of our env like that may not really mean a wh= ole lot in terms of it being a buildroot side bug as building manually may be u= sing a totally different environment that bypasses/sidesteps a bug. --=20 You are receiving this mail because: You are on the CC list for the bug.=