Skip to content

Commit 9c85a7f

Browse files
committed
[GR-17117] Update config header files and instructions on updating MRI.
PullRequest: truffleruby/949
2 parents 924b6cd + d49fede commit 9c85a7f

File tree

4 files changed

+173
-56
lines changed

4 files changed

+173
-56
lines changed

doc/contributor/updating-ruby.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ $ git diff vNN master | git apply -3
4040

4141
You'll usually get some conflicts to work out.
4242

43+
## Update config_*.h files
44+
45+
Configuration files must be regenerated from ruby for Linux and macOS
46+
and copied into `lib/cext/include/truffleruby`. In the MRI repository
47+
do the folowing
48+
49+
```
50+
autoconf
51+
CC=clang ./configure
52+
```
53+
54+
The output of configure should report that it has created or updated a
55+
config.h file. For example
56+
57+
```
58+
.ext/include/x86_64-linux/ruby/config.h updated
59+
```
60+
61+
You will need to copy that file to
62+
`lib/cext/include/truffleruby/config_linux.h` or
63+
`lib/cext/include/truffleruby/config_darwin.h`.
64+
4365
## Make other changes
4466

4567
* Update `versions.json` and `.ruby-version`

lib/cext/include/ruby/config.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// To generate those, go to MRI,
2-
// $ autoconf
3-
// $ CC=clang ./configure
4-
// $ find . -name config.h
1+
// See updating-ruby.md for instructions on regenerating config headers.
52
#ifdef __APPLE__
63
#include <truffleruby/config_darwin.h>
74
#else

