diff mbox series

[2/2] go: Remove mips32r2 from march to get cgo working

Message ID 20170921174216.33386-2-raj.khem@gmail.com
State New
Headers show
Series [1/2] gstreamer1.0-libav: Fix build on mips | expand

Commit Message

Khem Raj Sept. 21, 2017, 5:42 p.m. UTC
on mips, cgo used mips32r1 and that conflicts with mips32r2
lets remove it for now and work go upstream to make it work
for golang as well

Fixes
| # runtime/cgo
| cc1: error: '-mips32r2' conflicts with the other architecture options, which specify a mips32 processor

Fixes [YOCTO #12108]

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 meta/recipes-devtools/go/go-common.inc | 4 ++++
 meta/recipes-devtools/go/go_1.9.bb     | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.14.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Richard Purdie Sept. 22, 2017, 6:24 a.m. UTC | #1
On Thu, 2017-09-21 at 10:42 -0700, Khem Raj wrote:
> on mips, cgo used mips32r1 and that conflicts with mips32r2
> lets remove it for now and work go upstream to make it work
> for golang as well
> 
> Fixes
> > 
> > # runtime/cgo
> > cc1: error: '-mips32r2' conflicts with the other architecture
> > options, which specify a mips32 processor
> Fixes [YOCTO #12108]
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-devtools/go/go-common.inc | 4 ++++
>  meta/recipes-devtools/go/go_1.9.bb     | 2 --
>  2 files changed, 4 insertions(+), 2 deletions(-)

I think this causes:

https://autobuilder.yocto.io/builders/nightly-world-lsb/builds/486/steps/BuildImages/logs/stdio

| # /tmp/go-build282041009/libstd.so
| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/work/i586-poky-linux/go-runtime/1.9-r0/go/pkg/tool/linux_amd64/link: running i586-poky-linux-gcc failed: exit status 1
| /tmp/go-link-130351246/go.o:(.data.rel.ro+0x36bfcc): undefined reference to `main.init'
| /tmp/go-link-130351246/go.o:(.data.rel.ro+0x36bfd0): undefined reference to `main.main'
| collect2: error: ld returned 1 exit status
| 
| WARNING: exit code 2 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/work/i586-poky-linux/go-runtime/1.9-r0/temp/log.do_compile.29509)
NOTE: recipe go-runtime-1.9-r0: task do_compile: Failed
ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/meta/recipes-devtools/go/go-runtime_1.9.bb:do_compile) failed with exit code '1'

Cheers,

Richard
Matt Madison Sept. 22, 2017, 1:32 p.m. UTC | #2
On Thu, Sep 21, 2017 at 10:42 AM, Khem Raj <raj.khem@gmail.com> wrote:
> on mips, cgo used mips32r1 and that conflicts with mips32r2

> lets remove it for now and work go upstream to make it work

> for golang as well


There is already someone working on expanding MIPS support for go,
based on some mailing list discussions I've seen.  Doesn't look like
the changes have made it in yet, but looked like they could for 1.10.

>

> Fixes

> | # runtime/cgo

> | cc1: error: '-mips32r2' conflicts with the other architecture options, which specify a mips32 processor

>

> Fixes [YOCTO #12108]

>

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>  meta/recipes-devtools/go/go-common.inc | 4 ++++

>  meta/recipes-devtools/go/go_1.9.bb     | 2 --

>  2 files changed, 4 insertions(+), 2 deletions(-)

>

> diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc

> index ce1eb86812..41f661bc4e 100644

> --- a/meta/recipes-devtools/go/go-common.inc

> +++ b/meta/recipes-devtools/go/go-common.inc

> @@ -20,3 +20,7 @@ B = "${S}"

>

>  INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

>  SSTATE_SCAN_CMD = "true"

> +

> +TUNE_CCARGS_remove = "-march=mips32r2"


The rework for this should probably go into goarch.bblcass, so it
applies to go packages as well as the toolchain.  The mips checks in
goarch.bbclass need some refinement anyway, since Go only supports o32
ABI and hard-float.  I can send along a patch that should cover what's
needed.

-Matt


> +SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"

> +SECURITY_LDFLAGS = ""

> diff --git a/meta/recipes-devtools/go/go_1.9.bb b/meta/recipes-devtools/go/go_1.9.bb

> index 08ab793f86..c67e2cb050 100644

> --- a/meta/recipes-devtools/go/go_1.9.bb

> +++ b/meta/recipes-devtools/go/go_1.9.bb

> @@ -1,4 +1,2 @@

>  require go-${PV}.inc

>  require go-target.inc

> -TUNE_CCARGS_remove = "-march=mips32r2"

> -SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"

>

> --

> 2.14.1

>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
index ce1eb86812..41f661bc4e 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -20,3 +20,7 @@  B = "${S}"
 
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 SSTATE_SCAN_CMD = "true"
+
+TUNE_CCARGS_remove = "-march=mips32r2"
+SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS = ""
diff --git a/meta/recipes-devtools/go/go_1.9.bb b/meta/recipes-devtools/go/go_1.9.bb
index 08ab793f86..c67e2cb050 100644
--- a/meta/recipes-devtools/go/go_1.9.bb
+++ b/meta/recipes-devtools/go/go_1.9.bb
@@ -1,4 +1,2 @@ 
 require go-${PV}.inc
 require go-target.inc
-TUNE_CCARGS_remove = "-march=mips32r2"
-SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"