[coreboot] libpayload: fix cross compilation (somewhat)

Stefan Reinauer stepan at coresystems.de
Thu Aug 7 17:31:01 CEST 2008


Jordan Crouse wrote:
> On 07/08/08 17:20 +0200, Stefan Reinauer wrote:
>   
>> Jordan Crouse wrote:
>>
>>     
>>>> Index: libpayload/bin/lpgcc
>>>> ===================================================================
>>>> --- libpayload/bin/lpgcc	(revision 3473)
>>>> +++ libpayload/bin/lpgcc	(working copy)
>>>> @@ -28,8 +28,7 @@
>>>>  
>>>>  # GCC wrapper for libpayload
>>>>  
>>>> -DEFAULT_PREFIX=/opt
>>>> -DEFAULT_CC=gcc
>>>> +DEFAULT_CC=$CC
>>>>     
>>>>         
>>> You should put a DEFAULT_CC ?= gcc after this line to account for
>>> CC being empty. Other then that, this looks good.
>>>       
>> ok, done.
>>
>> Next problem: How do I probe for -fno-stack-protector in the libpayload
>> makefile?
>>     
>
> We don't have the -fno-stack-protector logic in the libpayload makefile?
> Was I really that stupid? /me checks - Yep, i was that stupid.
>
> Use the logic from buildrom:
>
> try-run= $(shell set -e; \
> TMP=".$$$$.tmp"; \
> if ($(1)) > /dev/null 2>&1; \
> then echo "$(2)"; \
> else echo "$(3)"; \
> fi; rm -rf "$$TMP")
>
> cc-option= $(call
> try-run,\
> $(CC) $(1) -S
> -xc /dev/null
> -o "$$TMP",
> $(1), $(2))
>
> STACKPROTECT += $(call cc-option, -fno-stack-protector,)
>   

Cool, works and checked in...

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866





More information about the coreboot mailing list