diff options
author | Lukas Larsson <lukas@erlang.org> | 2022-01-21 11:23:48 +0100 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2022-01-21 11:23:48 +0100 |
commit | ceca17908ca5d7c5d436530d1c5b45e8febc24cc (patch) | |
tree | bcb4512eb6498fc11c6bebad3aae9b81630a01bf /make/autoconf | |
parent | 0ef24bfcbd4950171e9279a697249961d438481a (diff) | |
parent | c189373eb8412ea3a4d95cb6dfbd18a5d67dc1c6 (diff) | |
download | erlang-ceca17908ca5d7c5d436530d1c5b45e8febc24cc.tar.gz |
Merge branch 'maint'
Diffstat (limited to 'make/autoconf')
-rw-r--r-- | make/autoconf/otp.m4 | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/make/autoconf/otp.m4 b/make/autoconf/otp.m4 index de67161a47..d2dd7e2e67 100644 --- a/make/autoconf/otp.m4 +++ b/make/autoconf/otp.m4 @@ -2992,11 +2992,26 @@ dnl AC_DEFUN(ERL_DED, [ +LM_CHECK_THR_LIB + +if test "$THR_DEFS" = ""; then + DED_THR_DEFS="-D_THREAD_SAFE -D_REENTRANT" +else + DED_THR_DEFS="$THR_DEFS" +fi + +AC_SUBST(DED_THR_DEFS) + +ERL_DED_FLAGS + +]) + +AC_DEFUN(ERL_DED_FLAGS, + [ + USER_LD=$LD USER_LDFLAGS="$LDFLAGS" -LM_CHECK_THR_LIB - DED_CC=$CC DED_GCC=$GCC @@ -3012,7 +3027,6 @@ case $host_os in ;; esac - DED_WARN_FLAGS="-Wall -Wstrict-prototypes" case "$host_cpu" in tile*) @@ -3032,12 +3046,6 @@ LM_TRY_ENABLE_CFLAG([-Werror=undef], [DED_WERRORFLAGS]) DED_SYS_INCLUDE="-I${ERL_TOP}/erts/emulator/beam -I${ERL_TOP}/erts/include -I${ERL_TOP}/erts/include/$host -I${ERL_TOP}/erts/include/internal -I${ERL_TOP}/erts/include/internal/$host -I${ERL_TOP}/erts/emulator/sys/$DED_OSTYPE -I${ERL_TOP}/erts/emulator/sys/common" DED_INCLUDE=$DED_SYS_INCLUDE -if test "$THR_DEFS" = ""; then - DED_THR_DEFS="-D_THREAD_SAFE -D_REENTRANT" -else - DED_THR_DEFS="$THR_DEFS" -fi -# DED_EMU_THR_DEFS=$EMU_THR_DEFS DED_CFLAGS="$CFLAGS $CPPFLAGS $DED_CFLAGS" AS_IF( [test "x$GCC" = xyes], @@ -3114,9 +3122,18 @@ case $host_os in DED_LDFLAGS="-Bshareable" ;; darwin*) - # Mach-O linker: a shared lib and a loadable - # object file is not the same thing. - DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + # Mach-O linker: a shared lib and a loadable object file is not the same thing. + + if test "X${ERL_DED_FLAT_BUNDLE}" = "Xtrue"; then + # EI sets this variable when building its .so file as beam.smp + # has not been built yet and any ei lib will not + # link to beam.smp anyways + DED_LDFLAGS="-bundle -flat_namespace -undefined suppress" + else + # Cannot use flat namespaces for drivers/nifs as that may cause + # symbols to collide during loading + DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + fi # DED_LDFLAGS_CONFTEST is for use in configure tests only. We # cannot use DED_LDFLAGS in configure tests since beam.smp has not # been built yet... @@ -3226,7 +3243,6 @@ AC_SUBST(DED_LD) AC_SUBST(DED_LDFLAGS) AC_SUBST(DED_LD_FLAG_RUNTIME_LIBRARY_PATH) AC_SUBST(DED_LIBS) -AC_SUBST(DED_THR_DEFS) AC_SUBST(DED_OSTYPE) ]) |