Opened 5 years ago

Closed 5 years ago

#59265 closed defect (fixed)

luajit @ 2.0.5 : Does not compile on Catalina with Xcode 11.1, CFLAG patch and link below

Reported by: justinGilmer (Justin Gilmer) Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.6.1
Keywords: haspatch Cc: justinGilmer (Justin Gilmer), jmroot (Joshua Root), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: luajit

Description (last modified by justinGilmer (Justin Gilmer))

I was trying to install Neovim @ 0.3.8 , which requires luajit. However, when attempting to build luajit @ 2.0.5, the error listed below occurs.

I found this apple developer thread which was discussing some compiler issues with Xcode 11.1 and that adding the CFLAG -fno-stack-check or changing the deployment target to 10.14 would provide a workaround. I chose the former, which is included below in my attached patch file. I was then able to successfully install luajit and Neovim.

Thread: https://forums.developer.apple.com/thread/121887

:notice:build --->  Building luajit
:debug:build Executing org.macports.build (luajit)
:debug:build Environment: 
:debug:build CC_PRINT_OPTIONS='YES'
:debug:build CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/.CC_PRINT_OPTIONS'
:debug:build CPATH='/opt/local/include'
:debug:build DEVELOPER_DIR='/Library/Developer/CommandLineTools'
:debug:build LIBRARY_PATH='/opt/local/lib'
:debug:build MACOSX_DEPLOYMENT_TARGET='10.15'
:debug:build SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'
:info:build Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5" && /usr/bin/make -j4 -w amalg CC="/usr/bin/clang" CFLAGS="-I/opt/local/include -Os -arch x86_64 -DLUAJIT_ENABLE_LUA52COMPAT" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64" PREFIX="/opt/local" Q="" 
:debug:build system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5" && /usr/bin/make -j4 -w amalg CC="/usr/bin/clang" CFLAGS="-I/opt/local/include -Os -arch x86_64 -DLUAJIT_ENABLE_LUA52COMPAT" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64" PREFIX="/opt/local" Q="" 
:info:build make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5'
:info:build Building LuaJIT 2.0.5
:info:build /Library/Developer/CommandLineTools/usr/bin/make -C src amalg
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5/src'
:info:build +--------------------------------------------------------------------------+
:info:build | WARNING: Compiling the amalgamation needs a lot of virtual memory        |
:info:build | (around 300 MB with GCC 4.x)! If you don't have enough physical memory   |
:info:build | your machine will start swapping to disk and the compile will not finish |
:info:build | within a reasonable amount of time.                                      |
:info:build | So either compile on a bigger machine or use the non-amalgamated build.  |
:info:build +--------------------------------------------------------------------------+
:info:build /Library/Developer/CommandLineTools/usr/bin/make all "LJCORE_O=ljamalg.o"
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5/src'
:info:build BUILDVM   lj_folddef.h
:info:build host/buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
:info:build BUILDVM   jit/vmdef.lua
:info:build host/buildvm -m vmdef -o jit/vmdef.lua lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
:info:build make[2]: *** [lj_folddef.h] Segmentation fault: 11
:info:build make[2]: *** Deleting file `lj_folddef.h'
:info:build make[2]: *** Waiting for unfinished jobs....
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5/src'
:info:build make[1]: *** [amalg] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5/src'
:info:build make: *** [amalg] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/work/LuaJIT-2.0.5" && /usr/bin/make -j4 -w amalg CC="/usr/bin/clang" CFLAGS="-I/opt/local/include -Os -arch x86_64 -DLUAJIT_ENABLE_LUA52COMPAT" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64" PREFIX="/opt/local" Q="" 
:info:build Exit code: 2
:error:build Failed to build luajit: command execution failed
:debug:build Error code: CHILDSTATUS 8792 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_luajit/luajit/main.log for details.

Attachments (1)

luajit.patch (620 bytes) - added by justinGilmer (Justin Gilmer) 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by justinGilmer (Justin Gilmer)

Attachment: luajit.patch added

comment:1 Changed 5 years ago by justinGilmer (Justin Gilmer)

Description: modified (diff)

comment:2 Changed 5 years ago by justinGilmer (Justin Gilmer)

Cc: justinGilmer added

comment:3 Changed 5 years ago by jmroot (Joshua Root)

Cc: jmroot added
Owner: set to stromnov
Status: newassigned

I'd be interested to know if you started from a fresh installation of Catalina or updated from the beta. There is a python crash that is worked around by this same flag, but only people who upgraded from the beta seem to be able to reproduce the crash. I would say that anything you built on a beta OS or with a beta toolchain should be considered suspect and needs to be uninstalled at the very least.

comment:4 Changed 5 years ago by justinGilmer (Justin Gilmer)

I think you would classify it as a fresh installation. I upgraded from Mojave to the actual release of Catalina.

Essentially the standard way a user of an older version might upgrade their OS

comment:5 Changed 5 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed

comment:6 Changed 5 years ago by jbrot

Unfortunately, the problematic behavior was not resolved in XCode 11.2. The patch from a few weeks ago does not black list XCode 11.2, so this bug has resurfaced.

I've spent a few minutes trying to resolve this locally by extending the blacklist, and it hasn't worked. I'm not sure if this is because I've not extended the blacklist correctly, or if it is because there is a different bug with XCode 11.2.

Once I can successfully resolve the issue, I will submit a patch. However, this may take a while---so perhaps someone more experienced than me will be able to resolve things in the meantime.

comment:7 Changed 5 years ago by jbrot

Resolution: fixed
Status: closedreopened

comment:8 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

There is a pull request that should (re)solve this problem.

comment:9 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:10 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: reopenedclosed

This problem should be fixed again.

Note: See TracTickets for help on using tickets.