Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys-devel/gcc: gcc -print-multi-os-directory returns ../lib64 on 64-bit musl systems #233

Open
blueness opened this issue Apr 13, 2019 · 12 comments

Comments

@blueness
Copy link
Collaborator

This is a continuation of https://bugs.gentoo.org/675954.

@blueness
Copy link
Collaborator Author

@awilfox
Copy link
Contributor

awilfox commented Apr 13, 2019

You'll also need the patch at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89587 for 32-bit PowerPC.

We (Adélie) backported it to GCC 8 at https://code.foxkit.us/adelie/packages/raw/eebc569/system/gcc/disable-multiarch-ppc32.patch if that helps.

@blueness
Copy link
Collaborator Author

@awilfox thanks. i'm going to test amd64 and aarch64 first since my ppc32 is not in the best stated.

gentoo-bot pushed a commit that referenced this issue Apr 13, 2019
Signed-off-by: Anthony G. Basile <[email protected]>
Package-Manager: Portage-2.3.62, Repoman-2.3.11
@gyakovlev
Copy link
Member

with new power profiles I also see it.

file /usr/bin/gcc
/usr/bin/gcc: symbolic link to /usr/powerpc64le-unknown-linux-musl/gcc-bin/9.2.0/gcc

 gcc -print-multi-os-directory
../lib64

I need to add ppc64 to the thingie here 923dace

gentoo-bot pushed a commit that referenced this issue Jan 30, 2020
Issue: #233
Package-Manager: Portage-2.3.86, Repoman-2.3.20
Signed-off-by: Georgy Yakovlev <[email protected]>
@gyakovlev
Copy link
Member

even after patching still does

gcc -print-multi-os-directory
../lib64

will need to investigate.

@mjeveritt
Copy link
Contributor

@gyakovlev am I right in thinking we got this fixed/patched upstream in the end? Or at least is elsewhere in-train?
@blueness ^ also.

@blueness
Copy link
Collaborator Author

@mjeveritt upstream ignored the bug, as I expected. Real life has gotten in the way of me fixing stuff, but the person to speak to to get this moving upstream is nsz in the #musl channel on freenode.

Side note: I have to apologize to everyone, but I know this is an issue and what's there is a hack. I'm just overwhelmed with real life.

@gyakovlev
Copy link
Member

my talos is down for maintenance till next week, but I think it still returns lib64 even with b116034 and I did not have time to investigate it yet.

@mjeveritt
Copy link
Contributor

https://bugs.gentoo.org/show_bug.cgi?id=675954 was gaining some traction with @trofi I believe doing some testing ...

@mjeveritt
Copy link
Contributor

See also https://gcc.gnu.org/pipermail/gcc/2020-March/231981.html for a partial-solution?

I will try to do some follow-up in #musl

gyakovlev added a commit to gyakovlev/musl that referenced this issue Oct 5, 2020
amd64 and arm64 parts unchanged.
moved the file and added ppc64 stuff, based on alpine patch.
this is final showstopper before enabling ppc64/ppc64le catalyst builds.

Bug: https://bugs.gentoo.org/675954
Issue: gentoo#233
Tracker: gentoo#295
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <[email protected]>
gentoo-bot pushed a commit that referenced this issue Oct 5, 2020
amd64 and arm64 parts unchanged.
moved the file and added ppc64 stuff, based on alpine patch.
this is final showstopper before enabling ppc64/ppc64le catalyst builds.

Bug: https://bugs.gentoo.org/675954
Issue: #233
Tracker: #295
Closes: #350
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <[email protected]>
@MaskRay
Copy link

MaskRay commented Mar 20, 2021

I am just trying to make -L in clang -target $triple '-###' (replace $triple with the directory names under usr/lib/{gcc,gcc-cross}/) output follow gcc more closely... And I noticed that gcc -print-multi-os-directory output has significance.

Some findings:

Arch Linux gcc / Debian gcc / Debian aarch64-linux-gnu-gcc => ../lib

Arch aarch64-linux-gnu-gcc / manually built --disable-multilib gcc => ../lib64

So do we know the rule for ../lib vs ../lib64? I need something which can be codified in clang driver.

@gyakovlev
Copy link
Member

@MaskRay musl always prefers /lib no matter the bitness, as multilib is kinda unsupported with it.

https://wiki.musl-libc.org/guidelines-for-distributions.html#Multilib/multi-arch

~~from above link
musl does not support sharing an include directory between archs (or 32-/64-bit “versions of the same target” in GCC multilib framing), and thus is not compatible with GCC-style multilib. It is recommended that distributions build GCC with multilib disabled, and use library directories named lib, not lib64 or lib32. Most importantly (see above) distributions should not change the dynamic linker location to /lib64 or anything else, since this breaks ABI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants