Skip to content

Commit

Permalink
ruby should not undefine _XOPEN_SOURCE in c++ context
Browse files Browse the repository at this point in the history
  • Loading branch information
hadfl committed Dec 19, 2024
1 parent 684a7e1 commit 6c711b2
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 9 deletions.
1 change: 1 addition & 0 deletions build/ruby/build-30.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ init
download_source $PROG $PROG $VER
patch_source
prep_build
run_autoconf -f
build
make_package
clean_up
Expand Down
1 change: 1 addition & 0 deletions build/ruby/build-31.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ init
download_source $PROG $PROG $VER
patch_source
prep_build
run_autoconf -f
build
make_package
clean_up
Expand Down
1 change: 1 addition & 0 deletions build/ruby/build-32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ init
download_source $PROG $PROG $VER
patch_source
prep_build
run_autoconf -f
build
make_package
clean_up
Expand Down
1 change: 1 addition & 0 deletions build/ruby/build-33.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ init
download_source $PROG $PROG $VER
patch_source
prep_build
run_autoconf -f
build
make_package
clean_up
Expand Down
6 changes: 3 additions & 3 deletions build/ruby/patches-30/02-config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Changes were developed in-house, are Solaris specific,
# and are not suitable for upstream.

diff -wpruN '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
diff -wpruN --no-dereference '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
--- a~/tool/config.guess 1970-01-01 00:00:00
+++ a/tool/config.guess 1970-01-01 00:00:00
@@ -409,19 +409,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAM
Expand All @@ -29,10 +29,10 @@ diff -wpruN '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:6*:*)
diff -wpruN '--exclude=*.orig' a~/tool/config.sub a/tool/config.sub
diff -wpruN --no-dereference '--exclude=*.orig' a~/tool/config.sub a/tool/config.sub
--- a~/tool/config.sub 1970-01-01 00:00:00
+++ a/tool/config.sub 1970-01-01 00:00:00
@@ -1011,7 +1011,7 @@ case $cpu-$vendor in
@@ -1028,7 +1028,7 @@ case $cpu-$vendor in

