From d612c44dad8a5d4c373b0c4bc08a99e3dc06498e Mon Sep 17 00:00:00 2001 From: odaira Date: Tue, 4 Dec 2018 22:19:09 +0000 Subject: Enable MJIT on AIX * configure.ac: disable using __builtin_setjmp to avoid errors when execution globally jumps out of JITted code. Specify -std=gnu99 to JIT compilation to avoid errors regarding the "restrict" keyword in the precompiled header. Specify -shared in addition to -Wl,-G when building shared libraries to make mjit_build_dir.so expose the MJIT_BUILD_DIR symbol. Use LDR_PRELOAD to load mjit_build_dir.so. * mjit_worker.c: do not specify -nodefaultlibs or -nostdlibs because on AIX JITted code internally refers to the memcpy function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.ac | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ed88ec15ff..003a868095 100644 --- a/configure.ac +++ b/configure.ac @@ -996,6 +996,7 @@ main() ], [aix*],[ LIBS="-lm $LIBS" ac_cv_func_round=no + ac_cv_func___builtin_setjmp=no ], [linux*],[ LIBS="-lm $LIBS" # __builtin_longjmp in ppc64* Linux does not restore @@ -2563,7 +2564,10 @@ AC_SUBST(ARCH_FLAG)dnl AC_SUBST(MJIT_HEADER_FLAGS)dnl AC_SUBST(MJIT_HEADER_INSTALL_DIR)dnl AC_SUBST(MJIT_CC)dnl -AC_SUBST(MJIT_CFLAGS, [${MJIT_CFLAGS-"-w ${orig_cflags}"}])dnl +AS_IF([test "$GCC" = "yes"], [ + AS_CASE(["$target_os"],[aix*],[mjit_std_cflag="-std=gnu99"]) +]) +AC_SUBST(MJIT_CFLAGS, [${MJIT_CFLAGS-"-w ${mjit_std_cflag} ${orig_cflags}"}])dnl AC_SUBST(MJIT_OPTFLAGS, [${MJIT_OPTFLAGS-'$(optflags)'}])dnl AC_SUBST(MJIT_DEBUGFLAGS, [${MJIT_DEBUGFLAGS-'$(debugflags)'}])dnl AC_SUBST(MJIT_LDSHARED)dnl @@ -2679,7 +2683,11 @@ AS_IF([test "$with_dln_a_out" != yes], [ : ${PRELOADENV=DYLD_INSERT_LIBRARIES} rb_cv_dlopen=yes], [aix*], [ : ${LDSHARED='$(CC)'} - LDSHARED="$LDSHARED ${linker_flag}-G" + AS_IF([test "$GCC" = yes], [ + LDSHARED="$LDSHARED ${linker_flag}-G -shared" + ], [ + LDSHARED="$LDSHARED ${linker_flag}-G" + ]) EXTDLDFLAGS='-e$(TARGET_ENTRY)' XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl" XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}" @@ -2687,6 +2695,7 @@ AS_IF([test "$with_dln_a_out" != yes], [ TRY_LINK='$(CC) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)' TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(LOCAL_LIBS) $(LIBS)' : ${LIBPATHENV=LIBPATH} + : ${PRELOADENV=LDR_PRELOAD} rb_cv_dlopen=yes], [nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib" : ${LDSHARED='$(LD) -Bshareable -x'} -- cgit v1.2.3