[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need help to fix hardening-no-relro and hardening-no-relro



Hi Lucas,

I am new in packaging. `hardening-no-relro' also happens to me. It
turns out it is caused by the missing `-Wl,-z,relro' LDFLAGS. Maybe
overriding CFLAGS and CPPFLAGS but not LDFLAGS will solve FTBFS.

For example in debian/rules,

CFLAGS = '-Ofoo'
CPPFLAGS = '-Dfoo'
LDFLAGS += '-lfoo'

override_dh_auto_configure:
	dh_auto_configure -- --enable-foo

Cheers,
Alex

2015-08-11 21:05 GMT+08:00, lucas castro <lucascastroborges@gmail.com>:
> Gianfranco,
> No problem about about that on irc.
> I think I should take a time on another package, then mailed here.
> and if anyone know about this, it's fine. I really spent much time on this
> package,
> and learned a lot with it.
>
> On Tue, Aug 11, 2015 at 9:49 AM, Gianfranco Costamagna <
> costamagnagianfranco@yahoo.it> wrote:
>
>> Hi Lucas
>> (sorry for not answering on irc, I was AFK)
>>
>> hardening-check debian/xmbmon/usr/bin/xmbmon
>>
>>
>> d/rules:
>> override_dh_auto_build:
>> $(MAKE) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)"
>> LDFLAGS="$(LDFLAGS)"
>>
>>
>>
>> something like this seems to make autoconf aware of the flags (not sure
>> if
>> there is a
>> better way, and for sure you do not need them all).
>>
>> However with hardening stuff enabled now it FTBFS:
>>
>> gcc -g -O2 -fPIE -fstack-protector-strong -Wformat
>> -Werror=format-security
>> -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -o mbmon
>> mbmon.c getMBinfo.o tyan_tiger.o pci_pm.o sensors.o getMB-via.o
>> getMB-smb.o
>> getMB-isa.o smbuses.o smbus_piix4.o smbus_amd.o smbus_ali.o smbus_amd8.o
>> sens_winbond.o sens_via686.o sens_it87.o sens_gl52.o sens_lm85.o
>> sens_lm80.o sens_lm90.o sens_lm75.o sens_wl784.o smb_extemp.o -lm
>> mbmon.c: In function ‘uptime’:
>> mbmon.c:122:11: error: ‘KERN_BOOTTIME’ undeclared (first use in this
>> function)
>> mib[1] = KERN_BOOTTIME;
>> ^
>>
>>
>> cheers,
>>
>> Gianfranco
>>
>
>
>
> --
> contatos:
> Celular: ( 99 ) 9143-5954 - Vivo
> skype: lucasd3castro
> msn: lucascastroborges@hotmail.com
>


Reply to: