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

Non-tools builds fail linking on Linux with ld.gold #31197

Closed
akien-mga opened this issue Aug 8, 2019 · 9 comments
Closed

Non-tools builds fail linking on Linux with ld.gold #31197

akien-mga opened this issue Aug 8, 2019 · 9 comments

Comments

@akien-mga
Copy link
Member

Godot version:
3.2 master (1d5ae6d) after #24086

OS/device including version:
Mageia 7 x86_64

$ gcc --version | head -n 1
gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524
$ ld.gold --version | head -n 1
GNU gold (GNU Binutils 2.32) 1.16

Issue description:
When compiling with ld.gold as linker, the linking step fails with:

Linking Program        ==> bin/godot.x11.opt.64
/bin/ld.gold: error: platform/x11/pck_embed.ld:10:8: syntax error, unexpected STRING
/bin/ld.gold: fatal error: unable to parse script file platform/x11/pck_embed.ld
collect2: error: ld returned 1 exit status

It works fine with ld (GNU ld (GNU Binutils) 2.32).

CC @RandomShaper

Steps to reproduce:

  • Make sure you have ld.gold installed and in PATH
  • scons p=x11 LINKFLAGS=-fuse-ld=gold tools=no target=release
@akien-mga
Copy link
Member Author

For the reference, it links fine with LLD (use_llvm=yes use_lld=yes).

@creikey
Copy link
Contributor

creikey commented Aug 9, 2019

This stackoverflow answer seems to have some pointers to using gold: https://stackoverflow.com/questions/3476093/replacing-ld-with-gold-any-experience

@Anutrix
Copy link
Contributor

Anutrix commented Aug 21, 2019

The initial design of gold meant to not support any linker scripts. Then
they end up supporting some cases, but "INSERT BEFORE .data" is not one of
them if I remember correctly.

Source: clang-omp/clang_trunk#30 (comment)
Maybe the build is failing because gold just doesn't support BEFORE and AFTER.
Note: I wasn't able to confirm or deny the above statement in the quote.

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Jan 19, 2020
@KoBeWi
Copy link
Member

KoBeWi commented Dec 18, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@akien-mga
Copy link
Member Author

akien-mga commented Dec 18, 2020

Yes, the same method is still used with a linker script for the PCK bundling option, which is incompatible with ld.gold. So it's reproducible both in master and 3.2, but it's fairly low priority.

@RandomShaper
Copy link
Member

I hope I can allocate some time soon to rework the PCK embedding so we can remove the current fragile approach.

@akien-mga
Copy link
Member Author

akien-mga commented Nov 10, 2021

For the reference this is still reproducible... but also not very critical. I'm fine if we want to close this as WONTFIX and just let it be documented by the closed issue. We don't use ld.gold for official builds.

@RandomShaper
Copy link
Member

I've not been able to allocate time for this. Feel free to close it. It's in my to do list, though, so it will be fixed one day. 😃

@akien-mga
Copy link
Member Author

Yeah I think we can close it. It will be fixed as a side effect when we refactor PCK embedding, but the problem with ld.gold specifically is not worth keeping track of.

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

No branches or pull requests

5 participants