Skip to content

Commit c64b5eb

Browse files
committed
merge: bring in gnu.org/gcc/v8 recipe (companion PR pkgxdev#13070)
mysql.com/v5_7 build-depends on gnu.org/gcc/v8 (linux only) for the InnoDB pre-C++17 idioms. The v8 recipe lives on a separate open PR; merging it here so CI can resolve the dep and bottle this PR. If pkgxdev#13070 lands first, this merge is a no-op.
2 parents e7a2f3c + 18722cb commit c64b5eb

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# GCC 8 — legacy version for old-vendored-C++ projects.
2+
#
3+
# Many projects vendoring older C++ libraries (RocksDB 6.3.x, old
4+
# MySQL 5.7, old InnoDB, pre-C++17 codebases generally) hit the
5+
# stricter copy-ctor / atomic / pair-construction rules introduced
6+
# in gcc 12+ libstdc++. They compile cleanly with gcc 8 which was
7+
# the last major to default to C++14 / gnu++14 ABI.
8+
#
9+
# Companion to gnu.org/gcc (latest) for cubefs.io, mysql.com/v5_7,
10+
# and other from-source recipes that can't easily be patched to
11+
# modern C++.
12+
13+
distributable:
14+
url: https://ftp.gnu.org/gnu/gcc/gcc-{{ version.raw }}/gcc-{{ version.raw }}.tar.xz
15+
strip-components: 1
16+
17+
versions:
18+
github: gcc-mirror/gcc/tags
19+
strip: /^releases\/gcc-/
20+
# Pin to the 8.x line — drop everything else.
21+
ignore:
22+
- /^[0-79]\./
23+
- /^9\./
24+
- /^[1-9][0-9]/
25+
26+
# Linux only. Darwin's old SDK situation makes gcc 8 hard to bring
27+
# up — users on darwin needing legacy C++ are better off with clang
28+
# from llvm.org which has its own legacy mode.
29+
platforms:
30+
- linux/x86-64
31+
- linux/aarch64
32+
33+
dependencies:
34+
gnu.org/binutils: '*'
35+
gnu.org/gmp: ~6
36+
gnu.org/mpfr: ~4
37+
gnu.org/mpc: ~1
38+
zlib.net: ^1.3
39+
40+
build:
41+
dependencies:
42+
linux:
43+
gnu.org/gcc: '*' # bootstrap with current gcc
44+
gnu.org/make: '*'
45+
perl.org: '*'
46+
gnu.org/patch: '*'
47+
curl.se: '*'
48+
github.com/westes/flex: '*'
49+
50+
working-directory: build
51+
script:
52+
- ARGS=($ARGS --with-pkgversion="pkgx GCC {{version}}")
53+
- ../configure "${ARGS[@]}"
54+
- make --jobs {{ hw.concurrency }}
55+
- make install
56+
57+
# gcc symlinks expected by some build systems. This recipe lives
58+
# one level deeper than the main gnu.org/gcc (v8 subdir), so the
59+
# relative path to binutils needs `../../../../` (4 levels).
60+
- run: |
61+
cd "{{prefix}}/bin"
62+
ln -sf gcc cc
63+
ln -sf ../../../../binutils/v\*/bin/ar ar
64+
ln -sf ../../../../binutils/v\*/bin/nm nm
65+
ln -sf ../../../../binutils/v\*/bin/ranlib ranlib
66+
67+
env:
68+
ARGS:
69+
- --prefix={{ prefix }}
70+
- --libdir={{ prefix }}/lib
71+
- --enable-languages=c,c++,fortran
72+
- --disable-bootstrap
73+
- --disable-nls
74+
- --disable-multilib
75+
- --with-system-zlib
76+
- --with-bugurl=https://github.com/pkgxdev/pantry/issues
77+
linux/x86-64:
78+
LDFLAGS: -fPIC
79+
CFLAGS: -fPIC
80+
CXXFLAGS: -fPIC
81+
82+
test:
83+
- gcc --version | grep -q "pkgx GCC {{version}}"
84+
- gcc -dumpversion | grep -q "^8\."
85+
86+
provides:
87+
- bin/ar
88+
- bin/cc
89+
- bin/c++
90+
- bin/cpp
91+
- bin/g++
92+
- bin/gcc
93+
- bin/gcc-ar
94+
- bin/gcc-nm
95+
- bin/gcc-ranlib
96+
- bin/gcov
97+
- bin/gfortran
98+
- bin/nm
99+
- bin/ranlib

0 commit comments

Comments
 (0)