Skip to content

Commit

Permalink
Use configured LD for linking enc and ext libraries
Browse files Browse the repository at this point in the history
"AR" was well propagated to the enc.mk and mkmf, but "LD" was not. This
caused the dynamic libraries to be linked with a linker found in the PATH,
which could be different from the one used in the Ruby build process.
This is especially important for cross-compilation, where the host
linker may not be compatible with the target system. (e.g. WebAssembly)
  • Loading branch information
kateinoigakukun committed Feb 29, 2024
1 parent 1c0c490 commit 57f014b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions enc/Makefile.in
Expand Up @@ -40,6 +40,7 @@ BUILTRUBY = $(topdir)/miniruby$(EXEEXT)

empty =
AR = @AR@
LD = @LD@
CC = @CC@
ARFLAGS = @ARFLAGS@$(empty)
RANLIB = @RANLIB@
Expand Down
1 change: 1 addition & 0 deletions lib/mkmf.rb
Expand Up @@ -2149,6 +2149,7 @@ def configuration(srcdir)
LDSHARED = #{CONFIG['LDSHARED']}
LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'}
AR = #{CONFIG['AR']}
LD = #{CONFIG['LD']}
EXEEXT = #{CONFIG['EXEEXT']}
}
Expand Down

0 comments on commit 57f014b

Please sign in to comment.