summaryrefslogtreecommitdiff
path: root/src/stage2/patches/riscv64/glibc.patch
blob: b8219141a51b4ff769db3d8ab1b749e1da6d6f03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
diff -rupN a/PKGBUILD b/PKGBUILD
--- a/PKGBUILD	2018-05-24 16:08:27.444065918 +0200
+++ b/PKGBUILD	2018-05-24 16:20:58.484092209 +0200
@@ -6,7 +6,8 @@
 # NOTE: valgrind requires rebuilt with each major glibc version
 
 pkgbase=glibc
-pkgname=(glibc lib32-glibc)
+pkgname=(glibc)
+[ "x@MULTILIB@" != "xenable" ] || pkgname+=(lib32-glibc)
 pkgver=2.27
 pkgrel=3
 arch=(x86_64)
@@ -48,15 +49,15 @@ prepare() {
 build() {
   local _configure_flags=(
       --prefix=/usr
-      --with-headers=/usr/include
+      --host=@CHOST@ --build=@BUILDHOST@
+      --with-headers=@SYSROOT@/usr/include
       --with-bugurl=https://bugs.archlinux.org/
       --enable-add-ons
       --enable-bind-now
       --enable-lock-elision
-      --enable-multi-arch
+      --@MULTILIB@-multi-arch
       --enable-stack-protector=strong
       --enable-stackguard-randomization
-      --enable-static-pie
       --disable-profile
       --disable-werror
   )
@@ -87,6 +88,8 @@ build() {
   echo "CXX += -D_FORTIFY_SOURCE=2" >> configparms
   make
 
+  [ "x@MULTILIB@" == "xenable" ] || return 0
+
   cd "$srcdir/lib32-glibc-build"
   export CC="gcc -m32 -mstackrealign"
   export CXX="g++ -m32 -mstackrealign"
@@ -164,8 +167,8 @@ package_glibc() {
     "$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
 
   if check_option 'debug' n; then
-    find "$pkgdir"/usr/bin -type f -executable -exec strip $STRIP_BINARIES {} + 2> /dev/null || true
-    find "$pkgdir"/usr/lib -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
+    find "$pkgdir"/usr/bin -type f -executable -exec @CHOST@-strip $STRIP_BINARIES {} + 2> /dev/null || true
+    find "$pkgdir"/usr/lib -name '*.a' -type f -exec @CHOST@-strip $STRIP_STATIC {} + 2> /dev/null || true
 
     # Do not strip these for gdb and valgrind functionality, but strip the rest
     find "$pkgdir"/usr/lib \
@@ -173,7 +176,7 @@ package_glibc() {
       -not -name 'libc-*.so' \
       -not -name 'libpthread-*.so' \
       -not -name 'libthread_db-*.so' \
-      -name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
+      -name '*-*.so' -type f -exec @CHOST@-strip $STRIP_SHARED {} + 2> /dev/null || true
   fi
 }
 
@@ -200,12 +203,12 @@ package_lib32-glibc() {
   ln -s ../lib/locale "$pkgdir/usr/lib32/locale"
 
   if check_option 'debug' n; then
-    find "$pkgdir"/usr/lib32 -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
+    find "$pkgdir"/usr/lib32 -name '*.a' -type f -exec @CHOST@-strip $STRIP_STATIC {} + 2> /dev/null || true
     find "$pkgdir"/usr/lib32 \
       -not -name 'ld-*.so' \
       -not -name 'libc-*.so' \
       -not -name 'libpthread-*.so' \
       -not -name 'libthread_db-*.so' \
-      -name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
+      -name '*-*.so' -type f -exec @CHOST@-strip $STRIP_SHARED {} + 2> /dev/null || true
   fi
 }