mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
gcc: enable libatomic build.
* add libatomic to gcc_syslibs. * link libsupc++ against libroot, add soname.
This commit is contained in:
@@ -5,7 +5,7 @@ HOMEPAGE="http://gcc.gnu.org"
|
||||
|
||||
SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2"
|
||||
CHECKSUM_SHA256="b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db"
|
||||
REVISION="2"
|
||||
REVISION="3"
|
||||
LICENSE="
|
||||
GNU GPL v3
|
||||
GNU LGPL v3
|
||||
@@ -17,6 +17,9 @@ PATCHES="gcc-5.3.0_2016_02_29.patchset"
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64 arm"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
libatomicSoVersion="1"
|
||||
libatomicLibVersion="1.1.0"
|
||||
|
||||
libstdcxxSoVersion="6"
|
||||
libstdcxxLibVersion="6.0.21"
|
||||
|
||||
@@ -138,7 +141,7 @@ BUILD()
|
||||
# use this simpler approach).
|
||||
cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++
|
||||
gcc -nodefaultlibs -shared -o .libs/libsupc++.so -Xlinker --whole-archive \
|
||||
.libs/libsupc++.a
|
||||
-Xlinker -soname=libsupc++.so -lroot .libs/libsupc++.a
|
||||
# build kernel version of libsupc++.a (without threads or TLS)
|
||||
mkdir -p saved
|
||||
mv .libs/libsupc++* saved/
|
||||
@@ -191,6 +194,14 @@ INSTALL()
|
||||
cd $installDir
|
||||
gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion
|
||||
|
||||
# libatomic
|
||||
strip --strip-debug $gccLibDir/libatomic.so.$libatomicLibVersion
|
||||
cp -d $gccLibDir/libstdc++.so \
|
||||
$gccLibDir/libatomic.so.$libatomicSoVersion \
|
||||
$gccLibDir/libatomic.so.$libatomicLibVersion \
|
||||
$libDir/
|
||||
cp $gccLibDir/libatomic*.a $developLibDir/
|
||||
|
||||
# libstdc++
|
||||
strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion
|
||||
cp -d $gccLibDir/libstdc++.so \
|
||||
@@ -275,6 +286,8 @@ INSTALL()
|
||||
### Sub Packages ##########################################
|
||||
|
||||
packageEntries "syslibs" \
|
||||
$relativeLibDir/libatomic.so.$libatomicSoVersion \
|
||||
$relativeLibDir/libatomic.so.$libatomicLibVersion \
|
||||
$relativeLibDir/libgcc_s.so \
|
||||
$relativeLibDir/libgcc_s.so.$libgccSoVersion \
|
||||
$relativeLibDir/libstdc++.so \
|
||||
@@ -283,6 +296,7 @@ INSTALL()
|
||||
$relativeLibDir/libsupc++.so
|
||||
|
||||
packageEntries "syslibs_devel" \
|
||||
$relativeDevelopLibDir/libatomic.a \
|
||||
$relativeDevelopLibDir/libgcc.a \
|
||||
$relativeDevelopLibDir/libgcc-kernel.a \
|
||||
$relativeDevelopLibDir/libgcc_eh.a \
|
||||
@@ -305,6 +319,7 @@ loader, so it is required for executing most c/c++ programs."
|
||||
|
||||
PROVIDES_syslibs="
|
||||
gcc${secondaryArchSuffix}_syslibs = $portVersion compat >= 4
|
||||
lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion
|
||||
lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4
|
||||
lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4
|
||||
lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 118a80cf62982a88de0761a01310e86bd7e17c55 Mon Sep 17 00:00:00 2001
|
||||
From e8b3514cf865260198c44df9e96bcede9354ef34 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
|
||||
Date: Sun, 19 Jul 2015 18:55:34 +0200
|
||||
Subject: Haiku patch
|
||||
@@ -2320,10 +2320,10 @@ index 24d13f3..94d96d9 100644
|
||||
|
||||
hpux*)
|
||||
--
|
||||
2.7.0
|
||||
2.2.2
|
||||
|
||||
|
||||
From 48c3b2e151f903bc45d447deed0539897ff41322 Mon Sep 17 00:00:00 2001
|
||||
From 019aef95930914c36b331040ab765c632ecd8531 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Thu, 10 Dec 2015 22:07:03 +0000
|
||||
Subject: Haiku: regenerate configure.
|
||||
@@ -2841,10 +2841,10 @@ index 8cd4c76..d12f460 100755
|
||||
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
||||
|
||||
--
|
||||
2.7.0
|
||||
2.2.2
|
||||
|
||||
|
||||
From 9dfa1054ae72a8f2a715ac44c83f375214e4446d Mon Sep 17 00:00:00 2001
|
||||
From 3efaf43ef1e17c2ae9c850bff083ca6426173144 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sat, 12 Dec 2015 09:55:48 +0000
|
||||
Subject: config.host (i[34567]86-*-haiku* and x86_64-*-haiku*):
|
||||
@@ -2866,10 +2866,10 @@ index dc73f2a..32e3cd2 100644
|
||||
if test "${host_address}" = 32; then
|
||||
tmake_file="${tmake_file} i386/${host_address}/t-softfp"
|
||||
--
|
||||
2.7.0
|
||||
2.2.2
|
||||
|
||||
|
||||
From b2e63b86e49e983d9083993c192d6705714286cb Mon Sep 17 00:00:00 2001
|
||||
From 8d10a3be9423306faf5e80b15aa56de566c00ed3 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Mon, 29 Feb 2016 22:17:31 +0000
|
||||
Subject: sync with buildtools repo
|
||||
@@ -2912,5 +2912,180 @@ index 9ff36f1..4dff89e 100644
|
||||
-#undef CC1_SPEC
|
||||
-#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}"
|
||||
--
|
||||
2.7.0
|
||||
2.2.2
|
||||
|
||||
|
||||
From ad57ccfd7ac54f77a92bf6d2d2f33947f285d9a4 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sun, 10 Apr 2016 12:27:58 +0000
|
||||
Subject: enable libatomic build on Haiku
|
||||
|
||||
|
||||
diff --git a/libatomic/configure b/libatomic/configure
|
||||
index 3623c09..89eb721 100755
|
||||
--- a/libatomic/configure
|
||||
+++ b/libatomic/configure
|
||||
@@ -8202,8 +8202,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
|
||||
|
||||
haiku*)
|
||||
# PIC is the default for Haiku.
|
||||
- # The "-static" flag exists, but is broken.
|
||||
- lt_prog_compiler_static=
|
||||
;;
|
||||
|
||||
hpux*)
|
||||
@@ -9083,7 +9081,7 @@ _LT_EOF
|
||||
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
||||
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
|
||||
else
|
||||
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
|
||||
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
|
||||
fi
|
||||
aix_use_runtimelinking=no
|
||||
|
||||
@@ -10315,8 +10313,9 @@ haiku*)
|
||||
soname_spec='${libname}${release}${shared_ext}$major'
|
||||
shlibpath_var=LIBRARY_PATH
|
||||
shlibpath_overrides_runpath=yes
|
||||
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
|
||||
- hardcode_into_libs=yes
|
||||
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
|
||||
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
|
||||
+ hardcode_into_libs=no
|
||||
;;
|
||||
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
@@ -10833,7 +10832,7 @@ else
|
||||
lt_cv_dlopen_libs=
|
||||
|
||||
case $host_os in
|
||||
- beos*)
|
||||
+ beos* | haiku* )
|
||||
lt_cv_dlopen="load_add_on"
|
||||
lt_cv_dlopen_libs=
|
||||
lt_cv_dlopen_self=yes
|
||||
@@ -11111,7 +11110,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 11114 "configure"
|
||||
+#line 11113 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11217,7 +11216,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 11220 "configure"
|
||||
+#line 11219 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -14526,7 +14525,6 @@ _ACEOF
|
||||
case " $config_path " in
|
||||
*" posix "*)
|
||||
XPCFLAGS=""
|
||||
- CFLAGS="$CFLAGS -pthread"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <pthread.h>
|
||||
@@ -14540,13 +14538,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL);
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
+
|
||||
+else
|
||||
+ CFLAGS="$CFLAGS -pthread"
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+#include <pthread.h>
|
||||
+ void *g(void *d) { return NULL; }
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+pthread_t t; pthread_create(&t,NULL,g,NULL);
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
XPCFLAGS=" -pthread"
|
||||
else
|
||||
CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
|
||||
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <pthread.h>
|
||||
- void *g(void *d) { return NULL; }
|
||||
+ void *g(void *d) { return NULL; }
|
||||
int
|
||||
main ()
|
||||
{
|
||||
@@ -14565,6 +14579,9 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
CFLAGS="$save_CFLAGS $XPCFLAGS"
|
||||
;;
|
||||
esac
|
||||
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
|
||||
index d5e67c8..765a212 100644
|
||||
--- a/libatomic/configure.ac
|
||||
+++ b/libatomic/configure.ac
|
||||
@@ -199,21 +199,27 @@ LIBAT_WORDSIZE
|
||||
case " $config_path " in
|
||||
*" posix "*)
|
||||
XPCFLAGS=""
|
||||
- CFLAGS="$CFLAGS -pthread"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <pthread.h>
|
||||
void *g(void *d) { return NULL; }],
|
||||
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
|
||||
- [XPCFLAGS=" -pthread"],
|
||||
- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
|
||||
+ [],
|
||||
+ [CFLAGS="$CFLAGS -pthread"
|
||||
AC_LINK_IFELSE(
|
||||
- [AC_LANG_PROGRAM(
|
||||
- [#include <pthread.h>
|
||||
- void *g(void *d) { return NULL; }],
|
||||
- [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
|
||||
- [],
|
||||
- [AC_MSG_ERROR([Pthreads are required to build libatomic])])])
|
||||
+ [AC_LANG_PROGRAM(
|
||||
+ [#include <pthread.h>
|
||||
+ void *g(void *d) { return NULL; }],
|
||||
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
|
||||
+ [XPCFLAGS=" -pthread"],
|
||||
+ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS"
|
||||
+ AC_LINK_IFELSE(
|
||||
+ [AC_LANG_PROGRAM(
|
||||
+ [#include <pthread.h>
|
||||
+ void *g(void *d) { return NULL; }],
|
||||
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
|
||||
+ [],
|
||||
+ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])])
|
||||
CFLAGS="$save_CFLAGS $XPCFLAGS"
|
||||
;;
|
||||
esac
|
||||
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
|
||||
index 3c1fedd..1d0a89d 100644
|
||||
--- a/libatomic/configure.tgt
|
||||
+++ b/libatomic/configure.tgt
|
||||
@@ -112,7 +112,7 @@ case "${target}" in
|
||||
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
|
||||
| *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
|
||||
| *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
|
||||
- | *-*-darwin* | *-*-aix* | *-*-cygwin*)
|
||||
+ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*)
|
||||
# POSIX system. The OS is supported.
|
||||
config_path="${config_path} posix"
|
||||
;;
|
||||
--
|
||||
2.2.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user