Skip to content

Commit 1e337fe

Browse files
committed
Fix all rpath names; use Fink install-info and add gcc11 patch to build on Ventura
1 parent 8178dd2 commit 1e337fe

File tree

3 files changed

+95
-16
lines changed

3 files changed

+95
-16
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
diff -pur gcc-11.3.0/gcc/config/darwin-driver.c gcc-11.3.0-patched/gcc/config/darwin-driver.c
2+
--- gcc-11.3.0/gcc/config/darwin-driver.c 2022-04-21 09:58:52
3+
+++ gcc-11.3.0-patched/gcc/config/darwin-driver.c 2022-12-12 12:19:08
4+
@@ -64,7 +64,8 @@ validate_macosx_version_min (const char *version_str)
5+
6+
major = strtoul (version_str, &end, 10);
7+
8+
- if (major < 10 || major > 12 ) /* macOS 10, 11, and 12 are known. */
9+
+ /* macOS 10, 11, and 12 are known. clang accepts up to 99. */
10+
+ if (major < 10 || major > 99)
11+
return NULL;
12+
13+
/* Skip a separating period, if there's one. */
14+
diff -pur gcc-11.3.0/gcc/config.gcc gcc-11.3.0-patched/gcc/config.gcc
15+
--- gcc-11.3.0/gcc/config.gcc 2022-04-21 09:58:52
16+
+++ gcc-11.3.0-patched/gcc/config.gcc 2022-12-12 12:20:01
17+
@@ -1872,7 +1872,7 @@ hppa[12]*-*-hpux11*)
18+
dwarf2=no
19+
fi
20+
;;
21+
-i[34567]86-*-darwin1[89]*)
22+
+i[34567]86-*-darwin1[89]* | i[34567]86-*-darwin2*)
23+
echo "Error: 32bit target is not supported after Darwin17" 1>&2
24+
;;
25+
i[34567]86-*-darwin*)
26+
@@ -1882,7 +1882,7 @@ i[34567]86-*-darwin*)
27+
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
28+
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
29+
;;
30+
-x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
31+
+x86_64-*-darwin1[89]* | x86_64-*-darwin2*)
32+
# Only 64b from now
33+
with_cpu=${with_cpu:-core2}
34+
tmake_file="${tmake_file} t-slibgcc"
35+
diff -pur gcc-11.3.0/gcc/configure gcc-11.3.0-patched/gcc/configure
36+
--- gcc-11.3.0/gcc/configure 2022-04-21 09:59:35
37+
+++ gcc-11.3.0-patched/gcc/configure 2022-12-12 12:19:08
38+
@@ -27016,7 +27016,7 @@ $as_echo "$as_me: WARNING: LTO for $target requires bi
39+
;;
40+
esac
41+
case $target_os in
42+
- darwin2[0-9]* | darwin19*)
43+
+ darwin2* | darwin19*)
44+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for llvm assembler x86-pad-for-align option" >&5
45+
$as_echo_n "checking assembler for llvm assembler x86-pad-for-align option... " >&6; }
46+
if ${gcc_cv_as_mllvm_x86_pad_for_align+:} false; then :
47+
diff -pur gcc-11.3.0/gcc/configure.ac gcc-11.3.0-patched/gcc/configure.ac
48+
--- gcc-11.3.0/gcc/configure.ac 2022-04-21 09:58:53
49+
+++ gcc-11.3.0-patched/gcc/configure.ac 2022-12-12 12:19:08
50+
@@ -4772,7 +4772,7 @@ foo: nop
51+
;;
52+
esac
53+
case $target_os in
54+
- darwin2[[0-9]]* | darwin19*)
55+
+ darwin2* | darwin19*)
56+
gcc_GAS_CHECK_FEATURE([llvm assembler x86-pad-for-align option],
57+
gcc_cv_as_mllvm_x86_pad_for_align,,
58+
[-mllvm -x86-pad-for-align=false], [.text],,

10.9-libcxx/stable/main/finkinfo/languages/gcc11.info

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
Info2: <<
22
Package: gcc11
33
Version: 11.3.0
4-
Revision: 2
4+
Revision: 3
55
Type: gccver (11)
66
Source: mirror:gnu:gcc/gcc-%v/gcc-%v.tar.xz
77
Source-Checksum: SHA256(b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39)
88
PatchFile: %n-arm.patch
99
PatchFile-MD5: 9988f59fbeb6d88b1d45d7ab7d243389
10+
PatchFile2: %n-ventura.patch
11+
PatchFile2-MD5: 2961dece6a860f8952addf52798e9e72
1012
PatchScript: <<
1113
#!/bin/sh -ev
1214
patch -p1 < %{PatchFile}
15+
patch -p1 < %{PatchFile2}
1316
# don't update live infodoc dir
1417
find . -name Makefile.in | xargs perl -pi -e 's/install-info --version/false/g'
1518
<<
@@ -40,6 +43,7 @@ BuildDepends: <<
4043
fink-package-precedence,
4144
gettext-tools,
4245
gmp5 (>= 6.0.0a-3),
46+
install-info,
4347
isl22,
4448
libgettext8-dev,
4549
libiconv-dev,
@@ -185,27 +189,34 @@ InstallScript: <<
185189
for infofile in $(find %i/lib/gcc%type_num[gccver]/info -name '*.info*'); do
186190
infobase=$(basename $infofile)
187191
case $infofile in
188-
*info) /usr/bin/install-info --infodir=%i/lib/gcc%type_num[gccver]/info ${infofile} ;;
192+
*info) %p/bin/install-info --infodir=%i/lib/gcc%type_num[gccver]/info ${infofile} ;;
189193
esac
190194
ln -s %p/lib/gcc%type_num[gccver]/info/$infobase %i/share/info/$infobase
191195
done
192196

