Skip to contentSkip to conversation

RMC: Support x32 build

PATCH In review [email protected] 4 participants 7 messages Jul 6, 2017 – Jul 7, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 RMC: Support x32 build

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)
Makefile.efi +3 -0
index 4f69dfe..95e0f8c 100644
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib  -fno-builtin -std=gnu90
 
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32 
+CC := $(patsubst -mx32, -m64, $(CC))
+
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c
Signature · 1 line
2.7.4
#1 lore raw
Quoted 14 lines · On Wed, 2017-07-05 at 12:39 -0700, [email protected] wrote:

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)
Makefile.efi +0 -0
index 4f69dfe..95e0f8c 100644

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 21

Quoted 6 lines
Makefile.efi +3 -0
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib  -fno-builtin -std=gnu90
 
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32 
+CC := $(patsubst -mx32, -m64, $(CC))
+

Since this is not an RMC-specific problem, I believe that we shouldn't patch the compiler flags in the RMC Makefile. This patch will provide the desired outcome only when RMC is built with meta-intel. A better alternative will be to split rmc.bb into rmc.bb (userspace app) and rmc-efi.bb (efi library) and modify the compiler flags for each recipe. I will send a patch that does this.

Todor

Quoted 3 lines
Makefile.efi +0 -0
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c
#2 lore raw
Quoted 16 lines · Todor Minchev
Quoted 15 lines · On Wed, 2017-07-05 at 12:39 -0700, [email protected] wrote:

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)
Makefile.efi +0 -0
index 4f69dfe..95e0f8c 100644
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
Quoted 6 lines

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 21

Quoted 5 lines
Makefile.efi +3 -0
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib  -fno-builtin -std=gnu90
 
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32
+CC := $(patsubst -mx32, -m64, $(CC))
+

does this mean package is overriding CC passed from env ? if yes then I think app should be fixed to respect CC if set in env and only set it if CC env is not set

Quoted 19 lines

Since this is not an RMC-specific problem, I believe that we shouldn't patch the compiler flags in the RMC Makefile. This patch will provide the desired outcome only when RMC is built with meta-intel. A better alternative will be to split rmc.bb into rmc.bb (userspace app) and rmc-efi.bb (efi library) and modify the compiler flags for each recipe. I will send a patch that does this.

Todor

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 24

Quoted 3 lines
Makefile.efi +0 -0
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#3 lore raw
Quoted 20 lines · Khem Raj
Quoted 18 lines · Todor Minchev
Quoted 17 lines · On Wed, 2017-07-05 at 12:39 -0700, [email protected] wrote:

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)
Makefile.efi +0 -0
index 4f69dfe..95e0f8c 100644
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib  -fno-builtin -std=gnu90
 
Quoted 8 lines
Quoted 4 lines

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 21

Quoted 3 lines
Makefile.efi +3 -0
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32
+CC := $(patsubst -mx32, -m64, $(CC))
+

does this mean package is overriding CC passed from env ? if yes then I think app should be fixed to respect CC if set in env and only set it if CC env is not set

+1

The app respects both CC and CFLAGS from the env. They have to be set to the correct values before the Makefile is called.

Quoted 20 lines
Quoted 20 lines

Since this is not an RMC-specific problem, I believe that we shouldn't patch the compiler flags in the RMC Makefile. This patch will provide the desired outcome only when RMC is built with meta-intel. A better alternative will be to split rmc.bb into rmc.bb (userspace app) and rmc-efi.bb (efi library) and modify the compiler flags for each recipe. I will send a patch that does this.

Todor

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 24

Quoted 3 lines
Makefile.efi +0 -0
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#4 lore raw
Quoted 26 lines · Todor Minchev
Quoted 25 lines · Khem Raj
Quoted 22 lines · Todor Minchev
Quoted 20 lines · On Wed, 2017-07-05 at 12:39 -0700, [email protected] wrote:

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)
Makefile.efi +3 -0
index 4f69dfe..95e0f8c 100644
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib  -fno-builtin -std=gnu90
 
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32
+CC := $(patsubst -mx32, -m64, $(CC))
+
Quoted 16 lines
Quoted 3 lines

