do not hardcode LD=ld in GNUmakefile

Bug #1913238 reported by Tom Gillespie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

When cross compiling for an alternate libc implementation (e.g. musl for
static linking) a different linker required. It is currenly impossible
to pass LD=some-other-linker-ld in the environment or as part of a call
to make because the GNUmakefile hardcodes LD=ld. This commit fixes that
an also make it so that make-target-contrib.sh inhertis LD in the same
way that it inherits CC.

I'm to 100% sure that this works as expected. I've tried it in what
should be a clean environment without issue, but am not entirely sure
that LD will be set correctly by default.

Tags: review
Revision history for this message
Tom Gillespie (tgbugs) wrote :
Revision history for this message
Shawn Ellis (shawn-ellis17) wrote :

I ran into something similar when trying to build SBCL on windows with Cygwin and CC=x86_64-w64-mingw32-gcc. The config file src/runtime/Config.x86-64-win32 uses CC=gcc even though I was trying to build with Mingw32. I was able to get around it by modifying the file to use CC ?= gcc.

I didn't try it, but using LD ?= ld might work for you in src/runtime/GNUmakefile.

Revision history for this message
Douglas Katzman (dougk) wrote :

I don't think LD should be set at all. The only uses occur in the win32 configurations and in the rule to make sbcl.mk, which also should not be setting LD.

Revision history for this message
Douglas Katzman (dougk) wrote :

this is obsolete. The makefile never directly uses 'ld' except in Config.*win32

Changed in sbcl:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.