You are not logged in.

#1 2025-02-15 19:36:33

Megarock90
Member
Registered: 2012-01-18
Posts: 58

[SOLVED] Compile failure at link time.

Trying to build openloco but after it builds the executable it tries to link it and fails doing so. (with this error)

mold: fatal: /home/Felipe/.cache/yay/openloco/src/OpenLoco-25.01/distribution/linux/ld_script_i386.xc:10: OUTPUT_ARCH(i386)
                                                                                                          ^ unknown linker script token
collect2: error: ld returned 1 exit status

The PKGBUILD has set options=(!lto), I have also tried setting !lto on makepkg.conf and it STILL tries to link it.
There's another couple of packages I have that disable linking and they build as expected.

How do I get this to build correctly?
As explained below, it was an issue with mold not being compatible.

Last edited by Megarock90 (2025-02-15 22:56:43)

Offline

#2 2025-02-15 20:00:49

BS86
Member
Registered: 2022-11-03
Posts: 97

Re: [SOLVED] Compile failure at link time.

every binary needs to be linked, else you can't use it.
!lto just disables link time optimization.

Last edited by BS86 (2025-02-15 20:02:59)

Offline

#3 2025-02-15 21:30:41

loqs
Member
Registered: 2014-03-06
Posts: 18,730

Re: [SOLVED] Compile failure at link time.

What if you disable setting mold as the linker? As mold does not support OUTPUT_ARCH.

Offline

#4 2025-02-15 22:54:35

Megarock90
Member
Registered: 2012-01-18
Posts: 58

Re: [SOLVED] Compile failure at link time.

Yeah, as it turns out mold was the issue.
Is there an option to force the use of ld/lld on a PKGBUILD?

Offline

#5 2025-02-15 23:11:09

loqs
Member
Registered: 2014-03-06
Posts: 18,730

Re: [SOLVED] Compile failure at link time.

Megarock90 wrote:

Is there an option to force the use of ld/lld on a PKGBUILD?

No changing the linker or one of the other build tools requires setting the environment variable or whatever other mechanism the build system uses.

Offline

Board footer

Powered by FluxBB