summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErlang/OTP <otp@erlang.org>2021-02-19 11:39:26 +0100
committerErlang/OTP <otp@erlang.org>2021-02-19 11:39:26 +0100
commitd8aefd5cfb6df7c1164bafac8ca893e795858c8c (patch)
tree79250edc5ef707d7bad33e9e39d7252f8d10b3ab
parent78699963d0c9a8bbd4e3d7ca6ea15bda8059552e (diff)
parent888e64ffe450c4ecaaaa655bcb4ad8eda77b8dbc (diff)
downloaderlang-d8aefd5cfb6df7c1164bafac8ca893e795858c8c.tar.gz
Merge branch 'bjorn/macos11-otp22/OTP-16779' into maint-22
* bjorn/macos11-otp22/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 macOS: Remove version check in configure script Update config scripts to compile for Apple Silicon (arm64) Fix segfault(s) from variadic args on ARM64 Undo perform degradation on macOS
-rw-r--r--.gitignore1
-rw-r--r--erts/aclocal.m43
-rw-r--r--erts/configure.in4
-rw-r--r--erts/emulator/beam/erl_db_util.c18
-rw-r--r--erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c4
-rw-r--r--erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c4
-rw-r--r--erts/emulator/test/estone_SUITE_data/estone_cat.c8
-rw-r--r--erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c1
-rw-r--r--erts/emulator/test/port_bif_SUITE_data/port_test.c3
-rw-r--r--lib/inets/test/httpd_SUITE_data/cgi_echo.c2
-rw-r--r--lib/kernel/test/os_SUITE_data/my_fds.c4
-rw-r--r--make/configure.in44
12 files changed, 38 insertions, 58 deletions
diff --git a/.gitignore b/.gitignore
index b14ec86df6..3999bff60a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,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]*
x86_64-unknown-freebsd[0-9]*.[0-9]*
sparc-sun-solaris[0-9]*.[0-9]*
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 085fe76918..c5e9f66b1f 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -226,6 +226,7 @@ AC_TRY_COMPILE([],[
#endif
__label__ lbl1;
__label__ lbl2;
+ extern int magic(void);
int x = magic();
static void *jtab[2];
@@ -271,6 +272,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];
@@ -2805,6 +2807,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 caa1ce568b..f734597fe1 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*)
@@ -2191,6 +2191,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]);]]
)],
@@ -2214,6 +2215,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 7525bd8fd5..4a3e668fdc 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -1994,7 +1994,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
@@ -2301,8 +2301,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;
@@ -2312,8 +2312,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;
@@ -2323,10 +2323,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;
@@ -2337,11 +2337,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)
{
diff --git a/make/configure.in b/make/configure.in
index c4b89c4f45..2382a4426f 100644
--- a/make/configure.in
+++ b/make/configure.in
@@ -383,50 +383,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
-
ERL_DED
AC_CONFIG_FILES([../Makefile output.mk ../make/$host/otp_ded.mk:../make/otp_ded.mk.in])