does this mean package is overriding CC passed from env ? if yes then I think app should be fixed to respect CC if set in env and only set it if CC env is not set

+1

The app respects both CC and CFLAGS from the env. They have to be set to the correct values before the Makefile is called.

Quoted 7 lines
Quoted 7 lines

Since this is not an RMC-specific problem, I believe that we shouldn't patch the compiler flags in the RMC Makefile. This patch will provide the desired outcome only when RMC is built with meta-intel. A better alternative will be to split rmc.bb into rmc.bb (userspace app) and rmc-efi.bb (efi library) and modify the compiler flags for each recipe. I will send a patch that does this.

This patch should fix the x32 builds.

https://lists.yoctoproject.org/pipermail/meta-intel/2017-July/004818.html

--Todor

Quoted 13 lines
Quoted 11 lines
Quoted 11 lines

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 24

Quoted 4 lines
Makefile.efi +0 -0
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#5 lore raw
Quoted 44 lines · Todor
Quoted 26 lines · Todor Minchev
Quoted 25 lines · Khem Raj
Quoted 22 lines · Todor Minchev
Quoted 20 lines · On Wed, 2017-07-05 at 12:39 -0700, [email protected] wrote:

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)
Makefile.efi +3 -0
index 4f69dfe..95e0f8c 100644
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib  -fno-builtin -std=gnu90
 
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32
+CC := $(patsubst -mx32, -m64, $(CC))
+
Quoted 16 lines
Quoted 3 lines

does this mean package is overriding CC passed from env ? if yes then I think app should be fixed to respect CC if set in env and only set it if CC env is not set

+1

The app respects both CC and CFLAGS from the env. They have to be set to the correct values before the Makefile is called.

Quoted 7 lines
Quoted 7 lines

Since this is not an RMC-specific problem, I believe that we shouldn't patch the compiler flags in the RMC Makefile. This patch will provide the desired outcome only when RMC is built with meta-intel. A better alternative will be to split rmc.bb into rmc.bb (userspace app) and rmc-efi.bb (efi library) and modify the compiler flags for each recipe. I will send a patch that does this.

Quoted 4 lines

This patch should fix the x32 builds.

https://lists.yoctoproject.org/pipermail/meta-intel/2017-July/004818.html

you could use TUNE_CCARGS_remove = "xyz" instead of anonymous python

Quoted 16 lines

--Todor

Quoted 13 lines
Quoted 11 lines
Quoted 11 lines

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 24

Quoted 4 lines
Makefile.efi +0 -0
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#6 lore raw
In reply to Todor Minchev

Okay. I will drop this patch.

SweeAun

-----Original Message-----
From: Todor Minchev [mailto:[email protected]]
Sent: Friday, July 7, 2017 4:08 AM
To: Khor, Swee Aun <[email protected]>
Cc: [email protected]; Wold, Saul <[email protected]>
Subject: Re: [RMC][PATCH v2] RMC: Support x32 build

Quoted 13 lines · On Wed, 2017-07-05 at 12:39 -0700, [email protected] wrote:

From: sweeaun <[email protected]>

RMC efi is needed to compiled as 64 bits even DEFAULTTUNE is x32.

---
 Makefile.efi | 3 +++
 1 file changed, 3 insertions(+)

Makefile.efi RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/ · line 21

Quoted 7 lines
Makefile.efi +3 -1
@@ -16,6 +16,9 @@ RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
 
 RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc 
-nostdlib  -fno-builtin -std=gnu90
 
+#RMC efi is needed to be compiled as 64 bit even DEFAULTTUNE is x32 
+CC := $(patsubst -mx32, -m64, $(CC))
+

Since this is not an RMC-specific problem, I believe that we shouldn't patch the compiler flags in the RMC Makefile. This patch will provide the desired outcome only when RMC is built with meta-intel. A better alternative will be to split rmc.bb into rmc.bb (userspace app) and rmc-efi.bb (efi library) and modify the compiler flags for each recipe. I will send a patch that does this.

Todor

Quoted 3 lines
Makefile.efi +0 -0
 all: librmcefi
 
 $(RMC_LIB_OBJ): %.efi.o: %.c