Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15682 closed bug (fixed)

libroot build broken for gcc2

Reported by: korli Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: System/libroot.so Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

As objects/haiku/x86_gcc2/release/system/libroot/posix/musl/math/x86/__invtrigl.o 
/bin/sh: 2: -Wa,-mrelax-relocations=no: not found

-Wa,-mrelax-relocations=no -Wno-unused-but-set-variable -c "../src/system/libroot/posix/musl/math/x86/__invtrigl.s" -O2 -march=pentium -nostdinc -D_ASSEMBLER -DARCH_x86 -D_BEOS_R5_COMPATIBLE_ -DBOOT_ARCHIVE_IMAGE_OFFSET=320 -D__HAIKU_PRIMARY_PACKAGING_ARCH=\"x86_gcc2\" -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -DHAIKU_TARGET_PLATFORM_HAIKU -DHAIKU_REGULAR_BUILD -I../build/user_config_headers -I../build/config_headers -I../src/system/libroot/posix/musl/math/x86 -Iobjects/common/system/libroot/posix/musl/math/x86 -Iobjects/linux/x86_64/common/system/libroot/posix/musl/math/x86 -Iobjects/haiku/x86_gcc2/common/system/libroot/posix/musl/math/x86 -I../src/system/libroot/posix/musl/math/x86/../../internal -I../src/system/libroot/posix/musl/math/x86/../../arch/x86 -I../src/system/libroot/posix/musl/math/x86/../../arch/generic -I../src/system/libroot/posix/musl/math/x86/.. -I- -I../src/system/libroot/posix/musl/math/x86/../../include -I../headers/cpp -I../headers/glibc -I../headers/posix -I../headers/build/gcc-2.95.3 -I../headers -I../headers/os -I../headers/os/add-ons -I../headers/os/add-ons/file_system -I../headers/os/add-ons/graphics -I../headers/os/add-ons/input_server -I../headers/os/add-ons/registrar -I../headers/os/add-ons/screen_saver -I../headers/os/add-ons/tracker -I../headers/os/app -I../headers/os/device -I../headers/os/drivers -I../headers/os/game -I../headers/os/interface -I../headers/os/kernel -I../headers/os/locale -I../headers/os/media -I../headers/os/mail -I../headers/os/midi -I../headers/os/midi2 -I../headers/os/net -I../headers/os/storage -I../headers/os/support -I../headers/os/translation -I../headers/private/. -o "objects/haiku/x86_gcc2/release/system/libroot/posix/musl/math/x86/__invtrigl.o"

...failed As objects/haiku/x86_gcc2/release/system/libroot/posix/musl/math/x86/__invtrigl.o ...

Change History (10)

comment:1 by korli, 5 years ago

introduced in hrev53728

comment:2 by waddlesplash, 5 years ago

I don't understand, there are plenty of nightlies and repos built since then.

The real problem appears to be that "-Wa,-mrelax-relocations=no" is the application /bin/sh is trying to run. Whatever happened to "gcc"? That looks like the real problem here.

comment:3 by ambroff, 5 years ago

This happened in my cross-compilation attempt today as well, using

../configure ... --build-cross-tools x86_gcc2 ../../buildtools

The problem is this block here from src/system/libroot/posix/musl/math/x86/Jamfile:

if $(architecture) = x86_gcc2 {
    # GCC 2 miscompiles some of the files in here, so we use GCC 8.
    original_TARGET_CC_x86_gcc2 = $(TARGET_CC_x86_gcc2) ;
    TARGET_CC_x86_gcc2 = $(TARGET_CC_x86) -Wa,-mrelax-relocations=no -Wno-unused-but-set-variable ;
}

If you look in generated.x86_gcc2/build/BuildConfig, the only packaging arch is only set to x86_gcc2

HAIKU_PACKAGING_ARCHS           ?=  x86_gcc2 ;

So there is no secondary arch. I haven't completely untangled the evaluation from TARGET_CC_x86_gcc2 and TARGET_CC_x86, but I suspect that since the x68 arch isn't defined as a secondary arch that TARGET_CC_x86 will evaluate to empty.

I'll have more time after work to dig into this.

comment:4 by waddlesplash, 5 years ago

but I suspect that since the x68 arch isn't defined as a secondary arch that TARGET_CC_x86 will evaluate to empty.

Yes, that's correct.

Ah, that explains things. Yes, those changes for musl make it impossible to do GCC2-only builds at this point; you will have to at least have a GCC8 compiler around and configured, even if you are not "using" it.

comment:5 by korli, 5 years ago

@waddlesplash the configure script should probably enforce this new requirement.

comment:6 by ambroff, 5 years ago

That seems like the most straightforward fix.

comment:7 by waddlesplash, 5 years ago

Resolution: fixed
Status: newclosed

Done in hrev53850.

comment:8 by korli, 5 years ago

On a side note, this also means that x86_gcc2 secondary arch (and primary arch x86_64) wouldn't be supported anymore (or maybe with a x86 third arch).

comment:9 by pulkomandy, 5 years ago

The 64bit compiler can be used in 32bit mode with the -m32 switch, so we don't really need a complete third arch. It will require some rework and changes in the Jamfiles, still.

comment:10 by nielx, 5 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.