lib/cext/include/truffleruby/config_darwin.h

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef INCLUDE_RUBY_CONFIG_H
22
#define INCLUDE_RUBY_CONFIG_H 1
33
/* confdefs.h */
4-
#define CANONICALIZATION_FOR_MATHN 1
54
#define STDC_HEADERS 1
65
#define HAVE_SYS_TYPES_H 1
76
#define HAVE_SYS_STAT_H 1
@@ -17,10 +16,10 @@
1716
#define _GNU_SOURCE 1
1817
#define _POSIX_PTHREAD_SEMANTICS 1
1918
#define _TANDEM_SOURCE 1
20-
#define HAVE_INFINITY 1
21-
#define HAVE_NAN 1
2219
#define RUBY_SYMBOL_EXPORT_BEGIN _Pragma("GCC visibility push(default)")
2320
#define RUBY_SYMBOL_EXPORT_END _Pragma("GCC visibility pop")
21+
#define HAVE_STMT_AND_DECL_IN_EXPR 1
22+
#define BROKEN_CRYPT 1
2423
#define HAVE_CRT_EXTERNS_H 1
2524
#define HAVE_LIBDL 1
2625
#define HAVE_DIRENT_H 1
@@ -35,6 +34,9 @@
3534
#define HAVE_LOCALE_H 1
3635
#define HAVE_MALLOC_MALLOC_H 1
3736
#define HAVE_PWD_H 1
37+
#define HAVE_SANITIZER_ASAN_INTERFACE_H 1
38+
#define HAVE_SANITIZER_MSAN_INTERFACE_H 1
39+
#define HAVE_STDALIGN_H 1
3840
#define HAVE_SYS_ATTR_H 1
3941
#define HAVE_SYS_FCNTL_H 1
4042
#define HAVE_SYS_FILE_H 1
@@ -43,7 +45,6 @@
4345
#define HAVE_SYS_RESOURCE_H 1
4446
#define HAVE_SYS_SELECT_H 1
4547
#define HAVE_SYS_SOCKET_H 1
46-
#define HAVE_SYS_SYSCALL_H 1
4748
#define HAVE_SYS_TIME_H 1
4849
#define HAVE_SYS_TIMES_H 1
4950
#define HAVE_SYS_UIO_H 1
@@ -60,77 +61,97 @@
6061
#define SIZEOF_LONG 8
6162
#define SIZEOF_LONG_LONG 8
6263
#define SIZEOF___INT64 0
64+
#define SIZEOF___INT128 16
6365
#define SIZEOF_OFF_T 8
6466
#define SIZEOF_VOIDP 8
6567
#define SIZEOF_FLOAT 4
6668
#define SIZEOF_DOUBLE 8
6769
#define SIZEOF_TIME_T 8
6870
#define SIZEOF_CLOCK_T 8
6971
#define PACKED_STRUCT(x) x __attribute__((packed))
70-
#define PACKED_STRUCT_UNALIGNED(x) x
72+
#define USE_UNALIGNED_MEMBER_ACCESS 1
7173
#define PRI_LL_PREFIX "ll"
74+
#define HAVE_PID_T 1
7275
#define rb_pid_t pid_t
7376
#define SIGNEDNESS_OF_PID_T -1
7477
#define PIDT2NUM(v) INT2NUM(v)
7578
#define NUM2PIDT(v) NUM2INT(v)
7679
#define PRI_PIDT_PREFIX PRI_INT_PREFIX
80+
#define HAVE_UID_T 1
7781
#define rb_uid_t uid_t
7882
#define SIGNEDNESS_OF_UID_T +1
7983
#define UIDT2NUM(v) UINT2NUM(v)
8084
#define NUM2UIDT(v) NUM2UINT(v)
8185
#define PRI_UIDT_PREFIX PRI_INT_PREFIX
86+
#define HAVE_GID_T 1
8287
#define rb_gid_t gid_t
8388
#define SIGNEDNESS_OF_GID_T +1
8489
#define GIDT2NUM(v) UINT2NUM(v)
8590
#define NUM2GIDT(v) NUM2UINT(v)
8691
#define PRI_GIDT_PREFIX PRI_INT_PREFIX
92+
#define HAVE_TIME_T 1
8793
#define rb_time_t time_t
8894
#define SIGNEDNESS_OF_TIME_T -1
8995
#define TIMET2NUM(v) LONG2NUM(v)
9096
#define NUM2TIMET(v) NUM2LONG(v)
9197
#define PRI_TIMET_PREFIX PRI_LONG_PREFIX
98+
#define HAVE_DEV_T 1
9299
#define rb_dev_t dev_t
93100
#define SIGNEDNESS_OF_DEV_T -1
94101
#define DEVT2NUM(v) INT2NUM(v)
95102
#define NUM2DEVT(v) NUM2INT(v)
96103
#define PRI_DEVT_PREFIX PRI_INT_PREFIX
104+
#define HAVE_MODE_T 1
97105
#define rb_mode_t mode_t
98106
#define SIGNEDNESS_OF_MODE_T +1
99-
#define MODET2NUM(v) UINT2NUM(v)
100-
#define NUM2MODET(v) NUM2UINT(v)
101-
#define PRI_MODET_PREFIX PRI_INT_PREFIX
107+
#define MODET2NUM(v) USHORT2NUM(v)
108+
#define NUM2MODET(v) NUM2USHORT(v)
109+
#define PRI_MODET_PREFIX PRI_SHORT_PREFIX
110+
#define HAVE_RLIM_T 1
102111
#define rb_rlim_t rlim_t
103112
#define SIGNEDNESS_OF_RLIM_T +1
104113
#define RLIM2NUM(v) ULL2NUM(v)
105114
#define NUM2RLIM(v) NUM2ULL(v)
106115
#define PRI_RLIM_PREFIX PRI_LL_PREFIX
116+
#define HAVE_OFF_T 1
107117
#define rb_off_t off_t
108118
#define SIGNEDNESS_OF_OFF_T -1
109119
#define OFFT2NUM(v) LL2NUM(v)
110120
#define NUM2OFFT(v) NUM2LL(v)
111121
#define PRI_OFFT_PREFIX PRI_LL_PREFIX
112-
#define rb_clockid_t int
113-
#define SIGNEDNESS_OF_CLOCKID_T -1
114-
#define CLOCKID2NUM(v) INT2NUM(v)
115-
#define NUM2CLOCKID(v) NUM2INT(v)
122+
#define HAVE_CLOCKID_T 1
123+
#define rb_clockid_t clockid_t
124+
#define SIGNEDNESS_OF_CLOCKID_T +1
125+
#define CLOCKID2NUM(v) UINT2NUM(v)
126+
#define NUM2CLOCKID(v) NUM2UINT(v)
116127
#define PRI_CLOCKID_PREFIX PRI_INT_PREFIX
117128
#define HAVE_PROTOTYPES 1
118129
#define TOKEN_PASTE(x,y) x##y
119130
#define STRINGIZE(expr) STRINGIZE0(expr)
120131
#define HAVE_STDARG_PROTOTYPES 1
121132
#define HAVE_VA_ARGS_MACRO 1
122-
#define NORETURN(x) __attribute__ ((noreturn)) x
123-
#define DEPRECATED(x) __attribute__ ((deprecated)) x
124-
#define DEPRECATED_BY(n,x) __attribute__ ((deprecated("by "#n))) x
125-
#define DEPRECATED_TYPE(mesg,x) x __attribute__ ((deprecated mesg))
126-
#define NOINLINE(x) __attribute__ ((noinline)) x
127-
#define WEAK(x) __attribute__ ((weak)) x
133+
#define RUBY_ALIGNAS(x) __attribute__((__aligned__(x)))
134+
#define RUBY_ALIGNOF alignof
135+
#define CONSTFUNC(x) __attribute__ ((__const__)) x
136+
#define PUREFUNC(x) __attribute__ ((__pure__)) x
137+
#define NORETURN(x) __attribute__ ((__noreturn__)) x
138+
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
139+
#define DEPRECATED_BY(n,x) __attribute__ ((__deprecated__("by "#n))) x
140+
#define DEPRECATED_TYPE(mesg,x) x __attribute__ ((__deprecated__ mesg))
141+
#define NOINLINE(x) __attribute__ ((__noinline__)) x
142+
#define ALWAYS_INLINE(x) __attribute__ ((__always_inline__)) x
143+
#define NO_SANITIZE(san, x) __attribute__ ((__no_sanitize__(san))) x
144+
#define NO_SANITIZE_ADDRESS(x) __attribute__ ((__no_sanitize_address__)) x
145+
#define NO_ADDRESS_SAFETY_ANALYSIS(x) __attribute__ ((__no_address_safety_analysis__)) x
146+
#define WARN_UNUSED_RESULT(x) __attribute__ ((__warn_unused_result__)) x
147+
#define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x
148+
#define WEAK(x) __attribute__ ((__weak__)) x
128149
#define HAVE_FUNC_WEAK 1
129-
#define FUNC_CDECL(x) __attribute__ ((cdecl)) x
150+
#define FUNC_CDECL(x) __attribute__ ((__cdecl__)) x
130151
#define HAVE_GCC_ATOMIC_BUILTINS 1
131152
#define HAVE_GCC_SYNC_BUILTINS 1
132153
#define UNREACHABLE __builtin_unreachable()
133-
#define RUBY_FUNC_EXPORTED __attribute__ ((visibility("default"))) extern
154+
#define RUBY_FUNC_EXPORTED __attribute__ ((__visibility__("default"))) extern
134155
#define RUBY_FUNCTION_NAME_STRING __func__
135156
#define ENUM_OVER_INT 1
136157
#define HAVE_DECL_SYS_NERR 1
@@ -173,12 +194,20 @@
173194
#define SIZEOF_INT64_T 8
174195
#define HAVE_UINT64_T 1
175196
#define SIZEOF_UINT64_T 8
197+
#define HAVE_INT128_T 1
198+
#define int128_t __int128
199+
#define SIZEOF_INT128_T SIZEOF___INT128
200+
#define HAVE_UINT128_T 1
201+
#define uint128_t unsigned __int128
202+
#define SIZEOF_UINT128_T SIZEOF___INT128
176203
#define HAVE_INTPTR_T 1
177204
#define SIZEOF_INTPTR_T 8
178205
#define HAVE_UINTPTR_T 1
179206
#define SIZEOF_UINTPTR_T 8
207+
#define PRI_PTR_PREFIX "l"
180208
#define HAVE_SSIZE_T 1
181209
#define SIZEOF_SSIZE_T 8
210+
#define PRI_64_PREFIX "ll"
182211
#define GETGROUPS_T gid_t
183212
#define RETSIGTYPE void
184213
#define HAVE_ALLOCA_H 1
@@ -196,6 +225,7 @@
196225
#define HAVE_ISNAN 1
197226
#define HAVE_LGAMMA_R 1
198227
#define HAVE_MEMMOVE 1
228+
#define HAVE_NAN 1
199229
#define HAVE_NEXTAFTER 1
200230
#define HAVE_STRCHR 1
201231
#define HAVE_STRERROR 1
@@ -208,8 +238,8 @@
208238
#define HAVE_FORK 1
209239
#define vfork fork
210240
#define HAVE_WORKING_FORK 1
211-
#define HAVE___SYSCALL 1
212241
#define HAVE__LONGJMP 1
242+
#define HAVE_ARC4RANDOM_BUF 1
213243
#define HAVE_ATAN2L 1
214244
#define HAVE_ATAN2F 1
215245
#define HAVE_CHROOT 1
@@ -223,8 +253,10 @@
223253
#define HAVE_FCHMOD 1
224254
#define HAVE_FCHOWN 1
225255
#define HAVE_FCNTL 1
256+
#define HAVE_FDOPENDIR 1
226257
#define HAVE_FGETATTRLIST 1
227258
#define HAVE_FMOD 1
259+
#define HAVE_FSTATAT 1
228260
#define HAVE_FSYNC 1
229261
#define HAVE_FTRUNCATE 1
230262
#define HAVE_GETATTRLIST 1
@@ -240,6 +272,7 @@
240272
#define HAVE_GETSID 1
241273
#define HAVE_GETTIMEOFDAY 1
242274
#define HAVE_GMTIME_R 1
275+
#define HAVE_GRANTPT 1
243276
#define HAVE_INITGROUPS 1
244277
#define HAVE_IOCTL 1
245278
#define HAVE_ISSETUGID 1
@@ -251,16 +284,19 @@
251284
#define HAVE_LOCKF 1
252285
#define HAVE_LOG2 1
253286
#define HAVE_LSTAT 1
287+
#define HAVE_LUTIMES 1
254288
#define HAVE_MALLOC_SIZE 1
255289
#define HAVE_MBLEN 1
256290
#define HAVE_MEMSET_S 1
257291
#define HAVE_WRITEV 1
258292
#define HAVE_MKFIFO 1
259293
#define HAVE_MKNOD 1
260294
#define HAVE_MKTIME 1
295+
#define HAVE_OPENAT 1
261296
#define HAVE_POLL 1
262297
#define HAVE_POSIX_MEMALIGN 1
263298
#define HAVE_PREAD 1
299+
#define HAVE_PWRITE 1
264300
#define HAVE_QSORT_R 1
265301
#define HAVE_READLINK 1
266302
#define HAVE_ROUND 1
@@ -286,70 +322,80 @@
286322
#define HAVE_SIGPROCMASK 1
287323
#define HAVE_SINH 1
288324
#define HAVE_SYMLINK 1
289-
#define HAVE_SYSCALL 1
290325
#define HAVE_SYSCONF 1
291326
#define HAVE_TANH 1
292327
#define HAVE_TELLDIR 1
293328
#define HAVE_TIMEGM 1
294329
#define HAVE_TIMES 1
295330
#define HAVE_TRUNCATE 1
296331
#define HAVE_UNSETENV 1
332+
#define HAVE_UTIMENSAT 1
297333
#define HAVE_UTIMES 1
298334
#define HAVE_WAIT4 1
299335
#define HAVE_WAITPID 1
300336
#if !defined __STDC_WANT_LIB_EXT1__
301337
#define __STDC_WANT_LIB_EXT1__ 1
302338
#endif /* !defined __STDC_WANT_LIB_EXT1__ */
339+
#define HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN 1
340+
#define HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED 1
303341
#define HAVE_BUILTIN___BUILTIN_BSWAP16 1
304342
#define HAVE_BUILTIN___BUILTIN_BSWAP32 1
305343
#define HAVE_BUILTIN___BUILTIN_BSWAP64 1
344+
#define HAVE_BUILTIN___BUILTIN_POPCOUNT 1
345+
#define HAVE_BUILTIN___BUILTIN_POPCOUNTLL 1
306346
#define HAVE_BUILTIN___BUILTIN_CLZ 1
307347
#define HAVE_BUILTIN___BUILTIN_CLZL 1
308348
#define HAVE_BUILTIN___BUILTIN_CLZLL 1
349+
#define HAVE_BUILTIN___BUILTIN_CTZ 1
350+
#define HAVE_BUILTIN___BUILTIN_CTZLL 1
351+
#define HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW 1
352+
#define HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW 1
353+
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW 1
354+
#define HAVE_BUILTIN___BUILTIN_CONSTANT_P 1
309355
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR 1
310356
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P 1
311357
#define HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P 1
358+
#define HAVE_BUILTIN___BUILTIN_TRAP 1
312359
#define HAVE_BSD_QSORT_R 1
313360
#define ATAN2_INF_C99 1
314-
#define LGAMMA_R_M0_FIX 1
315361
#define HAVE_CLOCK_GETRES 1
316362
#define HAVE_STRUCT_TM_TM_ZONE 1
317363
#define HAVE_TM_ZONE 1
318364
#define HAVE_STRUCT_TM_TM_GMTOFF 1
319365
#define HAVE_DAYLIGHT 1
320-
#define HAVE_VAR_TIMEZONE 1
321-
#define TYPEOF_VAR_TIMEZONE long
322-
#define HAVE_TIMEZONE 1
323-
#define TIMEZONE_VOID 1
324366
#define NEGATIVE_TIME_T 1
325367
#define POSIX_SIGNAL 1
368+
#define HAVE_SIG_T 1
326369
#define RSHIFT(x,y) ((x)>>(int)(y))
327370
#define HAVE__SC_CLK_TCK 1
328371
#define STACK_GROW_DIRECTION -1
372+
#define FIBER_USE_COROUTINE "coroutine/amd64/Context.h"
329373
#define _REENTRANT 1
330374
#define _THREAD_SAFE 1
331375
#define HAVE_LIBPTHREAD 1
332376
#define HAVE_SCHED_YIELD 1
333377
#define HAVE_PTHREAD_ATTR_SETINHERITSCHED 1
334378
#define HAVE_PTHREAD_ATTR_GETSTACK 1
379+
#define HAVE_PTHREAD_ATTR_GETGUARDSIZE 1
335380
#define HAVE_PTHREAD_GET_STACKADDR_NP 1
336381
#define HAVE_PTHREAD_GET_STACKSIZE_NP 1
337-
#define HAVE_PTHREAD_COND_INIT 1
338-
#define HAVE_PTHREAD_CONDATTR_INIT 1
339382
#define HAVE_PTHREAD_SIGMASK 1
340383
#define HAVE_PTHREAD_SETNAME_NP 1
341-
#define HAVE_PTHREAD_ATTR_INIT 1
342384
#define SET_CURRENT_THREAD_NAME(name) pthread_setname_np(name)
343385
#define DEFINE_MCONTEXT_PTR(mc, uc) mcontext_t mc = (uc)->uc_mcontext
386+
#define HAVE_MACH_O_LOADER_H 1
344387
#define HAVE_EXECINFO_H 1
345388
#define HAVE_LIBUNWIND_H 1
346389
#define HAVE_BACKTRACE 1
347390
#define BROKEN_BACKTRACE 1
348391
#define DLEXT_MAXLEN 7
349392
#define DLEXT ".bundle"
393+
#define HAVE__SETJMP 1
394+
#define HAVE_SIGSETJMP 1
350395
#define RUBY_SETJMP(env) sigsetjmp((env),0)
351396
#define RUBY_LONGJMP(env,val) siglongjmp((env),val)
352397
#define RUBY_JMP_BUF sigjmp_buf
398+
#define USE_MJIT 1
353399
#define HAVE_PTHREAD_H 1
354-
#define RUBY_PLATFORM "x86_64-darwin16"
400+
#define RUBY_PLATFORM "x86_64-darwin18"
355401
#endif /* INCLUDE_RUBY_CONFIG_H */

0 commit comments

Comments
 (0)