193197
# remove build path from .la files
194198
perl -pi -e "s, \-L[^ ']*/%n-%v-%r/darwin_objdir/[^ ']*,,g" `find %i/lib/gcc%type_num[gccver]/lib -name '*.la'`
199+
195200
if [ "%m" = "arm" ]; then
196201
arch=aarch64
197202
else
198203
arch=%m
199204
perl -pi -e "s, /[^ ']*/%n-%v-%r/darwin_objdir/[^ ']*,,g" `find %i/lib/gcc%type_num[gccver]/lib -name 'libasan.la'`
200205
perl -pi -e "s, /[^ ']*/%n-%v-%r/darwin_objdir/[^ ']*,,g" `find %i/lib/gcc%type_num[gccver]/lib -name 'libubsan.la'`
201206
fi
202-
cp %b/gcc/config/darwin-sections.def %i/lib/gcc%type_num[gccver]/lib/gcc/${arch}-apple-darwin${darwinvers}/%v/plugin/include/config
207+
203208
# @rpath install_names are required for aarch64 build, but break some linked binaries
204-
# - enforce actual install path here
209+
# - enforce actual install paths here; take care to update the cross-referenced dylibs.
205210
cd %d
206211
for dylib in .%p/lib/gcc%type_num[gccver]/lib/lib*.[0-9].dylib; do
207212
install_name_tool -id ${dylib#.} $dylib
213+
install_name_tool -change @rpath/libgcc_s.1.1.dylib %p/lib/libgcc_s.1.1.dylib \
214+
-change @rpath/libstdc++.6.dylib %p/lib/libstdc++.6.dylib \
215+
-change @rpath/libquadmath.0.dylib %p/lib/libquadmath.0.dylib $dylib
208216
done
217+
otool -L .%p/lib/gcc%type_num[gccver]/lib/lib*.[0-9].dylib | grep '@rpath' && exit 2
218+
219+
cp %b/gcc/config/darwin-sections.def %i/lib/gcc%type_num[gccver]/lib/gcc/${arch}-apple-darwin${darwinvers}/%v/plugin/include/config
209220
<<
210221
SplitOff: <<
211222
Package: %N-shlibs
@@ -294,10 +305,12 @@ DescPackaging: <<
294305
need to add it's own -isysroot flag.
295306
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79885
296307

297-
Homebrew patches for arm/aarch64 build from
298-
https://github.com/Homebrew/formula-patches/blob/master/gcc/gcc-11.3.0-arm.diff
299-
- libasan.* and libsubsan.* currently not built on that arch.
300-
There are both 1 and 1.1 versions of libgcc_s.dylib now, but only 1 on arm.
308+
Homebrew patches for arm/aarch64 build and macOS 13 from
309+
https://github.com/Homebrew/formula-patches/blob/master/gcc/gcc-%v-{arm,ventura}.diff
310+
- libasan.* and libsubsan.* currently not built on arm.
311+
There are both "1" and "1.1" versions of libgcc_s.dylib now, but only "1" on arm.
312+
Manual fixes of @rpath install_names required for aarch64 build to maintain downstream
313+
package compatibility.
301314
<<
302315
Homepage: http://gcc.gnu.org/
303316
Maintainer: None <[email protected]>

10.9-libcxx/stable/main/finkinfo/languages/gcc12.info

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Info2: <<
22
Package: gcc12
33
Version: 12.2.0
4-
Revision: 2
4+
Revision: 3
55
Type: gccver (12)
66
Source: mirror:gnu:gcc/gcc-%v/gcc-%v.tar.xz
77
Source-Checksum: SHA256(e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff)
@@ -44,6 +44,7 @@ BuildDepends: <<
4444
fink-package-precedence,
4545
gettext-tools,
4646
gmp5 (>= 6.1.2-1),
47+
install-info,
4748
isl22,
4849
libgettext8-dev,
4950
libiconv-dev,
@@ -188,7 +189,7 @@ InstallScript: <<
188189
for infofile in $(find %i/lib/gcc%type_num[gccver]/info -name '*.info*'); do
189190
infobase=$(basename $infofile)
190191
case $infofile in
191-
*info) /usr/bin/install-info --infodir=%i/lib/gcc%type_num[gccver]/info ${infofile} ;;
192+
*info) %p/bin/install-info --infodir=%i/lib/gcc%type_num[gccver]/info ${infofile} ;;
192193
esac
193194
ln -s %p/lib/gcc%type_num[gccver]/info/$infobase %i/share/info/$infobase
194195
done
@@ -202,14 +203,19 @@ InstallScript: <<
202203
perl -pi -e "s, /[^ ']*/%n-%v-%r/darwin_objdir/[^ ']*,,g" `find %i/lib/gcc%type_num[gccver]/lib -name 'libasan.la'`
203204
perl -pi -e "s, /[^ ']*/%n-%v-%r/darwin_objdir/[^ ']*,,g" `find %i/lib/gcc%type_num[gccver]/lib -name 'libubsan.la'`
204205
fi
205-
cp %b/gcc/config/darwin-sections.def %i/lib/gcc%type_num[gccver]/lib/gcc/${arch}-apple-darwin${darwinvers}/%v/plugin/include/config
206206

