Skip to contentSkip to conversation

h8300: Don't set CROSS_COMPILE unconditionally

PATCH Applied Javier Martinez Canillas 2 participants 3 messages Oct 16, 2015 – Oct 21, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 h8300: Don't set CROSS_COMPILE unconditionally

The h8300 architecture Makefile sets the CROSS_COMPILE variable to "h8300-unknown-linux-" unconditionally but doing that prevents the variable to be used if a toolchain with a different binary name is installed in the machine.

So only set CROSS_COMPILE to that default if the variable has not been set by the user before.

---

Hello,

After $SUBJECT, I'm able to build using the toolchain installed by my Linux distribution but the linker gives me an error about an unrecognised emulation mode:

h8300-linux-gnu-ld: unrecognised emulation mode: h8300helf_linux

I see that h8300helf_linux and 8300self_linux are hardcoded in the Makefile as well and these are not listed as supported emulations:

Supported emulations: h8300elf h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf

I tried changing -mh8300helf_linux for -mh8300helf that is listed as a supported emulation but then I got the following error:

h8300-linux-gnu-ld: cannot open linker script file ldscripts/h8300helf.xr: No such file or directory

Best regards,
Javier

 arch/h8300/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/h8300/Makefile +2 -0
index 0d2d96e52d9f..e1c02ca230cb 100644
@@ -22,7 +22,9 @@ KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 KBUILD_AFLAGS += $(aflags-y)
 LDFLAGS += $(ldflags-y)
 
+ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := h8300-unknown-linux-
+endif
 
 core-y	+= arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
 ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
Signature · 1 line
2.4.3
#1 lore raw
Quoted 24 lines · Javier Martinez Canillas

The h8300 architecture Makefile sets the CROSS_COMPILE variable to "h8300-unknown-linux-" unconditionally but doing that prevents the variable to be used if a toolchain with a different binary name is installed in the machine.

So only set CROSS_COMPILE to that default if the variable has not been set by the user before.

---

Hello,

After $SUBJECT, I'm able to build using the toolchain installed by my Linux distribution but the linker gives me an error about an unrecognised emulation mode:

h8300-linux-gnu-ld: unrecognised emulation mode: h8300helf_linux

I see that h8300helf_linux and 8300self_linux are hardcoded in the Makefile as well and these are not listed as supported emulations:

Quoted 7 lines

Supported emulations: h8300elf h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf

I tried changing -mh8300helf_linux for -mh8300helf that is listed as a supported emulation but then I got the following error:

h8300-linux-gnu-ld: cannot open linker script file ldscripts/h8300helf.xr: No such file or directory

h8300-linux is alias of h8300-*-elf.
kernel building toolchain is h8300-*-linux.

h8300-*-linux toolchain is already merged for trunk.
But not include latest release.
Backported patch is https://osdn.jp/projects/uclinux-h8/releases/p14625

Quoted 23 lines

Best regards,
Javier

 arch/h8300/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/h8300/Makefile +2 -0
index 0d2d96e52d9f..e1c02ca230cb 100644
@@ -22,7 +22,9 @@ KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 KBUILD_AFLAGS += $(aflags-y)
 LDFLAGS += $(ldflags-y)
 
+ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := h8300-unknown-linux-
+endif
 
 core-y	+= arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
 ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
Signature · 1 line
2.4.3

Applied.
Thanks.

Signature · 2 lines
Yoshinori Sato
<[email protected]>
#2 lore raw

Hello Yoshinori,

Quoted 34 lines · Yoshinori Sato
Quoted 24 lines · Javier Martinez Canillas

The h8300 architecture Makefile sets the CROSS_COMPILE variable to "h8300-unknown-linux-" unconditionally but doing that prevents the variable to be used if a toolchain with a different binary name is installed in the machine.

So only set CROSS_COMPILE to that default if the variable has not been set by the user before.

---

Hello,

After $SUBJECT, I'm able to build using the toolchain installed by my Linux distribution but the linker gives me an error about an unrecognised emulation mode:

h8300-linux-gnu-ld: unrecognised emulation mode: h8300helf_linux

I see that h8300helf_linux and 8300self_linux are hardcoded in the Makefile as well and these are not listed as supported emulations:

Quoted 7 lines

Supported emulations: h8300elf h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf

I tried changing -mh8300helf_linux for -mh8300helf that is listed as a supported emulation but then I got the following error:

h8300-linux-gnu-ld: cannot open linker script file ldscripts/h8300helf.xr: No such file or directory

Quoted 7 lines

h8300-linux is alias of h8300-*-elf.
kernel building toolchain is h8300-*-linux.

h8300-*-linux toolchain is already merged for trunk.
But not include latest release.
Backported patch is https://osdn.jp/projects/uclinux-h8/releases/p14625

I see, thanks a lot for the information.

Quoted 18 lines
Quoted 18 lines

Best regards,
Javier

 arch/h8300/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/h8300/Makefile +2 -0
index 0d2d96e52d9f..e1c02ca230cb 100644
@@ -22,7 +22,9 @@ KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 KBUILD_AFLAGS += $(aflags-y)
 LDFLAGS += $(ldflags-y)
 
+ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := h8300-unknown-linux-
+endif
 
Quoted 9 lines
Quoted 5 lines
arch/h8300/Makefile +0 -0
 core-y	+= arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
 ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
Signature · 1 line
2.4.3

Applied.
Thanks.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America