]> git.ipfire.org Git - ipfire-3.x.git/blob - gcc/patches/0002-libcc1-Export-all-symbols.patch
gcc: Harden this package
[ipfire-3.x.git] / gcc / patches / 0002-libcc1-Export-all-symbols.patch
1 From 439c8e21de5245d3f345bd796f3131be319f54d2 Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Tue, 21 Mar 2023 17:52:04 +0000
4 Subject: [PATCH 2/2] libcc1: Export all symbols
5
6 This patches removes the -export-symbols option when linking libcc1 and
7 its plugins as it is breaking our hardening check where we are looking
8 for a reference to __stack_chk_fail in the symbol table.
9
10 Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
11 ---
12 libcc1/Makefile.am | 6 +++---
13 libcc1/Makefile.in | 6 +++---
14 2 files changed, 6 insertions(+), 6 deletions(-)
15
16 diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
17 index 6e3a34ff7e2..7eb8ec9178c 100644
18 --- a/libcc1/Makefile.am
19 +++ b/libcc1/Makefile.am
20 @@ -54,7 +54,7 @@ shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \
21 marshall_c_source = marshall-c.hh
22 marshall_cxx_source = marshall-cp.hh
23
24 -libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
25 +libcc1plugin_la_LDFLAGS = -module
26 libcc1plugin_la_SOURCES = libcc1plugin.cc context.cc context.hh \
27 $(shared_source) $(marshall_c_source)
28 libcc1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_C)
29 @@ -64,7 +64,7 @@ libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
30 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
31 $(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
32
33 -libcp1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcp1plugin.sym
34 +libcp1plugin_la_LDFLAGS = -module
35 libcp1plugin_la_SOURCES = libcp1plugin.cc context.cc context.hh \
36 $(shared_source) $(marshall_cxx_source)
37 libcp1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_CXX)
38 @@ -75,7 +75,7 @@ libcp1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
39 $(CXXFLAGS) $(libcp1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
40
41 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
42 -libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
43 +libcc1_la_LDFLAGS = -module
44 libcc1_la_SOURCES = findcomp.cc libcc1.cc libcp1.cc \
45 compiler.cc compiler.hh names.cc names.hh $(shared_source) \
46 $(marshall_c_source) $(marshall_cxx_source)
47 diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
48 index f8f590d71e9..aa3d45bcef4 100644
49 --- a/libcc1/Makefile.in
50 +++ b/libcc1/Makefile.in
51 @@ -405,7 +405,7 @@ shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \
52
53 marshall_c_source = marshall-c.hh
54 marshall_cxx_source = marshall-cp.hh
55 -libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
56 +libcc1plugin_la_LDFLAGS = -module
57 libcc1plugin_la_SOURCES = libcc1plugin.cc context.cc context.hh \
58 $(shared_source) $(marshall_c_source)
59
60 @@ -416,7 +416,7 @@ libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
61 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
62 $(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
63
64 -libcp1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcp1plugin.sym
65 +libcp1plugin_la_LDFLAGS = -module
66 libcp1plugin_la_SOURCES = libcp1plugin.cc context.cc context.hh \
67 $(shared_source) $(marshall_cxx_source)
68
69 @@ -428,7 +428,7 @@ libcp1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
70 $(CXXFLAGS) $(libcp1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
71
72 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
73 -libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
74 +libcc1_la_LDFLAGS = -module
75 libcc1_la_SOURCES = findcomp.cc libcc1.cc libcp1.cc \
76 compiler.cc compiler.hh names.cc names.hh $(shared_source) \
77 $(marshall_c_source) $(marshall_cxx_source)
78 --
79 2.30.2
80