Skip to content
Snippets Groups Projects
Commit 10460223 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix config test for va_copy() on darwin.

Because the appropriate header wasn't included, there was no
prototype.  Not having a prototype is an error in C99, which caused
the test to indicate that there was no va_copy() on darwin.

This in turn caused jsprf.cpp to try to copy a va_list using
assignment.

This is invalid, so the compiler would normally return an error.

Somwhere in here, that error became a clang crash (not trivially
reproducable).

At the end of the day, ancient broken tests in config caused the
darwin Spidermonkey builds to fail.  The new patch fixes up the
configure tests, and darwin Synchronet builds are re-enabled.
parent decc7e39
No related branches found
No related tags found
No related merge requests found
Pipeline #6679 failed
......@@ -72,7 +72,6 @@ include:
platform: 'x86'
tagname: 'macOS'
gnu_make: 'make'
no_javascript: 'yes'
build_flags: 'CC="ccache cc" CXX="ccache c++" RELEASE=1'
smoketest-jsexec-linux:
......
......@@ -66,7 +66,7 @@ $(JS_SRC): | $(3RDPSRCDIR)
$(JS_IDIR): | $(3RDPODIR)
$(QUIET)$(IFNOTEXIST) mkdir $(JS_IDIR)
$(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativestack_cpp.patch $(3RDP_ROOT)/build/js-configure.patch $(3RDP_ROOT)/build/js-configure.in.patch $(3RDP_ROOT)/build/imacro-asm-fix.patch $(3RDP_ROOT)/build/js-volatile-outside-functions.patch $(3RDP_ROOT)/build/js-Wno-misleading-indentation.patch $(3RDP_ROOT)/build/js-allow-python3.patch $(3RDP_ROOT)/build/js-no-rwx-pages.patch $(3RDP_ROOT)/build/js-disable-shell.patch $(3RDP_ROOT)/build/js-darwin-configure.patch $(3RDP_ROOT)/build/js-keep-ffi-cache.patch $(3RDP_ROOT)/build/js-config.guess-libffi.patch $(3RDP_ROOT)/build/js-support-mingw-cross.patch $(3RDP_ROOT)/build/js-int-main-conf.patch | $(JS_SRC) $(JS_IDIR)
$(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativestack_cpp.patch $(3RDP_ROOT)/build/js-configure.patch $(3RDP_ROOT)/build/js-configure.in.patch $(3RDP_ROOT)/build/imacro-asm-fix.patch $(3RDP_ROOT)/build/js-volatile-outside-functions.patch $(3RDP_ROOT)/build/js-Wno-misleading-indentation.patch $(3RDP_ROOT)/build/js-allow-python3.patch $(3RDP_ROOT)/build/js-no-rwx-pages.patch $(3RDP_ROOT)/build/js-disable-shell.patch $(3RDP_ROOT)/build/js-darwin-configure.patch $(3RDP_ROOT)/build/js-keep-ffi-cache.patch $(3RDP_ROOT)/build/js-config.guess-libffi.patch $(3RDP_ROOT)/build/js-support-mingw-cross.patch $(3RDP_ROOT)/build/js-int-main-conf.patch $(3RDP_ROOT)/build/js-include-headers.patch | $(JS_SRC) $(JS_IDIR)
@echo Creating $@ ...
$(QUIET)-rm -rf $(JS_SRC)/*
$(QUIET)tar -xzpC $(JS_SRC) -f $(3RDPDISTDIR)/libmozjs.tgz
......@@ -88,6 +88,7 @@ $(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativ
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-config.guess-libffi.patch
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-support-mingw-cross.patch
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-int-main-conf.patch
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-include-headers.patch
-$(QUIET)cd $(JS_SRC)/js-1.8.5/js/src && autoconf-2.13
-$(QUIET)cd $(JS_SRC)/js-1.8.5/js/src && autoconf2.13
$(QUIET)chmod 0755 $(JS_SRC)/js-1.8.5/js/src/build/hcc
......
diff -u js-1.8.5/js/src/configure.in.orig js-1.8.5/js/src/configure.in
--- js-1.8.5/js/src/configure.in.orig 2024-09-24 22:14:12
+++ js-1.8.5/js/src/configure.in 2024-09-24 22:17:58
@@ -3939,6 +3939,7 @@
AC_CACHE_VAL(ac_cv_va_copy,[
AC_TRY_RUN([
#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -3958,6 +3959,7 @@
AC_CACHE_VAL(ac_cv___va_copy,[
AC_TRY_RUN([
#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -3977,6 +3979,7 @@
AC_CACHE_VAL(ac_cv_va_val_copy,[
AC_TRY_RUN([
#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -5271,6 +5274,7 @@
AC_MSG_CHECKING([for gcc -pipe support])
if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then
echo '#include <stdio.h>' > dummy-hello.c
+ echo '#include <stdlib.h>' >> dummy-hello.c
echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
diff -u js-1.8.5/js/src/configure.orig js-1.8.5/js/src/configure
--- js-1.8.5/js/src/configure.orig 2024-09-24 22:33:47.275117000 -0400
+++ js-1.8.5/js/src/configure 2024-09-24 22:39:16.459457000 -0400
@@ -8194,6 +8194,7 @@
#line 8195 "configure"
#include "confdefs.h"
#include <ctype.h>
+#include <stdlib.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
@@ -11045,6 +11046,8 @@
else
cat > conftest.$ac_ext <<EOF
#line 11048 "configure"
+#include <stdlib.h>
+#include <string.h>
#include "confdefs.h"
int main()
@@ -11638,6 +11641,7 @@
#include "confdefs.h"
#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -11679,6 +11683,7 @@
#include "confdefs.h"
#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -11720,6 +11725,7 @@
#include "confdefs.h"
#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -13592,6 +13598,7 @@
#line 13593 "configure"
#include "confdefs.h"
#include <stdio.h>
+#include <stdlib.h>
int main()
{
FILE *f=fopen("conftestval", "w");
@@ -14351,6 +14358,7 @@
echo "configure:14352: checking for gcc -pipe support" >&5
if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then
echo '#include <stdio.h>' > dummy-hello.c
+ echo '#include <stdlib.h>' >> dummy-hello.c
echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment