[SeaBIOS] [PATCH] build: Allow to use cross C preprocessor

Roman Bolshakov posted 1 patch 5 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20190125155510.15116-1-r.bolshakov@yadro.com
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[SeaBIOS] [PATCH] build: Allow to use cross C preprocessor
Posted by Roman Bolshakov 5 years, 2 months ago
An attempt to cross-compile SeaBIOS on macOS can fail because host C
preprocessor doesn't comprehend the command line options:

  Compiling IASL src/fw/acpi-dsdt.hex
cpp -P -MD -MT src/fw/acpi-dsdt.hex src/fw/acpi-dsdt.dsl -o out/src/fw/acpi-dsdt.dsl.i.orig
clang: error: no input files
make: *** [src/fw/acpi-dsdt.hex] Error 1

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d2d11db..909c0a1 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ OBJCOPY=$(CROSS_PREFIX)objcopy
 OBJDUMP=$(CROSS_PREFIX)objdump
 STRIP=$(CROSS_PREFIX)strip
 PYTHON=python
-CPP=cpp
+CPP=$(CROSS_PREFIX)cpp
 IASL:=iasl
 LD32BIT_FLAG:=-melf_i386
 
-- 
2.20.1
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] build: Allow to use cross C preprocessor
Posted by Philippe Mathieu-Daudé 5 years, 2 months ago
On 1/25/19 4:55 PM, Roman Bolshakov wrote:
> An attempt to cross-compile SeaBIOS on macOS can fail because host C
> preprocessor doesn't comprehend the command line options:
> 
>   Compiling IASL src/fw/acpi-dsdt.hex
> cpp -P -MD -MT src/fw/acpi-dsdt.hex src/fw/acpi-dsdt.dsl -o out/src/fw/acpi-dsdt.dsl.i.orig
> clang: error: no input files
> make: *** [src/fw/acpi-dsdt.hex] Error 1
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index d2d11db..909c0a1 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -23,7 +23,7 @@ OBJCOPY=$(CROSS_PREFIX)objcopy
>  OBJDUMP=$(CROSS_PREFIX)objdump
>  STRIP=$(CROSS_PREFIX)strip
>  PYTHON=python
> -CPP=cpp
> +CPP=$(CROSS_PREFIX)cpp
>  IASL:=iasl
>  LD32BIT_FLAG:=-melf_i386
>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] build: Allow to use cross C preprocessor
Posted by Kevin O'Connor 5 years, 2 months ago
On Fri, Jan 25, 2019 at 06:55:10PM +0300, Roman Bolshakov wrote:
> An attempt to cross-compile SeaBIOS on macOS can fail because host C
> preprocessor doesn't comprehend the command line options:
> 
>   Compiling IASL src/fw/acpi-dsdt.hex
> cpp -P -MD -MT src/fw/acpi-dsdt.hex src/fw/acpi-dsdt.dsl -o out/src/fw/acpi-dsdt.dsl.i.orig
> clang: error: no input files
> make: *** [src/fw/acpi-dsdt.hex] Error 1

Thanks, but at high level this change doesn't look correct to me.
(The pre-processor isn't doing anything that is specific to the target
machine.)  If the user has an incompatible cpp then they can directly
change the CPP with: make CPP=/some/path/to/cpp

-Kevin
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] build: Allow to use cross C preprocessor
Posted by Paul Menzel 5 years, 2 months ago
Dear Roman,


On 01/25/19 16:55, Roman Bolshakov wrote:
> An attempt to cross-compile SeaBIOS on macOS can fail because host C
> preprocessor doesn't comprehend the command line options:
> 
>   Compiling IASL src/fw/acpi-dsdt.hex
> cpp -P -MD -MT src/fw/acpi-dsdt.hex src/fw/acpi-dsdt.dsl -o out/src/fw/acpi-dsdt.dsl.i.orig
> clang: error: no input files
> make: *** [src/fw/acpi-dsdt.hex] Error 1

Could you please add the Clang version?

[…]


Kind regards,

Paul

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] build: Allow to use cross C preprocessor
Posted by Roman Bolshakov 5 years, 2 months ago
On Mon, Jan 28, 2019 at 01:29:14PM +0100, Paul Menzel wrote:
> Dear Roman,
> 
> 
> On 01/25/19 16:55, Roman Bolshakov wrote:
> > An attempt to cross-compile SeaBIOS on macOS can fail because host C
> > preprocessor doesn't comprehend the command line options:
> > 
> >   Compiling IASL src/fw/acpi-dsdt.hex
> > cpp -P -MD -MT src/fw/acpi-dsdt.hex src/fw/acpi-dsdt.dsl -o out/src/fw/acpi-dsdt.dsl.i.orig
> > clang: error: no input files
> > make: *** [src/fw/acpi-dsdt.hex] Error 1
> 
> Could you please add the Clang version?
> 

Sure Paul,

$ cpp --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Thank you,
Roman
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org