Skip to content

Commit c2484a6

Browse files
committed
Fixes for linker.
1 parent 92cf25c commit c2484a6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/cext/preprocess.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
file_name = ARGV.first
1515
original_content = File.read(file_name)
16-
output = Truffle::CEXt::Preprocessor.patch(file_name, original_content, Dir.pwd)
16+
output = Truffle::CExt::Preprocessor.patch(file_name, original_content, Dir.pwd)
1717

1818
if ENV['PREPROCESS_DEBUG'] && original_content != output
1919
patched_file_name = "#{File.dirname file_name}/.#{File.basename file_name, '.*'}.patched#{File.extname file_name}"

lib/truffle/rbconfig-for-mkmf.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,22 @@
132132
# compiler which disables this standard behaviour of the C preprocessor.
133133
begin
134134
with_conditional_preprocessing = proc do |command1, command2|
135-
Truffle::CExt::Preprocessor.makefile_matcher("#{preprocess_ruby} #{cext_dir}/preprocess.rb $< | #{command1}", command2)
135+
Truffle::CExt::Preprocessor.makefile_matcher(command1, command2)
136136
end
137137

138138
for_file = proc do |compiler, flags, opt_command|
139139
"#{compiler} #{flags} $< && #{opt_command}"
140140
end
141141

142142
for_pipe = proc do |compiler, flags, opt_command|
143-
"#{compiler} -I$(<D) #{flags} - -o $@ && #{opt_command}"
143+
"#{preprocess_ruby} #{cext_dir}/preprocess.rb $< | #{compiler} -I$(<D) #{flags} - -o $@ && #{opt_command}"
144144
end
145145

146146
c_flags = '$(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG) -xc'
147147
cxx_flags = '$(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG) -xc++'
148148
opt_command = "#{opt} #{opt_passes} $@ -o $@"
149149

150-
mkconfig['TRUFFLE_RAW_COMPILE_C'] = for_file.call("$(CC)", c_flags, opt_command)
150+
mkconfig['TRUFFLE_RAW_COMPILE_C'] = for_pipe.call('$(CC)', c_flags, opt_command)
151151
mkconfig['COMPILE_C'] = with_conditional_preprocessing.call(
152152
for_pipe.call('$(CC)', c_flags, opt_command),
153153
for_file.call('$(CC)', c_flags, opt_command))
@@ -160,6 +160,6 @@
160160
# From mkmf.rb: "$(CC) #{OUTFLAG}#{CONFTEST}#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
161161
mkconfig['TRY_LINK'] = "#{cc} -o conftest $(INCFLAGS) $(CPPFLAGS) #{base_cflags} #{link_o_files} $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
162162

163-
%w[COMPILE_C COMPILE_CXX TRY_LINK].each do |key|
163+
%w[COMPILE_C COMPILE_CXX TRY_LINK TRUFFLE_RAW_COMPILE_C].each do |key|
164164
expanded[key] = mkconfig[key].gsub(/\$\((\w+)\)/) { expanded.fetch($1) { $& } }
165165
end

0 commit comments

Comments
 (0)