Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/core/glibc/PKGBUILD
blob: 19b11dc069604b7fe2ba36947337b408231f838e (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# remove lib32-* stuff

pkgname=(${pkgname[@]/lib32-*/})
makedepends=(${makedepends[@]/lib32-*/})
unset -f 'package_lib32-glibc'

eval "$(
  declare -f build | \
    sed '
      2 a export CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
      s,https://bugs.archlinux.org/,https://bugs.archlinux32.org/,
      \,cd .*/lib32-glibc-build,{
        s/.*/}/
        q
      }
      s@--enable-multi-arch@--disable-multi-arch@
    '
  declare -f package_glibc | \
    sed '
      s,usr/lib/libmvec-\*\.so,,
      s/\S*,mvec\S*//
      s,STRIP_BINARIES ,\0usr/bin/lddlibc4 ,
      s,STRIP_STATIC ,\0usr/lib/libm.a ,
    '
)"

# 486-specific

# no gd for memory profiles
makedepends=(${makedepends[@]//gd/})
makedepends_i686+=('gd')

if [ "${CARCH}" = "i486" ]; then

  # disable testing for now, we run out of memory
  eval "$(
    declare -f check | \
      sed '
        /make -O check/d
      '
  )"

  # disable CET (Control Flow instructions endbr32/enbr64)
  eval "$(
    declare -f build | \
      sed '
        s/--enable-cet/--disable-cet/
      '
  )"

fi

# pentium4 specific

makedepends_pentium4=("${makedepends_i686[@]}")

# make Java segfaults go away
if [ "${CARCH}" = "pentium4" ]; then
  eval "$(
    declare -f build | \
      sed '
	/.*glibc.*configure.*/ i \
	  CFLAGS=\"${CFLAGS} -mfpmath=sse -msse2 -mstackrealign\" \
	  CXXFLAGS=\"${CXXFLAGS} -mfpmath=sse -msse2 -mstackrealign\"
      '
  )"
fi

# https://lwn.net/Articles/845329/, ISA-Level breakage in glibc 2.33
# disabling all ISA level guessing for now (see FS32#145)
eval "$(
  declare -f build | \
    sed '
      s|--prefix=/usr|--prefix=/usr libc_cv_include_x86_isa_level=no|g
    '
)"

# upstream test skipping breaks Makefiles in test, also glibc 2.25 currently fails
# in the following tests:
# FAIL: elf/tst-audit-tlsdesc
# FAIL: elf/tst-audit-tlsdesc-dlopen
# FAIL: elf/tst-gnu2-tls1
# FAIL: misc/tst-bz21269
# FAIL: misc/tst-ntp_gettime
# FAIL: misc/tst-ntp_gettimex
# FAIL: time/tst-adjtime
# FAIL: time/tst-clock2
# the last once are exactly the once we had to patch, so we ignore this.
eval "$(
  declare -f check | \
    sed '
      s/skip_test tst-ntp_gettimex/skip_test tst-ntp_gettimex-time64/
      s/skip_test tst-ntp_gettime/skip_test tst-ntp_gettime-time64/
      s/skip_test tst-adjtime/skip_test tst-adjtime-time64/
      s/skip_test tst-clock2/skip_test tst-clock2-time64/
      /make -O check/ i \
          skip_test tst-audit-tlsdesc elf/Makefile \
          skip_test tst-audit-tlsdesc-dlopen elf/Makefile \
          skip_test tst-gnu2-tls1 elf/Makefile \
          skip_test tst-bz21269 misc/Makefile
      s/make -O check/make -O check || true/
    '
)"

# have to rebuild twice because generate localdef called in build uses wrong
# ABI resulting in:
# "locale/localedef: /usr/lib/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by locale/localedef"
# do not regenerate it and install the one from the chroot
eval "$(
  declare -f build | \
    sed '
      /localedef/d
    '
)"
eval "$(
  declare -f package_glibc | \
    sed '
      s|"${srcdir}"/C.UTF-8|/usr/lib/locale/C.UTF-8|g
    '
)"

# readd locale generation removed by lib32 sed-fu above in build!
eval "$(
  declare -f build | \
    sed '
      $ i locale/localedef -c -f ../glibc/localedata/charmaps/UTF-8 -i ../glibc/localedata/locales/C ../C.UTF-8/
    '
)"

# ignoring tests for now (they hang, checked manually, see skip_tests above)
unset check