Skip to content

Commit d787504

Browse files
committed
Generate the native configs using the system compiler
1 parent da2df4e commit d787504

File tree

5 files changed

+14
-25
lines changed

5 files changed

+14
-25
lines changed

ci.jsonnet

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,11 @@ local part_definitions = {
383383
generate_native_config: {
384384
setup+: [
385385
["ruby", "-e", "pp RbConfig::MAKEFILE_CONFIG"], # For convenience
386-
["mx", "sforceimports"], # clone the graal repo
387-
["mx", "-p", "../graal/sulong", "build"],
388-
["set-export", "TOOLCHAIN_PATH", ["mx", "-p", "../graal/sulong", "lli", "--print-toolchain-path"]],
389386
],
390387
run+: [
391-
["env",
392-
"LD_LIBRARY_PATH=$BUILD_DIR/graal/sulong/mxbuild/" + self.os + "-" + self.arch + "/SULONG_HOME/native/lib:$LD_LIBRARY_PATH", # for finding libc++
393-
"PATH=$TOOLCHAIN_PATH:$PATH",
394-
"ruby", "tool/generate-native-config.rb"],
388+
["ruby", "tool/generate-native-config.rb"],
395389
["cat", "src/main/java/org/truffleruby/platform/" + self.platform_name + "NativeConfiguration.java"],
396390

397-
# Uses the system compiler as using the toolchain for this does not work on macOS
398391
["tool/generate-config-header.sh"],
399392
["cat", "lib/cext/include/truffleruby/config_" + self.os + "_" + self.arch + ".h"],
400393
],

lib/cext/include/truffleruby/config_linux_aarch64.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#define HAVE_LOCALE_H 1
5252
#define HAVE_MALLOC_H 1
5353
#define HAVE_PWD_H 1
54+
#define HAVE_SANITIZER_ASAN_INTERFACE_H 1
5455
#define HAVE_STDALIGN_H 1
5556
#define HAVE_STDIO_H 1
5657
#define HAVE_SYS_EVENTFD_H 1
@@ -155,7 +156,6 @@
155156
#define DEPRECATED_BY(n,x) __attribute__ ((__deprecated__("by "#n))) x
156157
#define NOINLINE(x) __attribute__ ((__noinline__)) x
157158
#define ALWAYS_INLINE(x) __attribute__ ((__always_inline__)) x
158-
#define NO_SANITIZE(san, x) __attribute__ ((__no_sanitize__(san))) x
159159
#define NO_SANITIZE_ADDRESS(x) __attribute__ ((__no_sanitize_address__)) x
160160
#define NO_ADDRESS_SAFETY_ANALYSIS(x) __attribute__ ((__no_address_safety_analysis__)) x
161161
#define WARN_UNUSED_RESULT(x) __attribute__ ((__warn_unused_result__)) x
@@ -166,7 +166,8 @@
166166
#define HAVE_FUNC_WEAK 1
167167
#define RUBY_CXX_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
168168
#define HAVE_NULLPTR 1
169-
#define FUNC_CDECL(x) __attribute__ ((__cdecl__)) x
169+
#define FUNC_UNOPTIMIZED(x) __attribute__ ((__optimize__("O0"))) x
170+
#define FUNC_MINIMIZED(x) __attribute__ ((__optimize__("-Os","-fomit-frame-pointer"))) x
170171
#define HAVE_ATTRIBUTE_FUNCTION_ALIAS 1
171172
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) type prot __attribute__((alias(#name)));
172173
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)
@@ -406,6 +407,7 @@
406407
#define HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW 1
407408
#define HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW 1
408409
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW 1
410+
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P 1
409411
#define HAVE_BUILTIN___BUILTIN_CONSTANT_P 1
410412
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR 1
411413
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P 1
@@ -454,9 +456,8 @@
454456
#define DLEXT_MAXLEN 3
455457
#define DLEXT ".so"
456458
#define HAVE__SETJMP 1
457-
#define RUBY_SETJMP(env) _setjmp((env))
458-
#define RUBY_LONGJMP(env,val) _longjmp((env),val)
459-
#define RUBY_JMP_BUF jmp_buf
459+
#define RUBY_SETJMP(env) __builtin_setjmp((env))
460+
#define RUBY_LONGJMP(env,val) __builtin_longjmp((env),val)
460461
#define USE_MJIT 1
461462
#define USE_YJIT 0
462463
#define RUBY_PLATFORM "aarch64-linux"

lib/cext/include/truffleruby/config_linux_amd64.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#define HAVE_LOCALE_H 1
5252
#define HAVE_MALLOC_H 1
5353
#define HAVE_PWD_H 1
54+
#define HAVE_SANITIZER_ASAN_INTERFACE_H 1
5455
#define HAVE_STDALIGN_H 1
5556
#define HAVE_STDIO_H 1
5657
#define HAVE_SYS_EVENTFD_H 1
@@ -169,7 +170,8 @@
169170
#define HAVE_FUNC_WEAK 1
170171
#define RUBY_CXX_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
171172
#define HAVE_NULLPTR 1
172-
#define FUNC_CDECL(x) __attribute__ ((__cdecl__)) x
173+
#define FUNC_UNOPTIMIZED(x) __attribute__ ((__optimize__("O0"))) x
174+
#define FUNC_MINIMIZED(x) __attribute__ ((__optimize__("-Os","-fomit-frame-pointer"))) x
173175
#define HAVE_ATTRIBUTE_FUNCTION_ALIAS 1
174176
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) type prot __attribute__((alias(#name)));
175177
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)
@@ -409,6 +411,7 @@
409411
#define HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW 1
410412
#define HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW 1
411413
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW 1
414+
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P 1
412415
#define HAVE_BUILTIN___BUILTIN_CONSTANT_P 1
413416
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR 1
414417
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P 1
@@ -457,8 +460,8 @@
457460
#define DLEXT_MAXLEN 3
458461
#define DLEXT ".so"
459462
#define HAVE__SETJMP 1
460-
#define RUBY_SETJMP(env) __builtin_setjmp((void **)(env))
461-
#define RUBY_LONGJMP(env,val) __builtin_longjmp((void **)(env),val)
463+
#define RUBY_SETJMP(env) __builtin_setjmp((env))
464+
#define RUBY_LONGJMP(env,val) __builtin_longjmp((env),val)
462465
#define USE_MJIT 1
463466
#define USE_YJIT 0
464467
#define RUBY_PLATFORM "x86_64-linux"

tool/generate-config-header.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ arch=${arch/arm64/aarch64}
2222

2323
mx_platform="${os}_${arch}"
2424

25-
if [ "$os" != "darwin" ]; then
26-
if [ -z "$TOOLCHAIN_PATH" ]; then
27-
echo "TOOLCHAIN_PATH must be set"
28-
exit 1
29-
fi
30-
export PATH="$TOOLCHAIN_PATH:$PATH"
31-
fi
32-
3325
archive=$(basename "$url")
3426

3527
if [ ! -e "$archive" ]; then

tool/generate-native-config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def field(name)
188188
end
189189

190190
def cc
191-
ENV.fetch('CXX', 'clang++')
191+
ENV.fetch('CXX', 'c++')
192192
end
193193

194194
def source_file

0 commit comments

Comments
 (0)