public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
       [not found] ` <4A89E2EF3DFEDB4C8BFDE51014F606A14E199A2D@SHSMSX104.ccr.corp.intel.com>
@ 2017-12-28 22:18   ` Chema Gonzalez
  2017-12-29 15:17     ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Chema Gonzalez @ 2017-12-28 22:18 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

Sure.

Thanks,
-Chema

---------- Forwarded message ----------
From: Gao, Liming <liming.gao@intel.com>
Date: Wed, Dec 27, 2017 at 5:48 PM
Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
C Makefile (#122)
To: "chemag@gmail.com" <chemag@gmail.com>


Could you send patch to edk2-devel@lists.01.org?



From: chemag [mailto:notifications@github.com]
Sent: Thursday, December 28, 2017 9:26 AM
To: tianocore/edk2 <edk2@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
Makefile (#122)



I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
is different from the MS one ("X64").

It is not clear anyway we can proceed without valid build variables
(ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
SYS_LIB_PATH).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chema Gonzalez chemag@gmail.com

________________________________

You can view, comment on, or merge this pull request online at:

  https://github.com/tianocore/edk2/pull/122

Commit Summary

BaseTools: Barf on unknown HOST_ARCH in C Makefile

File Changes

M BaseTools/Source/C/Makefiles/ms.common (6)

Patch Links:

https://github.com/tianocore/edk2/pull/122.patch
https://github.com/tianocore/edk2/pull/122.diff

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

[-- Attachment #2: 0001-BaseTools-Barf-on-unknown-HOST_ARCH-in-C-Makefile.patch --]
[-- Type: text/x-patch, Size: 1482 bytes --]

From b0657ee033daad00c996c561857d4b3aad1f47cf Mon Sep 17 00:00:00 2001
From: Chema Gonzalez <chemag@fb.com>
Date: Wed, 27 Dec 2017 16:23:56 -0800
Subject: [PATCH] BaseTools: Barf on unknown HOST_ARCH in C Makefile

I was getting `HOST_ARCH` set using the linux arch name ("x86_64"), which
is different from the MS one ("X64").

It is not clear anyway we can proceed without valid build variables
(`ARCH_INCLUDE`, `BIN_PATH`, `LIB_PATH`, `SYS_BIN_PATH`, and
`SYS_LIB_PATH`).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chema Gonzalez <chemag@gmail.com>
---
 BaseTools/Source/C/Makefiles/ms.common | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/Makefiles/ms.common
index a6bfea5..06399df 100644
--- a/BaseTools/Source/C/Makefiles/ms.common
+++ b/BaseTools/Source/C/Makefiles/ms.common
@@ -42,14 +42,16 @@ BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win32
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win32
 SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
-!ENDIF
 
-!IF "$(HOST_ARCH)"=="X64"
+!ELSEIF "$(HOST_ARCH)"=="X64"
 ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
 BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win64
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win64
 SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
+
+!ELSE
+!ERROR "Unknown HOST_ARCH variable"
 !ENDIF
 
 CC = cl.exe
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
  2017-12-28 22:18   ` FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122) Chema Gonzalez
@ 2017-12-29 15:17     ` Gao, Liming
  2018-01-04 19:47       ` Chema Gonzalez
  0 siblings, 1 reply; 7+ messages in thread
From: Gao, Liming @ 2017-12-29 15:17 UTC (permalink / raw)
  To: Chema Gonzalez, edk2-devel@lists.01.org

I suggest GNUmakefile also adds this condition to report error message if HOST_ARCH is not set correctly.

> -----Original Message-----
> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema Gonzalez
> Sent: Friday, December 29, 2017 6:19 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: Fwd: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
> 
> Sure.
> 
> Thanks,
> -Chema
> 
> ---------- Forwarded message ----------
> From: Gao, Liming <liming.gao@intel.com>
> Date: Wed, Dec 27, 2017 at 5:48 PM
> Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
> C Makefile (#122)
> To: "chemag@gmail.com" <chemag@gmail.com>
> 
> 
> Could you send patch to edk2-devel@lists.01.org?
> 
> 
> 
> From: chemag [mailto:notifications@github.com]
> Sent: Thursday, December 28, 2017 9:26 AM
> To: tianocore/edk2 <edk2@noreply.github.com>
> Cc: Subscribed <subscribed@noreply.github.com>
> Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
> Makefile (#122)
> 
> 
> 
> I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
> is different from the MS one ("X64").
> 
> It is not clear anyway we can proceed without valid build variables
> (ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
> SYS_LIB_PATH).
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chema Gonzalez chemag@gmail.com
> 
> ________________________________
> 
> You can view, comment on, or merge this pull request online at:
> 
>   https://github.com/tianocore/edk2/pull/122
> 
> Commit Summary
> 
> BaseTools: Barf on unknown HOST_ARCH in C Makefile
> 
> File Changes
> 
> M BaseTools/Source/C/Makefiles/ms.common (6)
> 
> Patch Links:
> 
> https://github.com/tianocore/edk2/pull/122.patch
> https://github.com/tianocore/edk2/pull/122.diff
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
  2017-12-29 15:17     ` Gao, Liming
@ 2018-01-04 19:47       ` Chema Gonzalez
  2018-01-09  1:42         ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Chema Gonzalez @ 2018-01-04 19:47 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel@lists.01.org

[-- Attachment #1: Type: text/plain, Size: 2294 bytes --]

Added similar changes to `BaseTools/Source/C/Makefiles/header.makefile`.

Thanks,
-Chema


On Fri, Dec 29, 2017 at 7:17 AM, Gao, Liming <liming.gao@intel.com> wrote:
> I suggest GNUmakefile also adds this condition to report error message if HOST_ARCH is not set correctly.
>
>> -----Original Message-----
>> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema Gonzalez
>> Sent: Friday, December 29, 2017 6:19 AM
>> To: edk2-devel@lists.01.org
>> Cc: Gao, Liming <liming.gao@intel.com>
>> Subject: Fwd: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
>>
>> Sure.
>>
>> Thanks,
>> -Chema
>>
>> ---------- Forwarded message ----------
>> From: Gao, Liming <liming.gao@intel.com>
>> Date: Wed, Dec 27, 2017 at 5:48 PM
>> Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>> C Makefile (#122)
>> To: "chemag@gmail.com" <chemag@gmail.com>
>>
>>
>> Could you send patch to edk2-devel@lists.01.org?
>>
>>
>>
>> From: chemag [mailto:notifications@github.com]
>> Sent: Thursday, December 28, 2017 9:26 AM
>> To: tianocore/edk2 <edk2@noreply.github.com>
>> Cc: Subscribed <subscribed@noreply.github.com>
>> Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
>> Makefile (#122)
>>
>>
>>
>> I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
>> is different from the MS one ("X64").
>>
>> It is not clear anyway we can proceed without valid build variables
>> (ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
>> SYS_LIB_PATH).
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Chema Gonzalez chemag@gmail.com
>>
>> ________________________________
>>
>> You can view, comment on, or merge this pull request online at:
>>
>>   https://github.com/tianocore/edk2/pull/122
>>
>> Commit Summary
>>
>> BaseTools: Barf on unknown HOST_ARCH in C Makefile
>>
>> File Changes
>>
>> M BaseTools/Source/C/Makefiles/ms.common (6)
>>
>> Patch Links:
>>
>> https://github.com/tianocore/edk2/pull/122.patch
>> https://github.com/tianocore/edk2/pull/122.diff
>>
>> —
>> You are receiving this because you are subscribed to this thread.
>> Reply to this email directly, view it on GitHub, or mute the thread.

[-- Attachment #2: 0001-BaseTools-Barf-on-unknown-HOST_ARCH-in-C-Makefile.patch --]
[-- Type: text/x-patch, Size: 2516 bytes --]

From f1b7b7ccb78e853433d41652f0be49aa14030f00 Mon Sep 17 00:00:00 2001
From: Chema Gonzalez <chemag@fb.com>
Date: Wed, 27 Dec 2017 16:23:56 -0800
Subject: [PATCH] BaseTools: Barf on unknown HOST_ARCH in C Makefile

I was getting `HOST_ARCH` set using the linux arch name ("x86_64"), which
is different from the MS one ("X64").

It is not clear anyway we can proceed without valid build variables
(`ARCH_INCLUDE`, `BIN_PATH`, `LIB_PATH`, `SYS_BIN_PATH`, and
`SYS_LIB_PATH`).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chema Gonzalez <chemag@gmail.com>
---
 BaseTools/Source/C/Makefiles/header.makefile | 12 ++++++------
 BaseTools/Source/C/Makefiles/ms.common       |  6 ++++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 27aa28b..e034da2 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -29,18 +29,18 @@ BUILD_LD ?= ld
 LINKER ?= $(BUILD_CC)
 ifeq ($(HOST_ARCH), IA32)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
-endif
 
-ifeq ($(HOST_ARCH), X64)
+else ifeq ($(HOST_ARCH), X64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
-endif
 
-ifeq ($(HOST_ARCH), ARM)
+else ifeq ($(HOST_ARCH), ARM)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
-endif
 
-ifeq ($(HOST_ARCH), AARCH64)
+else ifeq ($(HOST_ARCH), AARCH64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/
+
+else
+$(error Bad HOST_ARCH)
 endif
 
 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 
diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/Makefiles/ms.common
index a6bfea5..06399df 100644
--- a/BaseTools/Source/C/Makefiles/ms.common
+++ b/BaseTools/Source/C/Makefiles/ms.common
@@ -42,14 +42,16 @@ BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win32
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win32
 SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
-!ENDIF
 
-!IF "$(HOST_ARCH)"=="X64"
+!ELSEIF "$(HOST_ARCH)"=="X64"
 ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
 BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win64
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win64
 SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
+
+!ELSE
+!ERROR "Unknown HOST_ARCH variable"
 !ENDIF
 
 CC = cl.exe
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
  2018-01-04 19:47       ` Chema Gonzalez
@ 2018-01-09  1:42         ` Gao, Liming
  2018-01-09  2:34           ` Chema Gonzalez
  0 siblings, 1 reply; 7+ messages in thread
From: Gao, Liming @ 2018-01-09  1:42 UTC (permalink / raw)
  To: Chema Gonzalez; +Cc: edk2-devel@lists.01.org

Chema:
  Sorry for late response. I think the change is good. For windows and gcc, how about use the same error message for the unknown or unsupported arch?

+else
+$(error Bad HOST_ARCH)
endif

+!ELSE
+!ERROR "Unknown HOST_ARCH variable"
 !ENDIF

Thanks
Liming
>-----Original Message-----
>From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema
>Gonzalez
>Sent: Friday, January 05, 2018 3:48 AM
>To: Gao, Liming <liming.gao@intel.com>
>Cc: edk2-devel@lists.01.org
>Subject: Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>C Makefile (#122)
>
>Added similar changes to `BaseTools/Source/C/Makefiles/header.makefile`.
>
>Thanks,
>-Chema
>
>
>On Fri, Dec 29, 2017 at 7:17 AM, Gao, Liming <liming.gao@intel.com> wrote:
>> I suggest GNUmakefile also adds this condition to report error message if
>HOST_ARCH is not set correctly.
>>
>>> -----Original Message-----
>>> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of
>Chema Gonzalez
>>> Sent: Friday, December 29, 2017 6:19 AM
>>> To: edk2-devel@lists.01.org
>>> Cc: Gao, Liming <liming.gao@intel.com>
>>> Subject: Fwd: FW: [tianocore/edk2] BaseTools: Barf on unknown
>HOST_ARCH in C Makefile (#122)
>>>
>>> Sure.
>>>
>>> Thanks,
>>> -Chema
>>>
>>> ---------- Forwarded message ----------
>>> From: Gao, Liming <liming.gao@intel.com>
>>> Date: Wed, Dec 27, 2017 at 5:48 PM
>>> Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>>> C Makefile (#122)
>>> To: "chemag@gmail.com" <chemag@gmail.com>
>>>
>>>
>>> Could you send patch to edk2-devel@lists.01.org?
>>>
>>>
>>>
>>> From: chemag [mailto:notifications@github.com]
>>> Sent: Thursday, December 28, 2017 9:26 AM
>>> To: tianocore/edk2 <edk2@noreply.github.com>
>>> Cc: Subscribed <subscribed@noreply.github.com>
>>> Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
>>> Makefile (#122)
>>>
>>>
>>>
>>> I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
>>> is different from the MS one ("X64").
>>>
>>> It is not clear anyway we can proceed without valid build variables
>>> (ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
>>> SYS_LIB_PATH).
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Chema Gonzalez chemag@gmail.com
>>>
>>> ________________________________
>>>
>>> You can view, comment on, or merge this pull request online at:
>>>
>>>   https://github.com/tianocore/edk2/pull/122
>>>
>>> Commit Summary
>>>
>>> BaseTools: Barf on unknown HOST_ARCH in C Makefile
>>>
>>> File Changes
>>>
>>> M BaseTools/Source/C/Makefiles/ms.common (6)
>>>
>>> Patch Links:
>>>
>>> https://github.com/tianocore/edk2/pull/122.patch
>>> https://github.com/tianocore/edk2/pull/122.diff
>>>
>>> —
>>> You are receiving this because you are subscribed to this thread.
>>> Reply to this email directly, view it on GitHub, or mute the thread.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
  2018-01-09  1:42         ` Gao, Liming
@ 2018-01-09  2:34           ` Chema Gonzalez
  2018-01-24  1:17             ` Chema Gonzalez
  0 siblings, 1 reply; 7+ messages in thread
From: Chema Gonzalez @ 2018-01-09  2:34 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel@lists.01.org

[-- Attachment #1: Type: text/plain, Size: 3175 bytes --]

Done.

-Chema


On Mon, Jan 8, 2018 at 5:42 PM, Gao, Liming <liming.gao@intel.com> wrote:
> Chema:
>   Sorry for late response. I think the change is good. For windows and gcc, how about use the same error message for the unknown or unsupported arch?
>
> +else
> +$(error Bad HOST_ARCH)
> endif
>
> +!ELSE
> +!ERROR "Unknown HOST_ARCH variable"
>  !ENDIF
>
> Thanks
> Liming
>>-----Original Message-----
>>From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema
>>Gonzalez
>>Sent: Friday, January 05, 2018 3:48 AM
>>To: Gao, Liming <liming.gao@intel.com>
>>Cc: edk2-devel@lists.01.org
>>Subject: Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>>C Makefile (#122)
>>
>>Added similar changes to `BaseTools/Source/C/Makefiles/header.makefile`.
>>
>>Thanks,
>>-Chema
>>
>>
>>On Fri, Dec 29, 2017 at 7:17 AM, Gao, Liming <liming.gao@intel.com> wrote:
>>> I suggest GNUmakefile also adds this condition to report error message if
>>HOST_ARCH is not set correctly.
>>>
>>>> -----Original Message-----
>>>> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of
>>Chema Gonzalez
>>>> Sent: Friday, December 29, 2017 6:19 AM
>>>> To: edk2-devel@lists.01.org
>>>> Cc: Gao, Liming <liming.gao@intel.com>
>>>> Subject: Fwd: FW: [tianocore/edk2] BaseTools: Barf on unknown
>>HOST_ARCH in C Makefile (#122)
>>>>
>>>> Sure.
>>>>
>>>> Thanks,
>>>> -Chema
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Gao, Liming <liming.gao@intel.com>
>>>> Date: Wed, Dec 27, 2017 at 5:48 PM
>>>> Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>>>> C Makefile (#122)
>>>> To: "chemag@gmail.com" <chemag@gmail.com>
>>>>
>>>>
>>>> Could you send patch to edk2-devel@lists.01.org?
>>>>
>>>>
>>>>
>>>> From: chemag [mailto:notifications@github.com]
>>>> Sent: Thursday, December 28, 2017 9:26 AM
>>>> To: tianocore/edk2 <edk2@noreply.github.com>
>>>> Cc: Subscribed <subscribed@noreply.github.com>
>>>> Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
>>>> Makefile (#122)
>>>>
>>>>
>>>>
>>>> I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
>>>> is different from the MS one ("X64").
>>>>
>>>> It is not clear anyway we can proceed without valid build variables
>>>> (ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
>>>> SYS_LIB_PATH).
>>>>
>>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>>> Signed-off-by: Chema Gonzalez chemag@gmail.com
>>>>
>>>> ________________________________
>>>>
>>>> You can view, comment on, or merge this pull request online at:
>>>>
>>>>   https://github.com/tianocore/edk2/pull/122
>>>>
>>>> Commit Summary
>>>>
>>>> BaseTools: Barf on unknown HOST_ARCH in C Makefile
>>>>
>>>> File Changes
>>>>
>>>> M BaseTools/Source/C/Makefiles/ms.common (6)
>>>>
>>>> Patch Links:
>>>>
>>>> https://github.com/tianocore/edk2/pull/122.patch
>>>> https://github.com/tianocore/edk2/pull/122.diff
>>>>
>>>> —
>>>> You are receiving this because you are subscribed to this thread.
>>>> Reply to this email directly, view it on GitHub, or mute the thread.

[-- Attachment #2: 0001-BaseTools-Barf-on-unknown-HOST_ARCH-in-C-Makefile.patch --]
[-- Type: text/x-patch, Size: 2503 bytes --]

From 9730c6eb70b533ffe666f7d07acabf3414266b2f Mon Sep 17 00:00:00 2001
From: Chema Gonzalez <chemag@fb.com>
Date: Wed, 27 Dec 2017 16:23:56 -0800
Subject: [PATCH] BaseTools: Barf on unknown HOST_ARCH in C Makefile

I was getting `HOST_ARCH` set using the linux arch name ("x86_64"), which
is different from the MS one ("X64").

It is not clear anyway we can proceed without valid build variables
(`ARCH_INCLUDE`, `BIN_PATH`, `LIB_PATH`, `SYS_BIN_PATH`, and
`SYS_LIB_PATH`).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chema Gonzalez <chemag@gmail.com>
---
 BaseTools/Source/C/Makefiles/header.makefile | 12 ++++++------
 BaseTools/Source/C/Makefiles/ms.common       |  6 ++++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 27aa28b..e034da2 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -29,18 +29,18 @@ BUILD_LD ?= ld
 LINKER ?= $(BUILD_CC)
 ifeq ($(HOST_ARCH), IA32)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
-endif
 
-ifeq ($(HOST_ARCH), X64)
+else ifeq ($(HOST_ARCH), X64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
-endif
 
-ifeq ($(HOST_ARCH), ARM)
+else ifeq ($(HOST_ARCH), ARM)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
-endif
 
-ifeq ($(HOST_ARCH), AARCH64)
+else ifeq ($(HOST_ARCH), AARCH64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/
+
+else
+$(error Bad HOST_ARCH)
 endif
 
 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 
diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/Makefiles/ms.common
index a6bfea5..d23308c 100644
--- a/BaseTools/Source/C/Makefiles/ms.common
+++ b/BaseTools/Source/C/Makefiles/ms.common
@@ -42,14 +42,16 @@ BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win32
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win32
 SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
-!ENDIF
 
-!IF "$(HOST_ARCH)"=="X64"
+!ELSEIF "$(HOST_ARCH)"=="X64"
 ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
 BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win64
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win64
 SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
+
+!ELSE
+!ERROR "Bad HOST_ARCH"
 !ENDIF
 
 CC = cl.exe
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
  2018-01-09  2:34           ` Chema Gonzalez
@ 2018-01-24  1:17             ` Chema Gonzalez
  2018-01-24  1:44               ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Chema Gonzalez @ 2018-01-24  1:17 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel@lists.01.org

Hi Liming,

Any news on this patch?

Thanks.
-Chema


On Mon, Jan 8, 2018 at 6:34 PM, Chema Gonzalez <chema@berkeley.edu> wrote:
> Done.
>
> -Chema
>
>
> On Mon, Jan 8, 2018 at 5:42 PM, Gao, Liming <liming.gao@intel.com> wrote:
>> Chema:
>>   Sorry for late response. I think the change is good. For windows and gcc, how about use the same error message for the unknown or unsupported arch?
>>
>> +else
>> +$(error Bad HOST_ARCH)
>> endif
>>
>> +!ELSE
>> +!ERROR "Unknown HOST_ARCH variable"
>>  !ENDIF
>>
>> Thanks
>> Liming
>>>-----Original Message-----
>>>From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema
>>>Gonzalez
>>>Sent: Friday, January 05, 2018 3:48 AM
>>>To: Gao, Liming <liming.gao@intel.com>
>>>Cc: edk2-devel@lists.01.org
>>>Subject: Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>>>C Makefile (#122)
>>>
>>>Added similar changes to `BaseTools/Source/C/Makefiles/header.makefile`.
>>>
>>>Thanks,
>>>-Chema
>>>
>>>
>>>On Fri, Dec 29, 2017 at 7:17 AM, Gao, Liming <liming.gao@intel.com> wrote:
>>>> I suggest GNUmakefile also adds this condition to report error message if
>>>HOST_ARCH is not set correctly.
>>>>
>>>>> -----Original Message-----
>>>>> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of
>>>Chema Gonzalez
>>>>> Sent: Friday, December 29, 2017 6:19 AM
>>>>> To: edk2-devel@lists.01.org
>>>>> Cc: Gao, Liming <liming.gao@intel.com>
>>>>> Subject: Fwd: FW: [tianocore/edk2] BaseTools: Barf on unknown
>>>HOST_ARCH in C Makefile (#122)
>>>>>
>>>>> Sure.
>>>>>
>>>>> Thanks,
>>>>> -Chema
>>>>>
>>>>> ---------- Forwarded message ----------
>>>>> From: Gao, Liming <liming.gao@intel.com>
>>>>> Date: Wed, Dec 27, 2017 at 5:48 PM
>>>>> Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
>>>>> C Makefile (#122)
>>>>> To: "chemag@gmail.com" <chemag@gmail.com>
>>>>>
>>>>>
>>>>> Could you send patch to edk2-devel@lists.01.org?
>>>>>
>>>>>
>>>>>
>>>>> From: chemag [mailto:notifications@github.com]
>>>>> Sent: Thursday, December 28, 2017 9:26 AM
>>>>> To: tianocore/edk2 <edk2@noreply.github.com>
>>>>> Cc: Subscribed <subscribed@noreply.github.com>
>>>>> Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
>>>>> Makefile (#122)
>>>>>
>>>>>
>>>>>
>>>>> I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
>>>>> is different from the MS one ("X64").
>>>>>
>>>>> It is not clear anyway we can proceed without valid build variables
>>>>> (ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
>>>>> SYS_LIB_PATH).
>>>>>
>>>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>>>> Signed-off-by: Chema Gonzalez chemag@gmail.com
>>>>>
>>>>> ________________________________
>>>>>
>>>>> You can view, comment on, or merge this pull request online at:
>>>>>
>>>>>   https://github.com/tianocore/edk2/pull/122
>>>>>
>>>>> Commit Summary
>>>>>
>>>>> BaseTools: Barf on unknown HOST_ARCH in C Makefile
>>>>>
>>>>> File Changes
>>>>>
>>>>> M BaseTools/Source/C/Makefiles/ms.common (6)
>>>>>
>>>>> Patch Links:
>>>>>
>>>>> https://github.com/tianocore/edk2/pull/122.patch
>>>>> https://github.com/tianocore/edk2/pull/122.diff
>>>>>
>>>>> —
>>>>> You are receiving this because you are subscribed to this thread.
>>>>> Reply to this email directly, view it on GitHub, or mute the thread.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
  2018-01-24  1:17             ` Chema Gonzalez
@ 2018-01-24  1:44               ` Gao, Liming
  0 siblings, 0 replies; 7+ messages in thread
From: Gao, Liming @ 2018-01-24  1:44 UTC (permalink / raw)
  To: Chema Gonzalez; +Cc: edk2-devel@lists.01.org

The patch looks good. I will help push it. Thanks!

> -----Original Message-----
> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema Gonzalez
> Sent: Wednesday, January 24, 2018 9:18 AM
> To: Gao, Liming <liming.gao@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)
> 
> Hi Liming,
> 
> Any news on this patch?
> 
> Thanks.
> -Chema
> 
> 
> On Mon, Jan 8, 2018 at 6:34 PM, Chema Gonzalez <chema@berkeley.edu> wrote:
> > Done.
> >
> > -Chema
> >
> >
> > On Mon, Jan 8, 2018 at 5:42 PM, Gao, Liming <liming.gao@intel.com> wrote:
> >> Chema:
> >>   Sorry for late response. I think the change is good. For windows and gcc, how about use the same error message for the
> unknown or unsupported arch?
> >>
> >> +else
> >> +$(error Bad HOST_ARCH)
> >> endif
> >>
> >> +!ELSE
> >> +!ERROR "Unknown HOST_ARCH variable"
> >>  !ENDIF
> >>
> >> Thanks
> >> Liming
> >>>-----Original Message-----
> >>>From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of Chema
> >>>Gonzalez
> >>>Sent: Friday, January 05, 2018 3:48 AM
> >>>To: Gao, Liming <liming.gao@intel.com>
> >>>Cc: edk2-devel@lists.01.org
> >>>Subject: Re: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
> >>>C Makefile (#122)
> >>>
> >>>Added similar changes to `BaseTools/Source/C/Makefiles/header.makefile`.
> >>>
> >>>Thanks,
> >>>-Chema
> >>>
> >>>
> >>>On Fri, Dec 29, 2017 at 7:17 AM, Gao, Liming <liming.gao@intel.com> wrote:
> >>>> I suggest GNUmakefile also adds this condition to report error message if
> >>>HOST_ARCH is not set correctly.
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: chemag@gmail.com [mailto:chemag@gmail.com] On Behalf Of
> >>>Chema Gonzalez
> >>>>> Sent: Friday, December 29, 2017 6:19 AM
> >>>>> To: edk2-devel@lists.01.org
> >>>>> Cc: Gao, Liming <liming.gao@intel.com>
> >>>>> Subject: Fwd: FW: [tianocore/edk2] BaseTools: Barf on unknown
> >>>HOST_ARCH in C Makefile (#122)
> >>>>>
> >>>>> Sure.
> >>>>>
> >>>>> Thanks,
> >>>>> -Chema
> >>>>>
> >>>>> ---------- Forwarded message ----------
> >>>>> From: Gao, Liming <liming.gao@intel.com>
> >>>>> Date: Wed, Dec 27, 2017 at 5:48 PM
> >>>>> Subject: FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in
> >>>>> C Makefile (#122)
> >>>>> To: "chemag@gmail.com" <chemag@gmail.com>
> >>>>>
> >>>>>
> >>>>> Could you send patch to edk2-devel@lists.01.org?
> >>>>>
> >>>>>
> >>>>>
> >>>>> From: chemag [mailto:notifications@github.com]
> >>>>> Sent: Thursday, December 28, 2017 9:26 AM
> >>>>> To: tianocore/edk2 <edk2@noreply.github.com>
> >>>>> Cc: Subscribed <subscribed@noreply.github.com>
> >>>>> Subject: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C
> >>>>> Makefile (#122)
> >>>>>
> >>>>>
> >>>>>
> >>>>> I was getting HOST_ARCH set using the linux arch name ("x86_64"), which
> >>>>> is different from the MS one ("X64").
> >>>>>
> >>>>> It is not clear anyway we can proceed without valid build variables
> >>>>> (ARCH_INCLUDE, BIN_PATH, LIB_PATH, SYS_BIN_PATH, and
> >>>>> SYS_LIB_PATH).
> >>>>>
> >>>>> Contributed-under: TianoCore Contribution Agreement 1.1
> >>>>> Signed-off-by: Chema Gonzalez chemag@gmail.com
> >>>>>
> >>>>> ________________________________
> >>>>>
> >>>>> You can view, comment on, or merge this pull request online at:
> >>>>>
> >>>>>   https://github.com/tianocore/edk2/pull/122
> >>>>>
> >>>>> Commit Summary
> >>>>>
> >>>>> BaseTools: Barf on unknown HOST_ARCH in C Makefile
> >>>>>
> >>>>> File Changes
> >>>>>
> >>>>> M BaseTools/Source/C/Makefiles/ms.common (6)
> >>>>>
> >>>>> Patch Links:
> >>>>>
> >>>>> https://github.com/tianocore/edk2/pull/122.patch
> >>>>> https://github.com/tianocore/edk2/pull/122.diff
> >>>>>
> >>>>> —
> >>>>> You are receiving this because you are subscribed to this thread.
> >>>>> Reply to this email directly, view it on GitHub, or mute the thread.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-24  1:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <tianocore/edk2/pull/122@github.com>
     [not found] ` <4A89E2EF3DFEDB4C8BFDE51014F606A14E199A2D@SHSMSX104.ccr.corp.intel.com>
2017-12-28 22:18   ` FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122) Chema Gonzalez
2017-12-29 15:17     ` Gao, Liming
2018-01-04 19:47       ` Chema Gonzalez
2018-01-09  1:42         ` Gao, Liming
2018-01-09  2:34           ` Chema Gonzalez
2018-01-24  1:17             ` Chema Gonzalez
2018-01-24  1:44               ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox