Skip to contentSkip to conversation

goarch.bbclass: set SECURITY_CFLAGS for mips64

PATCH Superseded [email protected] 2 participants 5 messages Jun 13, 2018 – Jun 14, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 goarch.bbclass: set SECURITY_CFLAGS for mips64

From: Kai Kang <[email protected]>

When include conf/distro/include/security_flags.inc, NOPIE flags are still required for MIPS64 target builds. Otherwise it fails to build packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/
| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:
| relocation R_MIPS_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC`
---
 meta/classes/goarch.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/goarch.bbclass +1 -0
index f54c5169e3e..5fd9f294a8a 100644
@@ -36,6 +36,7 @@ COMPATIBLE_HOST_mipsarchn32 = "null"
 ARM_INSTRUCTION_SET = "arm"
 TUNE_CCARGS_remove = "-march=mips32r2"
 SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_CFLAGS_mips64 = "${SECURITY_NOPIE_CFLAGS}"
 SECURITY_NOPIE_CFLAGS ??= ""
 
 def go_map_arch(a, d):
Signature · 1 line
2.17.1
#1 lore raw
Quoted 21 lines · On Wed, Jun 13, 2018 at 12:16 AM <[email protected]> wrote:

From: Kai Kang <[email protected]>

When include conf/distro/include/security_flags.inc, NOPIE flags are still required for MIPS64 target builds. Otherwise it fails to build packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/
| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:
| relocation R_MIPS_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC`
---
 meta/classes/goarch.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/goarch.bbclass +0 -0
index f54c5169e3e..5fd9f294a8a 100644

meta/classes/goarch.bbclass COMPATIBLE_HOST_mipsarchn32 = "null" · line 39

Quoted 4 lines
meta/classes/goarch.bbclass +1 -0
@@ -36,6 +36,7 @@ COMPATIBLE_HOST_mipsarchn32 = "null"
 ARM_INSTRUCTION_SET = "arm"
 TUNE_CCARGS_remove = "-march=mips32r2"
 SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_CFLAGS_mips64 = "${SECURITY_NOPIE_CFLAGS}"

perhaps we should use _mipsall once

Quoted 11 lines
meta/classes/goarch.bbclass +0 -1
 SECURITY_NOPIE_CFLAGS ??= ""
 
 def go_map_arch(a, d):
--

2.17.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#2 lore raw
Quoted 16 lines · Khem Raj
Quoted 15 lines · On Wed, Jun 13, 2018 at 12:16 AM <[email protected]> wrote:

From: Kai Kang <[email protected]>

When include conf/distro/include/security_flags.inc, NOPIE flags are still required for MIPS64 target builds. Otherwise it fails to build packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/
| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:
| relocation R_MIPS_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC`
---
  meta/classes/goarch.bbclass | 1 +
  1 file changed, 1 insertion(+)
Quoted 10 lines

meta/classes/goarch.bbclass COMPATIBLE_HOST_mipsarchn32 = "null" · line 39

Quoted 9 lines
meta/classes/goarch.bbclass +1 -0
index f54c5169e3e..5fd9f294a8a 100644
@@ -36,6 +36,7 @@ COMPATIBLE_HOST_mipsarchn32 = "null"
  ARM_INSTRUCTION_SET = "arm"
  TUNE_CCARGS_remove = "-march=mips32r2"
  SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_CFLAGS_mips64 = "${SECURITY_NOPIE_CFLAGS}"

perhaps we should use _mipsall once

Hi Khem,

I don't quite follow you. It seems no such override '_mipsall' exists. Do you mean 'mipsarch' or something else? Thanks.

Regards,
Kai

Quoted 12 lines
Quoted 12 lines
meta/classes/goarch.bbclass +0 -1
  SECURITY_NOPIE_CFLAGS ??= ""
 
  def go_map_arch(a, d):
--

2.17.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
Regards,
Neil | Kai Kang
#3 lore raw
Quoted 29 lines · Kang Kai
Quoted 18 lines · Khem Raj
Quoted 17 lines · On Wed, Jun 13, 2018 at 12:16 AM <[email protected]> wrote:

From: Kai Kang <[email protected]>

When include conf/distro/include/security_flags.inc, NOPIE flags are still required for MIPS64 target builds. Otherwise it fails to build packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/

| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:

| relocation R_MIPS_26 against a local symbol' can not be used when making a shared object; recompile with -fPIC

---
  meta/classes/goarch.bbclass | 1 +

  1 file changed, 1 insertion(+)
Quoted 10 lines
Quoted 9 lines
meta/classes/goarch.bbclass +0 -0
index f54c5169e3e..5fd9f294a8a 100644
@@ -36,6 +36,7 @@ COMPATIBLE_HOST_mipsarchn32 = "null"

  ARM_INSTRUCTION_SET = "arm" TUNE_CCARGS_remove = "-march=mips32r2" SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}" +SECURITY_CFLAGS_mips64 = "${SECURITY_NOPIE_CFLAGS}"

perhaps we should use _mipsall once

Quoted 4 lines

Hi Khem,

I don't quite follow you. It seems no such override '_mipsall' exists. Do you mean 'mipsarch' or something else? Thanks.

yes mipsarch indeed.

Quoted 16 lines

Regards,
Kai

Quoted 12 lines
Quoted 12 lines

  SECURITY_NOPIE_CFLAGS ??= ""

  def go_map_arch(a, d):

Signature · 7 lines
2.17.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
author
#4 lore raw
Quoted 32 lines · Khem Raj
Quoted 29 lines · Kang Kai
Quoted 28 lines · Khem Raj
Quoted 22 lines · On Wed, Jun 13, 2018 at 12:16 AM <[email protected]> wrote:

From: Kai Kang <[email protected]>

When include conf/distro/include/security_flags.inc, NOPIE flags are still required for MIPS64 target builds. Otherwise it fails to build packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/

| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:

| relocation R_MIPS_26 against a local symbol' can not be used when making a shared object; recompile with -fPIC

---
  meta/classes/goarch.bbclass | 1 +

  1 file changed, 1 insertion(+)
meta/classes/goarch.bbclass +0 -0
index f54c5169e3e..5fd9f294a8a 100644
@@ -36,6 +36,7 @@ COMPATIBLE_HOST_mipsarchn32 = "null"
Quoted 4 lines

  ARM_INSTRUCTION_SET = "arm" TUNE_CCARGS_remove = "-march=mips32r2" SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}" +SECURITY_CFLAGS_mips64 = "${SECURITY_NOPIE_CFLAGS}"

perhaps we should use _mipsall once

Quoted 6 lines
Quoted 4 lines

Hi Khem,

I don't quite follow you. It seems no such override '_mipsall' exists. Do you mean 'mipsarch' or something else? Thanks.

yes mipsarch indeed.

Thanks. V2 will be sent.

--Kai

Quoted 18 lines
Quoted 17 lines

Regards,
Kai

Quoted 12 lines
Quoted 12 lines

  SECURITY_NOPIE_CFLAGS ??= ""

  def go_map_arch(a, d):

Signature · 7 lines
2.17.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 2 lines
Regards,
Neil | Kai Kang