diff options
| author | Mike Pall <mike> | 2021-03-25 19:16:56 +0100 |
|---|---|---|
| committer | Mike Pall <mike> | 2021-03-25 19:16:56 +0100 |
| commit | d4a554d6ee1507f7313641b26ed09bf1b518fa1f (patch) | |
| tree | ca5d54d95e8700f145fec36c0d52758dd54388a6 /src/Makefile | |
| parent | 4c6b669c419f313306b9e6ee43be4ad5f6d73ec6 (diff) | |
| download | luajit-d4a554d6ee1507f7313641b26ed09bf1b518fa1f.tar.gz luajit-d4a554d6ee1507f7313641b26ed09bf1b518fa1f.tar.bz2 luajit-d4a554d6ee1507f7313641b26ed09bf1b518fa1f.zip | |
OSX: Fix build by hardcoding external frame unwinding.
Apparently they can't even get 'grep' right, let alone a keyboard.
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile index a6e25ba1..c98e571f 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -314,18 +314,12 @@ else | |||
| 314 | ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector 2>/dev/null || echo 1)) | 314 | ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector 2>/dev/null || echo 1)) |
| 315 | TARGET_XCFLAGS+= -fno-stack-protector | 315 | TARGET_XCFLAGS+= -fno-stack-protector |
| 316 | endif | 316 | endif |
| 317 | ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) | ||
| 318 | # Find out whether the target toolchain always generates unwind tables. | ||
| 319 | TARGET_TESTUNWIND=$(shell exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o tmpunwind.o && grep -qa -e eh_frame -e __unwind_info tmpunwind.o && echo E; rm -f tmpunwind.o) | ||
| 320 | ifneq (,$(findstring E,$(TARGET_TESTUNWIND))) | ||
| 321 | TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL | ||
| 322 | endif | ||
| 323 | endif | ||
| 324 | ifeq (Darwin,$(TARGET_SYS)) | 317 | ifeq (Darwin,$(TARGET_SYS)) |
| 325 | ifeq (,$(MACOSX_DEPLOYMENT_TARGET)) | 318 | ifeq (,$(MACOSX_DEPLOYMENT_TARGET)) |
| 326 | $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) | 319 | $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) |
| 327 | endif | 320 | endif |
| 328 | TARGET_STRIP+= -x | 321 | TARGET_STRIP+= -x |
| 322 | TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL | ||
| 329 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC | 323 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC |
| 330 | TARGET_DYNXLDOPTS= | 324 | TARGET_DYNXLDOPTS= |
| 331 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) | 325 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) |
| @@ -339,6 +333,13 @@ ifeq (iOS,$(TARGET_SYS)) | |||
| 339 | TARGET_XCFLAGS+= -fno-omit-frame-pointer | 333 | TARGET_XCFLAGS+= -fno-omit-frame-pointer |
| 340 | endif | 334 | endif |
| 341 | else | 335 | else |
| 336 | ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) | ||
| 337 | # Find out whether the target toolchain always generates unwind tables. | ||
| 338 | TARGET_TESTUNWIND=$(shell exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o tmpunwind.o && grep -qa -e eh_frame -e __unwind_info tmpunwind.o && echo E; rm -f tmpunwind.o) | ||
| 339 | ifneq (,$(findstring E,$(TARGET_TESTUNWIND))) | ||
| 340 | TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL | ||
| 341 | endif | ||
| 342 | endif | ||
| 342 | ifneq (SunOS,$(TARGET_SYS)) | 343 | ifneq (SunOS,$(TARGET_SYS)) |
| 343 | ifneq (PS3,$(TARGET_SYS)) | 344 | ifneq (PS3,$(TARGET_SYS)) |
| 344 | TARGET_XLDFLAGS+= -Wl,-E | 345 | TARGET_XLDFLAGS+= -Wl,-E |