207207
# @rpath install_names are required for aarch64 build, but break some linked binaries
208-
# - enforce actual install path here
208+
# - enforce actual install paths here; take care to update the cross-referenced dylibs.
209209
cd %d
210210
for dylib in .%p/lib/gcc%type_num[gccver]/lib/lib*.[0-9].dylib; do
211211
install_name_tool -id ${dylib#.} $dylib
212+
install_name_tool -change @rpath/libgcc_s.1.1.dylib %p/lib/libgcc_s.1.1.dylib \
213+
-change @rpath/libstdc++.6.dylib %p/lib/libstdc++.6.dylib \
214+
-change @rpath/libquadmath.0.dylib %p/lib/libquadmath.0.dylib $dylib
212215
done
216+
otool -L .%p/lib/gcc%type_num[gccver]/lib/lib*.[0-9].dylib | grep '@rpath' && exit 2
217+
218+
cp %b/gcc/config/darwin-sections.def %i/lib/gcc%type_num[gccver]/lib/gcc/${arch}-apple-darwin${darwinvers}/%v/plugin/include/config
213219
<<
214220
SplitOff: <<
215221
Package: %N-shlibs
@@ -298,10 +304,12 @@ DescPackaging: <<
298304
need to add it's own -isysroot flag.
299305
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79885
300306

301-
Homebrew patches for arm/aarch64 build from
302-
https://github.com/Homebrew/formula-patches/blob/master/gcc/gcc-%v-arm.diff
303-
- libasan.* and libsubsan.* currently not built on that arch.
304-
There are both 1 and 1.1 versions of libgcc_s.dylib now, but only 1 on arm.
307+
Homebrew patches for arm/aarch64 build and macOS 13 from
308+
https://github.com/Homebrew/formula-patches/blob/master/gcc/gcc-%v-{arm,ventura}.diff
309+
- libasan.* and libsubsan.* currently not built on arm.
310+
There are both "1" and "1.1" versions of libgcc_s.dylib now, but only "1" on arm.
311+
Manual fixes of @rpath install_names required for aarch64 build to maintain downstream
312+
package compatibility.
305313
<<
306314
Homepage: http://gcc.gnu.org/
307315
Maintainer: None <[email protected]>

0 commit comments

Comments
 (0)