# Here we normalize CPU types irrespective of the vendor
amd64-*)
Expand Down
12 changes: 12 additions & 0 deletions build/ruby/patches-30/no-_XOPEN_SOURCE-undefine.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
--- a~/configure.ac 1970-01-01 00:00:00
+++ a/configure.ac 1970-01-01 00:00:00
@@ -1064,8 +1064,6 @@ main()
AC_MSG_RESULT($define_xopen_source)
AS_IF([test x"$define_xopen_source" != xno], [
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
- # _XOPEN_SOURCE should not be defined for C++ on Solaris.
- RUBY_APPEND_OPTIONS(CXXFLAGS, -U_XOPEN_SOURCE)
])
])
],
2 changes: 1 addition & 1 deletion build/ruby/patches-30/openssl-EAGAIN.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff -wpruN '--exclude=*.orig' a~/ext/openssl/ossl_ssl.c a/ext/openssl/ossl_ssl.c
diff -wpruN --no-dereference '--exclude=*.orig' a~/ext/openssl/ossl_ssl.c a/ext/openssl/ossl_ssl.c
--- a~/ext/openssl/ossl_ssl.c 1970-01-01 00:00:00
+++ a/ext/openssl/ossl_ssl.c 1970-01-01 00:00:00
@@ -1893,6 +1893,7 @@ ossl_ssl_read_internal(int argc, VALUE *
Expand Down
4 changes: 2 additions & 2 deletions build/ruby/patches-30/openssl3.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff -wpruN '--exclude=*.orig' a~/ext/openssl/extconf.rb a/ext/openssl/extconf.rb
diff -wpruN --no-dereference '--exclude=*.orig' a~/ext/openssl/extconf.rb a/ext/openssl/extconf.rb
--- a~/ext/openssl/extconf.rb 1970-01-01 00:00:00
+++ a/ext/openssl/extconf.rb 1970-01-01 00:00:00
@@ -105,12 +105,11 @@ version_ok = if have_macro("LIBRESSL_VER
Expand All @@ -17,7 +17,7 @@ diff -wpruN '--exclude=*.orig' a~/ext/openssl/extconf.rb a/ext/openssl/extconf.r
end

# Prevent wincrypt.h from being included, which defines conflicting macro with openssl/x509.h
diff -wpruN '--exclude=*.orig' a~/ext/openssl/ossl_pkey_rsa.c a/ext/openssl/ossl_pkey_rsa.c
diff -wpruN --no-dereference '--exclude=*.orig' a~/ext/openssl/ossl_pkey_rsa.c a/ext/openssl/ossl_pkey_rsa.c
--- a~/ext/openssl/ossl_pkey_rsa.c 1970-01-01 00:00:00
+++ a/ext/openssl/ossl_pkey_rsa.c 1970-01-01 00:00:00
@@ -947,7 +947,9 @@ Init_ossl_rsa(void)
Expand Down
1 change: 1 addition & 0 deletions build/ruby/patches-30/series
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
02-config.patch
openssl-EAGAIN.patch
openssl3.patch
no-_XOPEN_SOURCE-undefine.patch
4 changes: 2 additions & 2 deletions build/ruby/patches-31/02-config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Changes were developed in-house, are Solaris specific,
# and are not suitable for upstream.

diff -wpruN '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
diff -wpruN --no-dereference '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
--- a~/tool/config.guess 1970-01-01 00:00:00
+++ a/tool/config.guess 1970-01-01 00:00:00
@@ -409,19 +409,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAM
Expand All @@ -29,7 +29,7 @@ diff -wpruN '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:6*:*)
diff -wpruN '--exclude=*.orig' a~/tool/config.sub a/tool/config.sub
diff -wpruN --no-dereference '--exclude=*.orig' a~/tool/config.sub a/tool/config.sub
--- a~/tool/config.sub 1970-01-01 00:00:00
+++ a/tool/config.sub 1970-01-01 00:00:00
@@ -1028,7 +1028,7 @@ case $cpu-$vendor in
Expand Down
12 changes: 12 additions & 0 deletions build/ruby/patches-31/no-_XOPEN_SOURCE-undefine.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
--- a~/configure.ac 1970-01-01 00:00:00
+++ a/configure.ac 1970-01-01 00:00:00
@@ -1151,8 +1151,6 @@ main()
AC_MSG_RESULT($define_xopen_source)
AS_IF([test x"$define_xopen_source" != xno], [
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
- # _XOPEN_SOURCE should not be defined for C++ on Solaris.
- RUBY_APPEND_OPTIONS(CXXFLAGS, -U_XOPEN_SOURCE)
])
])
AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>])
2 changes: 1 addition & 1 deletion build/ruby/patches-31/openssl-EAGAIN.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff -wpruN '--exclude=*.orig' a~/ext/openssl/ossl_ssl.c a/ext/openssl/ossl_ssl.c
diff -wpruN --no-dereference '--exclude=*.orig' a~/ext/openssl/ossl_ssl.c a/ext/openssl/ossl_ssl.c
--- a~/ext/openssl/ossl_ssl.c 1970-01-01 00:00:00
+++ a/ext/openssl/ossl_ssl.c 1970-01-01 00:00:00
@@ -1850,6 +1850,7 @@ ossl_ssl_read_internal(int argc, VALUE *
Expand Down
1 change: 1 addition & 0 deletions build/ruby/patches-31/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
02-config.patch
openssl-EAGAIN.patch
no-_XOPEN_SOURCE-undefine.patch
12 changes: 12 additions & 0 deletions build/ruby/patches-32/no-_XOPEN_SOURCE-undefine.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
--- a~/configure.ac 1970-01-01 00:00:00
+++ a/configure.ac 1970-01-01 00:00:00
@@ -1144,8 +1144,6 @@ main()
AC_MSG_RESULT($define_xopen_source)
AS_IF([test x"$define_xopen_source" != xno], [
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
- # _XOPEN_SOURCE should not be defined for C++ on Solaris.
- RUBY_APPEND_OPTIONS(CXXFLAGS, -U_XOPEN_SOURCE)
])
])
AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>])
1 change: 1 addition & 0 deletions build/ruby/patches-32/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
02-config.patch
openssl-EAGAIN.patch
no-_XOPEN_SOURCE-undefine.patch
12 changes: 12 additions & 0 deletions build/ruby/patches-33/no-_XOPEN_SOURCE-undefine.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
--- a~/configure.ac 1970-01-01 00:00:00
+++ a/configure.ac 1970-01-01 00:00:00
@@ -1152,8 +1152,6 @@ main()
AC_MSG_RESULT($define_xopen_source)
AS_IF([test x"$define_xopen_source" != xno], [
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
- # _XOPEN_SOURCE should not be defined for C++ on Solaris.
- RUBY_APPEND_OPTIONS(CXXFLAGS, -U_XOPEN_SOURCE)
])
])
AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>])
1 change: 1 addition & 0 deletions build/ruby/patches-33/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
02-config.patch
openssl-EAGAIN.patch
no-_XOPEN_SOURCE-undefine.patch

0 comments on commit 6c711b2

Please sign in to comment.