mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
toolchain: update to gcc-7.3.0 and enable retpolines on x86_64 and i586
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
27ee5072c5
commit
11b5e5cb8e
File diff suppressed because it is too large
Load Diff
@@ -30,10 +30,12 @@ usr/lib/libattr.so.1.1.0
|
||||
#usr/share/man/man1/setfattr.1
|
||||
#usr/share/man/man2/flistxattr.2
|
||||
#usr/share/man/man2/fremovexattr.2
|
||||
#usr/share/man/man2/fsetxattr.2
|
||||
#usr/share/man/man2/getxattr.2
|
||||
#usr/share/man/man2/setxattr.2
|
||||
#usr/share/man/man2/llistxattr.2
|
||||
#usr/share/man/man2/lremovexattr.2
|
||||
#usr/share/man/man2/removexattr.2
|
||||
#usr/share/man/man3/attr_get.3
|
||||
#usr/share/man/man3/attr_getf.3
|
||||
#usr/share/man/man3/attr_list.3
|
||||
|
||||
@@ -17,6 +17,8 @@ usr/bin/bzmore
|
||||
#usr/include/bzlib.h
|
||||
#usr/lib/libbz2.a
|
||||
#usr/lib/libbz2.so
|
||||
#usr/man
|
||||
#usr/man/man1
|
||||
#usr/man/man1/bzcmp.1
|
||||
#usr/man/man1/bzdiff.1
|
||||
#usr/man/man1/bzegrep.1
|
||||
|
||||
@@ -12,4 +12,5 @@ usr/lib/libgdbm.so.3.0.0
|
||||
usr/lib/libgdbm_compat.so
|
||||
usr/lib/libgdbm_compat.so.3
|
||||
usr/lib/libgdbm_compat.so.3.0.0
|
||||
#usr/man/man3
|
||||
#usr/man/man3/gdbm.3
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,7 @@ usr/lib/libatm.so.1
|
||||
usr/lib/libatm.so.1.0.0
|
||||
#usr/man/man4
|
||||
#usr/man/man4/atmsigd.conf.4
|
||||
#usr/man/man7
|
||||
#usr/man/man7/qos.7
|
||||
#usr/man/man7/sap.7
|
||||
#usr/man/man8
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -308,6 +308,7 @@ usr/lib/libldap_r-2.3.so.0.2.8
|
||||
#usr/man/man3/ldap_url_parse.3
|
||||
#usr/man/man3/ldap_value_free.3
|
||||
#usr/man/man3/ldap_value_free_len.3
|
||||
#usr/man/man5
|
||||
#usr/man/man5/ldap.conf.5
|
||||
#usr/man/man5/ldif.5
|
||||
#usr/man/man5/slapd-bdb.5
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,8 @@ ifeq "$(PASS)" "1"
|
||||
CFLAGS := $(patsubst -march=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfpu=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mindirect-branch=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfunction-return=%,,$(CFLAGS))
|
||||
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)-tools1
|
||||
EXTRA_CONFIG = \
|
||||
|
||||
@@ -36,6 +36,8 @@ ifeq "$(PASS)" "1"
|
||||
CFLAGS := $(patsubst -march=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfpu=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mindirect-branch=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfunction-return=%,,$(CFLAGS))
|
||||
endif
|
||||
|
||||
# Set max cache size to 5GB
|
||||
|
||||
19
lfs/flex
19
lfs/flex
@@ -30,7 +30,22 @@ THISAPP = flex-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.gz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
|
||||
# Normal build or $(TOOLS_DIR) build.
|
||||
#
|
||||
ifeq "$(ROOT)" ""
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
EXTRA_CONFIG = --prefix=/usr --disable-nls
|
||||
EXTRA_MAKE =
|
||||
EXTRA_INSTALL =
|
||||
|
||||
else
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)-tools
|
||||
EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls
|
||||
EXTRA_MAKE =
|
||||
EXTRA_INSTALL =
|
||||
endif
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
@@ -71,7 +86,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
||||
cd $(DIR_APP) && HELP2MAN=$(TOOLS_DIR)/bin/true \
|
||||
./configure --prefix=/usr --disable-nls
|
||||
./configure $(EXTRA_CONFIG)
|
||||
cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
|
||||
cd $(DIR_APP) && make $(EXTRA_INSTALL) install
|
||||
ifeq "$(ROOT)" ""
|
||||
|
||||
32
lfs/gcc
32
lfs/gcc
@@ -1,7 +1,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2017 IPFire Team <info@ipfire.org> #
|
||||
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
@@ -24,14 +24,14 @@
|
||||
|
||||
include Config
|
||||
|
||||
VER = 6.3.0
|
||||
VER = 7.3.0
|
||||
|
||||
GMP_VER = 5.0.5
|
||||
MPFR_VER = 2.4.2
|
||||
GMP_VER = 6.1.2
|
||||
MPFR_VER = 3.1.6
|
||||
MPC_VER = 1.0.3
|
||||
|
||||
THISAPP = gcc-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.gz
|
||||
DL_FILE = $(THISAPP).tar.xz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
|
||||
@@ -40,6 +40,12 @@ CFLAGS := $(patsubst -mfpu=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mtune=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
|
||||
CFLAGS := $(filter-out -fexceptions,$(CFLAGS))
|
||||
|
||||
ifeq "$(PASS)" "1"
|
||||
CFLAGS := $(patsubst -mindirect-branch=%,,$(CFLAGS))
|
||||
CFLAGS := $(patsubst -mfunction-return=%,,$(CFLAGS))
|
||||
endif
|
||||
|
||||
CXXFLAGS := $(CFLAGS)
|
||||
|
||||
ifeq "$(BUILD_ARCH)" "armv7hl"
|
||||
@@ -174,18 +180,18 @@ export TCFLAGS = $(CFLAGS)
|
||||
###############################################################################
|
||||
|
||||
objects = $(DL_FILE) \
|
||||
gmp-$(GMP_VER).tar.bz2 \
|
||||
mpfr-$(MPFR_VER).tar.bz2 \
|
||||
gmp-$(GMP_VER).tar.xz \
|
||||
mpfr-$(MPFR_VER).tar.xz \
|
||||
mpc-$(MPC_VER).tar.gz
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
gmp-$(GMP_VER).tar.bz2 = $(DL_FROM)/gmp-$(GMP_VER).tar.bz2
|
||||
mpfr-$(MPFR_VER).tar.bz2 = $(DL_FROM)/mpfr-$(MPFR_VER).tar.bz2
|
||||
mpfr-$(MPFR_VER).tar.xz = $(DL_FROM)/mpfr-$(MPFR_VER).tar.xz
|
||||
mpc-$(MPC_VER).tar.gz = $(DL_FROM)/mpc-$(MPC_VER).tar.gz
|
||||
|
||||
$(DL_FILE)_MD5 = 6e5ea04789678f1250c1b30c4d9ec417
|
||||
gmp-$(GMP_VER).tar.bz2_MD5 = 041487d25e9c230b0c42b106361055fe
|
||||
mpfr-$(MPFR_VER).tar.bz2_MD5 = 89e59fe665e2b3ad44a6789f40b059a0
|
||||
$(DL_FILE)_MD5 = be2da21680f27624f3a87055c4ba5af2
|
||||
gmp-$(GMP_VER).tar.xz_MD5 = f58fa8001d60c4c77595fbbb62b63c1d
|
||||
mpfr-$(MPFR_VER).tar.xz_MD5 = 51bfdbf81553966c8d43808122cc81b3
|
||||
mpc-$(MPC_VER).tar.gz_MD5 = d6a1d5f8ddea3abd2cc3e98f58352d26
|
||||
|
||||
install : $(TARGET)
|
||||
@@ -225,9 +231,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
ifeq "$(TOOLCHAIN)" "1"
|
||||
# Build gmp and mpfr internally in toolchain.
|
||||
cd $(DIR_APP) && tar xfa $(DIR_DL)/gmp-$(GMP_VER).tar.bz2
|
||||
cd $(DIR_APP) && tar xfa $(DIR_DL)/gmp-$(GMP_VER).tar.xz
|
||||
cd $(DIR_APP) && mv -v gmp-$(GMP_VER) gmp
|
||||
cd $(DIR_APP) && tar xfa $(DIR_DL)/mpfr-$(MPFR_VER).tar.bz2
|
||||
cd $(DIR_APP) && tar xfa $(DIR_DL)/mpfr-$(MPFR_VER).tar.xz
|
||||
cd $(DIR_APP) && mv -v mpfr-$(MPFR_VER) mpfr
|
||||
cd $(DIR_APP) && tar xfa $(DIR_DL)/mpc-$(MPC_VER).tar.gz
|
||||
cd $(DIR_APP) && mv -v mpc-$(MPC_VER) mpc
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2016 IPFire Team <info@ipfire.org> #
|
||||
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
@@ -59,7 +59,11 @@ ifeq "$(BUILD_ARCH)" "armv7hl"
|
||||
endif
|
||||
|
||||
ifeq "$(BUILD_ARCH)" "i586"
|
||||
CFLAGS += -march=i586 -mtune=generic -mno-tls-direct-seg-refs
|
||||
CFLAGS += -march=i586 -mtune=generic -mindirect-branch=thunk -mfunction-return=thunk -mno-tls-direct-seg-refs
|
||||
endif
|
||||
|
||||
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||
CFLAGS += -mindirect-branch=thunk -mfunction-return=thunk
|
||||
endif
|
||||
|
||||
# Disable hardware FP for armv5tel
|
||||
@@ -118,6 +122,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
||||
@mkdir $(DIR_SRC)/glibc-build
|
||||
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-2.25-gcc-7.patch
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
|
||||
|
||||
ifneq "$(TOOLCHAIN)" "1"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2016 IPFire Team <info@ipfire.org> #
|
||||
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
@@ -37,6 +37,7 @@ ifneq "$(KCFG)" "-sse2"
|
||||
CFLAGS += -DPURIFY
|
||||
else
|
||||
CFLAGS =-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC
|
||||
CFLAGS+= -mindirect-branch=thunk -mfunction-return=thunk
|
||||
CFLAGS+= -fstack-protector-all --param=ssp-buffer-size=4
|
||||
CFLAGS+= -march=i686 -mmmx -msse -msse2 -mfpmath=sse
|
||||
CFLAGS+= -fomit-frame-pointer -DPURIFY
|
||||
|
||||
@@ -32,6 +32,8 @@ DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
|
||||
CXXFLAGS+= -Wno-error=format-truncation
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
@@ -77,7 +79,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
cd $(DIR_APP) && autoreconf -vfi
|
||||
cd $(DIR_APP)/libltdl && autoreconf -vfi
|
||||
|
||||
cd $(DIR_APP) && ./configure \
|
||||
cd $(DIR_APP) && CXXFLAGS="$(CXXFLAGS)" ./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/squid \
|
||||
--datadir=/usr/lib/squid \
|
||||
|
||||
8
make.sh
8
make.sh
@@ -37,7 +37,7 @@ KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
|
||||
GIT_TAG=$(git tag | tail -1) # Git Tag
|
||||
GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit
|
||||
|
||||
TOOLCHAINVER=20171121
|
||||
TOOLCHAINVER=20180126
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@@ -144,14 +144,14 @@ configure_build() {
|
||||
BUILDTARGET="${build_arch}-unknown-linux-gnu"
|
||||
CROSSTARGET="${build_arch}-cross-linux-gnu"
|
||||
BUILD_PLATFORM="x86"
|
||||
CFLAGS_ARCH="-m64 -mtune=generic"
|
||||
CFLAGS_ARCH="-m64 -mindirect-branch=thunk -mfunction-return=thunk -mtune=generic"
|
||||
;;
|
||||
|
||||
i586)
|
||||
BUILDTARGET="${build_arch}-pc-linux-gnu"
|
||||
CROSSTARGET="${build_arch}-cross-linux-gnu"
|
||||
BUILD_PLATFORM="x86"
|
||||
CFLAGS_ARCH="-march=i586 -mtune=generic -fomit-frame-pointer"
|
||||
CFLAGS_ARCH="-march=i586 -mindirect-branch=thunk -mfunction-return=thunk -mtune=generic -fomit-frame-pointer"
|
||||
;;
|
||||
|
||||
aarch64)
|
||||
@@ -952,6 +952,7 @@ buildtoolchain() {
|
||||
lfsmake1 tar
|
||||
lfsmake1 texinfo
|
||||
lfsmake1 xz
|
||||
lfsmake1 flex
|
||||
lfsmake1 fake-environ
|
||||
lfsmake1 strip
|
||||
lfsmake1 cleanup-toolchain
|
||||
@@ -982,7 +983,6 @@ buildbase() {
|
||||
lfsmake2 iana-etc
|
||||
lfsmake2 m4
|
||||
lfsmake2 bison
|
||||
lfsmake2 ncurses-compat
|
||||
lfsmake2 ncurses
|
||||
lfsmake2 procps
|
||||
lfsmake2 libtool
|
||||
|
||||
23
src/patches/glibc/glibc-2.25-gcc-7.patch
Normal file
23
src/patches/glibc/glibc-2.25-gcc-7.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/malloc/hooks.c b/malloc/hooks.c
|
||||
index 4398c0a017..2c6cebc889 100644
|
||||
--- a/malloc/hooks.c
|
||||
+++ b/malloc/hooks.c
|
||||
@@ -347,11 +347,18 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
|
||||
newmem = _int_realloc (&main_arena, oldp, oldsize, nb);
|
||||
}
|
||||
|
||||
+ DIAG_PUSH_NEEDS_COMMENT;
|
||||
+#if __GNUC_PREREQ (7, 0)
|
||||
+ /* GCC 7 warns about magic_p may be used uninitialized. But we never
|
||||
+ reach here if magic_p is uninitialized. */
|
||||
+ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
|
||||
+#endif
|
||||
/* mem2chunk_check changed the magic byte in the old chunk.
|
||||
If newmem is NULL, then the old chunk will still be used though,
|
||||
so we need to invert that change here. */
|
||||
if (newmem == NULL)
|
||||
*magic_p ^= 0xFF;
|
||||
+ DIAG_POP_NEEDS_COMMENT;
|
||||
|
||||
__libc_lock_unlock (main_arena.mutex);
|
||||
|
||||
Reference in New Issue
Block a user