diff options
author | Erlang/OTP <otp@erlang.org> | 2021-02-19 11:38:51 +0100 |
---|---|---|
committer | Erlang/OTP <otp@erlang.org> | 2021-02-19 11:38:51 +0100 |
commit | 499fbaf75c13a8e240fe6a0a77ed87ab17f81190 (patch) | |
tree | 3cae82ff0bc019c054cea126be0ace8f0181b1bc | |
parent | 4b3e9c4569078cbf8b26740b5873a922e090b3f7 (diff) | |
parent | 2b91ffde7c25051206a8679fcbe401367b81e282 (diff) | |
download | erlang-499fbaf75c13a8e240fe6a0a77ed87ab17f81190.tar.gz |
Merge branch 'bjorn/macos11-otp21/OTP-16779' into maint-21
* bjorn/macos11-otp21/OTP-16779:
inets: Eliminate warnings in C code in tests
kernel: Eliminate warnings in C code in tests
erts: Eliminate warnings in C code in tests
Add missing include statements in in6addr tests
Update config scripts to compile for Apple Silicon (arm64)
macOS: Remove version check in configure script
Fix segfault(s) from variadic args on ARM64
Undo perform degradation on macOS
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.in | 45 | ||||
-rw-r--r-- | erts/aclocal.m4 | 3 | ||||
-rw-r--r-- | erts/configure.in | 4 | ||||
-rw-r--r-- | erts/emulator/beam/erl_db_util.c | 18 | ||||
-rw-r--r-- | erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c | 4 | ||||
-rw-r--r-- | erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c | 4 | ||||
-rw-r--r-- | erts/emulator/test/estone_SUITE_data/estone_cat.c | 8 | ||||
-rw-r--r-- | erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c | 1 | ||||
-rw-r--r-- | erts/emulator/test/port_bif_SUITE_data/port_test.c | 3 | ||||
-rw-r--r-- | lib/inets/test/httpd_SUITE_data/cgi_echo.c | 2 | ||||
-rw-r--r-- | lib/kernel/test/os_SUITE_data/my_fds.c | 4 |
12 files changed, 39 insertions, 58 deletions
diff --git a/.gitignore b/.gitignore index b90bda1763..1d12948441 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ armv7l-unknown-linux-gnueabihf i686-pc-linux-gnu x86_64-unknown-linux-gnu i386-apple-darwin[0-9]*.[0-9]*.[0-9]* +arm-apple-darwin[0-9]*.[0-9]*.[0-9]* x86_64-apple-darwin[0-9]*.[0-9]*.[0-9]* sparc-sun-solaris[0-9]*.[0-9]* i386-pc-solaris[0-9]*.[0-9]* diff --git a/configure.in b/configure.in index 2a42477723..c807851859 100644 --- a/configure.in +++ b/configure.in @@ -372,50 +372,6 @@ if test X${enable_native_libs} = Xyes -a X${enable_hipe} != Xno; then fi AC_SUBST(NATIVE_LIBS_ENABLED) -if test $CROSS_COMPILING = no; then - case $host_os in - darwin*) - macosx_version=`sw_vers -productVersion` - test $? -eq 0 || { - AC_MSG_ERROR([Failed to execute 'sw_vers'; please provide it in PATH]) - } - [case "$macosx_version" in - [1-9][0-9].[0-9]) - int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)|\1\2|'`;; - [1-9][0-9].[0-9].[0-9]) - int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)\.\([^\.]*\)|\1\2\3|'`;; - [1-9][0-9].[1-9][0-9]) - int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)|\1\200|'`;; - [1-9][0-9].[1-9][0-9].[0-9]) - int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)\.\([^\.]*\)|\1\20\3|'`;; - [1-9][0-9].[1-9][0-9].[1-9][0-9]) - int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)\.\([^\.]*\)|\1\2\3|'`;; - *) - int_macosx_version=unexpected;; - esac] - test $int_macosx_version != unexpected || { - AC_MSG_ERROR([Unexpected MacOSX version ($macosx_version) returned by 'sw_vers -productVersion'; this configure script probably needs to be updated]) - } - AC_TRY_COMPILE([ -#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > $int_macosx_version -#error Compiling for a newer MacOSX version... -#endif - ], [;], - [], - [AC_MSG_ERROR([ - - You are natively building Erlang/OTP for a later version of MacOSX - than current version ($macosx_version). You either need to - cross-build Erlang/OTP, or set the environment variable - MACOSX_DEPLOYMENT_TARGET to $macosx_version (or a lower version). - -])]) - ;; - *) - ;; - esac -fi - rm -f $ERL_TOP/lib/SKIP-APPLICATIONS for app in `cd lib && ls -d *`; do var=`eval echo \\$with_$app` @@ -426,6 +382,7 @@ done export ERL_TOP AC_CONFIG_SUBDIRS(lib erts) +ERL_DED AC_CONFIG_FILES([Makefile make/output.mk]) AC_CONFIG_FILES([make/emd2exml], [chmod +x make/emd2exml]) diff --git a/erts/aclocal.m4 b/erts/aclocal.m4 index 3d227e462c..9a1eb48a87 100644 --- a/erts/aclocal.m4 +++ b/erts/aclocal.m4 @@ -221,6 +221,7 @@ AC_TRY_COMPILE([],[ #endif __label__ lbl1; __label__ lbl2; + extern int magic(void); int x = magic(); static void *jtab[2]; @@ -266,6 +267,7 @@ if test "$ac_cv_prog_emu_cc" != no; then #endif __label__ lbl1; __label__ lbl2; + extern int magic(void); int x = magic(); static void *jtab[2]; @@ -2801,6 +2803,7 @@ AC_DEFUN([LM_HARDWARE_ARCH], [ ppc64) ARCH=ppc64;; ppc64le) ARCH=ppc64le;; "Power Macintosh") ARCH=ppc;; + arm64) ARCH=arm64;; armv5b) ARCH=arm;; armv5teb) ARCH=arm;; armv5tel) ARCH=arm;; diff --git a/erts/configure.in b/erts/configure.in index 3ba8216a19..0271f5efa1 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -733,7 +733,7 @@ dnl First remove common_tests skip file. dnl Adjust LDFLAGS to allow 64bit linkage on DARWIN case $ARCH-$OPSYS in - amd64-darwin*) + amd64-darwin*|arm64-darwin*) AC_MSG_NOTICE([Adjusting LDFLAGS to cope with 64bit Darwin]) case $LDFLAGS in *-m64*) @@ -2145,6 +2145,7 @@ AC_CACHE_CHECK( #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> + #include <stdio.h> ]], [[printf("%d", in6addr_any.s6_addr[16]);]] )], @@ -2168,6 +2169,7 @@ AC_CACHE_CHECK( #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> + #include <stdio.h> ]], [[printf("%d", in6addr_loopback.s6_addr[16]);]] )], diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index b708a91371..e0521f7578 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1973,7 +1973,7 @@ Eterm db_prog_match(Process *c_p, Process *tmpp; Process *current_scheduled; ErtsSchedulerData *esdp; - Eterm (*bif)(Process*, ...); + BIF_RETTYPE (*bif)(BIF_ALIST); Eterm bif_args[3]; int fail_label; #ifdef DMC_DEBUG @@ -2280,8 +2280,8 @@ restart: *esp++ = t; break; case matchCall0: - bif = (Eterm (*)(Process*, ...)) *pc++; - t = (*bif)(build_proc, bif_args); + bif = (BIF_RETTYPE (*)(BIF_ALIST)) *pc++; + t = (*bif)(build_proc, bif_args, NULL); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -2291,8 +2291,8 @@ restart: *esp++ = t; break; case matchCall1: - bif = (Eterm (*)(Process*, ...)) *pc++; - t = (*bif)(build_proc, esp-1); + bif = (BIF_RETTYPE (*)(BIF_ALIST)) *pc++; + t = (*bif)(build_proc, esp-1, NULL); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -2302,10 +2302,10 @@ restart: esp[-1] = t; break; case matchCall2: - bif = (Eterm (*)(Process*, ...)) *pc++; + bif = (BIF_RETTYPE (*)(BIF_ALIST)) *pc++; bif_args[0] = esp[-1]; bif_args[1] = esp[-2]; - t = (*bif)(build_proc, bif_args); + t = (*bif)(build_proc, bif_args, NULL); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -2316,11 +2316,11 @@ restart: esp[-1] = t; break; case matchCall3: - bif = (Eterm (*)(Process*, ...)) *pc++; + bif = (BIF_RETTYPE (*)(BIF_ALIST)) *pc++; bif_args[0] = esp[-1]; bif_args[1] = esp[-2]; bif_args[2] = esp[-3]; - t = (*bif)(build_proc, bif_args); + t = (*bif)(build_proc, bif_args, NULL); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; diff --git a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c index 685cda3e07..b69d75c31d 100644 --- a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c +++ b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c @@ -47,6 +47,10 @@ #include <windows.h> #endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + #include <errno.h> #include "erl_driver.h" diff --git a/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c b/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c index 56183c9484..503d8b902c 100644 --- a/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c +++ b/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c @@ -18,6 +18,10 @@ * %CopyrightEnd% */ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + #include "erl_driver.h" #define THR_MSG_BLAST_NO_PROCS 10 diff --git a/erts/emulator/test/estone_SUITE_data/estone_cat.c b/erts/emulator/test/estone_SUITE_data/estone_cat.c index a34bda4384..cbdf3db6c9 100644 --- a/erts/emulator/test/estone_SUITE_data/estone_cat.c +++ b/erts/emulator/test/estone_SUITE_data/estone_cat.c @@ -12,9 +12,11 @@ #include <fcntl.h> #include <errno.h> -main(argc, argv) -int argc; -char *argv[]; +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +int main(int argc, char* argv[]) { char buf[16384]; int n; diff --git a/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c b/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c index 46ee8b5540..6f662ae514 100644 --- a/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c +++ b/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c @@ -39,6 +39,7 @@ #include <errno.h> #include <stdio.h> +#include <string.h> static int fail(const char *file, int line, const char *function, const char *assertion); diff --git a/erts/emulator/test/port_bif_SUITE_data/port_test.c b/erts/emulator/test/port_bif_SUITE_data/port_test.c index 923ab99ccc..ef6d12dc93 100644 --- a/erts/emulator/test/port_bif_SUITE_data/port_test.c +++ b/erts/emulator/test/port_bif_SUITE_data/port_test.c @@ -10,6 +10,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <ctype.h> #ifndef __WIN32__ #include <unistd.h> @@ -32,7 +33,7 @@ exit(1); \ } -#define MAIN(argc, argv) main(argc, argv) +#define MAIN(argc, argv) int main(argc, argv) extern int errno; diff --git a/lib/inets/test/httpd_SUITE_data/cgi_echo.c b/lib/inets/test/httpd_SUITE_data/cgi_echo.c index 580f860e96..e90b125a00 100644 --- a/lib/inets/test/httpd_SUITE_data/cgi_echo.c +++ b/lib/inets/test/httpd_SUITE_data/cgi_echo.c @@ -4,6 +4,8 @@ #if defined __WIN32__ #include <windows.h> #include <fcntl.h> +#else +#include <unistd.h> #endif static int read_exact(char *buffer, int len); diff --git a/lib/kernel/test/os_SUITE_data/my_fds.c b/lib/kernel/test/os_SUITE_data/my_fds.c index 704a4d1e1d..8b1ce13822 100644 --- a/lib/kernel/test/os_SUITE_data/my_fds.c +++ b/lib/kernel/test/os_SUITE_data/my_fds.c @@ -1,5 +1,9 @@ #include <stdio.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + int main(int argc, char** argv) { |