1 |
hi Peter, thanks for your bug reports, |
2 |
|
3 |
# conservative PIE PIC and SSP options, on by default, suppress flags |
4 |
take precedence |
5 |
HGCC_33_DEFAULT_SPECS_CPP_SECTION_PIC_ACTIVATION="%{!yet_exec: %{!nopie: |
6 |
-D__PIC__ -D__pic__ -DPIC}}" |
7 |
HGCC_33_DEFAULT_SPECS_CC1_SECTION_PIC_ACTIVATION="%{!yet_exec: %{!nopie: |
8 |
-fPIC -fpie}}" |
9 |
HGCC_33_DEFAULT_SPECS_CC1_SECTION_SSP_ACTIVATION="%{!yno_propolice: |
10 |
%{!fno-stack-protector: -fstack-protector %{!fno-stack-protector-all: |
11 |
-fstack-protector-all -fforce-addr}}}" |
12 |
# the Scrt1.o provided by Redhat has relocation errors when -pie builds |
13 |
executables with -shared and no main function |
14 |
HGCC_33_DEFAULT_SPECS_STRTSECTION_CRT_ACTIVATION="crt1S.o" |
15 |
# final static linking executables breaks when -pie is given |
16 |
HGCC_33_DEFAULT_SPECS_LINKSECTION_PIE_ACTIVATION="%{!yet_exec: %{!nopie: |
17 |
%{!static: -pie -z combreloc}}}" |
18 |
|
19 |
can you please try these lines in hcc.conf and activate them? |
20 |
|
21 |
TIA, |
22 |
|
23 |
Alex |
24 |
|
25 |
On Mon, 2003-12-15 at 15:06, Peter S. Mazinger wrote: |
26 |
> On Mon, 15 Dec 2003, Peter S. Mazinger wrote: |
27 |
> |
28 |
> New problem: I have rebuilt rpm-4.0.4 and got text relocation in |
29 |
> librpmbuild shared library hardened-gcc-3.3.2.0 worked) |
30 |
> I think we have to enforce -fPIC for all (also for static, because if |
31 |
> later a binary is built against static and dynamic libraries, it will have |
32 |
> problems (like bash's included readline, this is static) |
33 |
> The problem happens with libraries due to the change in cc1 section from |
34 |
> -fPIC to -fPIC -fpie (simple test: build zlib w/o the pic patch) |
35 |
> |
36 |
> > Hello! |
37 |
> > |
38 |
> > The link section has a !static redundancy (from EXC_FRONT and |
39 |
> > PIE_ACTIVATION), see attached diff (edited manually based on hcc.conf and |
40 |
> > the scripts) |
41 |
> > |
42 |
> > Why is crt1S.o added in the default config, the conservative one adds |
43 |
> > Scrt1.o? (crt1S.S is the same as in hardened 2.4.6 non_csu version), it is |
44 |
> > rather a glibc issue having it or not. |
45 |
> > |
46 |
> > Also I am not so sure about the stack-protector[-all] running together, I |
47 |
> > have the impression, that they work separately, but for all cases I would |
48 |
> > suggest the possibility to use only fstack-protector if -all is |
49 |
> > deactivated (there could be some apps that cannot be built with -all) like |
50 |
> > this, or similar |
51 |
> > %{!yno_propolice: %{!fno-stack-protector: -fstack-protector} |
52 |
> > %{!fno-stack-protector-all: -fstack-protector-all}}. |
53 |
> > |
54 |
> > I do not really know which one needs fforce-addr (the kernel works with |
55 |
> > both, using my patch -earlier mail, but does not like fforce-addr). |
56 |
> > So adapt accordingly. |
57 |
> > |
58 |
> > Peter |
59 |
> > |
60 |
> > |
61 |
-- |
62 |
Alexander Gabert <pappy@g.o> |
63 |
http://www.gentoo.org/proj/en/hardened |
64 |
|
65 |
|
66 |
-- |
67 |
gentoo-hardened@g.o mailing list |