Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/core/binutils/PKGBUILD
blob: bd35c2d68c8d176cdd8eaf56a99a6e8351339483 (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
# add our own bug reporting URL
eval "$(
  declare -f build | \
    sed '
      s,https://bugs.archlinux.org/,https://bugs.archlinux32.org/,
    '
)"

# enable BFD for x86_64 otherwise we have problems with cross-compilation
# or compiling things like grub
eval "$(
  declare -f build | \
    sed '
      s/--enable/--enable-64-bit-bfd \0/
    '
)"

# "configure: error: debuginfod is missing or unusable"
eval "$(
  declare -f build | \
    sed '
      s/--with-debuginfod//g
    '
)"

# should be in a cross-compilation binutils for targeting EFI binaries IMHO,
# not in the main platform binutils (see also https://bugs.archlinux.org/task/42540)
eval "$(
  declare -f build | \
    sed '
      s/--enable-targets=x86_64-pep//g
    '
)"

# i486-specific
if [ "${CARCH}" = "i486" ]; then
  # disable CET (Control Flow instructions endbr32/enbr64)
  eval "$(
    declare -f build | \
      sed '
        s/--enable-cet/--enable-cet=no/
      '
  )"
else
  # explicitely enable CET (Control Flow instructions endbr32/enbr64)
  # avoid "corrupt GNU_PROPERTY_TYPE (5) size: 0" warnings,
  # see:
  # https://bbs.archlinux32.org/viewtopic.php?pid=6160#p6160
  # https://bugs.archlinux32.org/index.php?do=details&task_id=82
  #
  eval "$(
    declare -f build | \
      sed '
        s/--enable-cet/--enable-cet=yes/
      '
  )"
fi

# i486-specific: disable PGO/LTO build, uses too much resources,
# also disabling LTO for now
if [ "${CARCH}" = "i486" ]; then
  eval "$(
    declare -f build | \
      sed '
        s/--enable-pgo-build=.*/--disable-pgo-build/
        s/--enable-lto/--disable-lto/
      '
  )"  
fi

# 2.38, FAIL: Build ifunc-1a with PIE -z ibtplt
eval "$(
  declare -f check | \
    sed '
      s/ check/ check || true/
    '
)"

# solve hen and egg issues around libiberty conflicts
# (they are part of gcc at the moment, after breaking the
# cycle we must readd them!)
eval "$(
  declare -f package | \
    sed '
      /rm.*opcodes/ a \
     rm -rf "$pkgdir"/usr/include/libiberty \
     rm -rf "$pkgdir"/usr/lib/libiberty.a
    '
)"
# no testing for now
unset check