Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: pass CGO_FLAGS to C compiler when compiling _cgo_main.c or gccgo #23323

Open
conradoplg opened this issue Jan 3, 2018 · 7 comments
Open
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@conradoplg
Copy link
Contributor

I'm unable to compile go-sqlite3 with gccgo for the PowerPC plataform.

What version of Go are you using (go version)?

go version go1.8.3 gccgo (Ubuntu 7.2.0-8ubuntu3) 7.2.0 linux/amd64

Does this issue reproduce with the latest release?

I have not tested with the latest since the above is the highest version available as pre-compiled package in Ubuntu

What operating system and processor architecture are you using (go env)?

Cross-compiling to ppc with gccgo

GOARCH="ppc"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr"
GOTOOLDIR="/usr/lib/gcc/x86_64-linux-gnu/7"
GCCGO="/usr/bin/powerpc-linux-gnuspe-gccgo"
CC="powerpc-fsl-linux-gnuspe-gcc"
GOGCCFLAGS="-m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build540675113=/tmp/go-build -gno-record-gcc-switches"
CXX="powerpc-fsl-linux-gnuspe-g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="--sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"

C compiler:

powerpc-fsl-linux-gnuspe-gcc --version
powerpc-fsl-linux-gnuspe-gcc (GCC) 4.9.2

What did you do?

Attempt to install go-sqlite3:

GCCGO=powerpc-linux-gnuspe-gccgo CGO_ENABLED=1 GOARCH=ppc CGO_ENABLED=1 go-7 get -x github.com/mattn/go-sqlite3

What did you expect to see?

Package compiling

What did you see instead?

Compilation fails with

In file included from cgo-c-prolog-gccgo:1:0:
/opt/fsl/2.0/sysroots/x86_64-fslsdk-linux/usr/lib/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.9.2/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.

The compiler I'm using requires some flags to work, in particular the --sysroot flag. This is specified in the CC variable which currently is:

powerpc-fsl-linux-gnuspe-gcc -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe

The above works with the older go version go1.4.2 gccgo (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 linux/amd64. However, with the version indicated above, the compilation fails because go does not include the flags specified in the CC variable. I managed to work around this by setting CGO_CFLAGS and CGO_LDFLAGS, as can be viewed above. However, I still get a compilation error, because apparently gccgo (or cgo?) is not including the CGO_CFLAGS when compiling _cgo_defun.c as can be viewed in the verbose output below:

GCCGO=powerpc-linux-gnuspe-gccgo CGO_ENABLED=1 GOARCH=ppc CGO_ENABLED=1 go-7 get -x github.com/mattn/go-sqlite3
cd .
git clone https://github.com/mattn/go-sqlite3 /go/src/github.com/mattn/go-sqlite3
cd /go/src/github.com/mattn/go-sqlite3
git submodule update --init --recursive
cd /go/src/github.com/mattn/go-sqlite3
git show-ref
cd /go/src/github.com/mattn/go-sqlite3
git submodule update --init --recursive
cd .
git clone https://go.googlesource.com/net /go/src/golang.org/x/net
cd /go/src/golang.org/x/net
git submodule update --init --recursive
cd /go/src/golang.org/x/net
git show-ref
cd /go/src/golang.org/x/net
git submodule update --init --recursive
WORK=/tmp/go-build601413480
mkdir -p $WORK/golang.org/x/net/context/_obj/
mkdir -p $WORK/golang.org/x/net/
cd /go/src/golang.org/x/net/context
/usr/bin/powerpc-linux-gnuspe-gccgo -I $WORK -c -g -fgo-pkgpath=golang.org/x/net/context -fgo-relative-import-path=_/go/src/golang.org/x/net/context -o $WORK/golang.org/x/net/context/_obj/_go_.o ./context.go ./go17.go ./pre_go19.go
ar rc $WORK/golang.org/x/net/libcontext.a $WORK/golang.org/x/net/context/_obj/_go_.o
mkdir -p /go/pkg/gccgo_linux_ppc/golang.org/x/net/
cp $WORK/golang.org/x/net/libcontext.a /go/pkg/gccgo_linux_ppc/golang.org/x/net/libcontext.a
mkdir -p $WORK/github.com/mattn/go-sqlite3/_obj/
mkdir -p $WORK/github.com/mattn/
cd /go/src/github.com/mattn/go-sqlite3
CGO_LDFLAGS="--sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe" "-Wl,-O1" "-Wl,--hash-style=gnu" "-Wl,--as-needed" "-ldl" /usr/lib/gcc/x86_64-linux-gnu/7/cgo -objdir $WORK/github.com/mattn/go-sqlite3/_obj/ -importpath github.com/mattn/go-sqlite3 -gccgo -gccgopkgpath=github.com/mattn/go-sqlite3 -- -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. backup.go callback.go error.go sqlite3.go sqlite3_context.go sqlite3_load_extension.go sqlite3_other.go sqlite3_type.go
cd $WORK
powerpc-fsl-linux-gnuspe-gcc -fdebug-prefix-map=a=b -c trivial.c
powerpc-fsl-linux-gnuspe-gcc -gno-record-gcc-switches -c trivial.c
cd /go/src/github.com/mattn/go-sqlite3
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_export.o -c $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_export.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/backup.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/backup.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/callback.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/callback.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/error.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/error.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_context.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_context.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_load_extension.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_load_extension.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_other.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_other.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_type.cgo2.o -c $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3_type.cgo2.c
powerpc-fsl-linux-gnuspe-gcc -I . -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/mattn/go-sqlite3/_obj/ -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/opt/fsl/2.0/sysroots/ppce500v2-fsl-linux-gnuspe -O2 -pipe -g -feliminate-unused-debug-types -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_DISABLE_INTRINSIC -Wno-deprecated-declarations -I. -o $WORK/github.com/mattn/go-sqlite3/_obj/sqlite3-binding.o -c ./sqlite3-binding.c
powerpc-fsl-linux-gnuspe-gcc -Wall -g -I $WORK/github.com/mattn/go-sqlite3/_obj/ -I /usr/pkg/include -o $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_defun.o -D GOOS_linux -D GOARCH_ppc -D "GOPKGPATH=\"github_com_mattn_go_sqlite3\"" -c $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_defun.c
# github.com/mattn/go-sqlite3
In file included from cgo-c-prolog-gccgo:1:0:
/opt/fsl/2.0/sysroots/x86_64-fslsdk-linux/usr/lib/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.9.2/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.

Observe that the last compiler invocation did not include the contents of CGO_CFLAGS, preventing --sysroot being passed which messes the include path and makes compilation fail.

@gopherbot gopherbot added this to the Gccgo milestone Jan 3, 2018
@odeke-em odeke-em changed the title gccgo: cgo is not respecting CGO_FLAGS cmd/cgo: gccgo doesn't seem to be respecting CGO_FLAGS Jan 7, 2018
@odeke-em
Copy link
Member

odeke-em commented Jan 7, 2018

/cc @ianlancetaylor @hirochachacha

@hirochachacha
Copy link
Contributor

Maybe

diff --git a/src/cmd/go/internal/work/gccgo.go b/src/cmd/go/internal/work/gccgo.go
index 37a828f592..74d3820a66 100644
--- a/src/cmd/go/internal/work/gccgo.go
+++ b/src/cmd/go/internal/work/gccgo.go
@@ -464,8 +464,11 @@ func (tools gccgoToolchain) cc(b *Builder, a *Action, ofile, cfile string) error
                defs = append(defs, "-fsplit-stack")
        }
        defs = tools.maybePIC(defs)
-       return b.run(a, p.Dir, p.ImportPath, nil, envList("CC", cfg.DefaultCC(cfg.Goos, cfg.Goarch)), "-Wall", "-g",
-               "-I", a.Objdir, "-I", inc, "-o", ofile, defs, "-c", cfile)
+       return b.run(a, p.Dir, p.ImportPath, nil,
+               envList("CC", cfg.DefaultCC(cfg.Goos, cfg.Goarch)),
+               envList("CGO_CPPFLAGS", ""),
+               envList("CGO_CFLAGS", "-Wall -g"), "-I", a.Objdir, "-I", inc, "-o", ofile, defs, "-c", cfile,
+       )
 }

 // maybePIC adds -fPIC to the list of arguments if needed..

I don't have a test environment.

@ianlancetaylor
Copy link
Contributor

That suggestion isn't exactly right, as we should also be using the package local #cgo CFLAGS: when compiling _cgo_defun.c.

@ianlancetaylor ianlancetaylor changed the title cmd/cgo: gccgo doesn't seem to be respecting CGO_FLAGS cmd/go: pass CGO_FLAGS to C compiler when compiling _cgo_main.c or gccgo Jan 25, 2018
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 25, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Gccgo, Go1.11 Jan 25, 2018
@Aven12
Copy link

Aven12 commented May 1, 2018

Is there a work around for this? Or just wait for Go1.11?

@ianlancetaylor
Copy link
Contributor

I think it works to add the options to the CC environment variable.

@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jul 6, 2018
@Aven12
Copy link

Aven12 commented Aug 19, 2018

The workaround for the CC environment variable does seem to work for me. Any ideas what I'm doing wrong?


root@2fe6f091a637:/mnt# echo $CC
/opt/cross/gcc --sysroot=/opt/fsl-qoriq/2.0/sysroots/ppc64e6500-fsl-linux
root@2fe6f091a637:/mnt# go env
GOARCH="ppc64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/docker-path"
GORACE=""
GOROOT="/home/go"
GOTOOLDIR="/opt/gccgo-cross/usr/libexec/gcc/x86_64-linux/7.3.0"
GCCGO="/opt/gccgo-cross/usr/bin/powerpc64-fsl-linux-gccgo"
CC="/opt/cross/gcc"
GOGCCFLAGS="--sysroot=/opt/fsl-qoriq/2.0/sysroots/ppc64e6500-fsl-linux -fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build376397185=/tmp/go-build -gno-record-gcc-switches"
CXX="/opt/gccgo-cross/usr/bin/powerpc64-fsl-linux-g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2 --sysroot=/opt/fsl-qoriq/2.0/sysroots/ppc64e6500-fsl-linux"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
root@2fe6f091a637:/mnt# go get -x github.com/mattn/go-sqlite3
WORK=/tmp/go-build361126006
mkdir -p $WORK/github.com/mattn/go-sqlite3/_obj/
mkdir -p $WORK/github.com/mattn/
cd /home/docker-path/src/github.com/mattn/go-sqlite3
CGO_LDFLAGS="-g" "-O2" "-ldl" "-lpthread" /opt/gccgo-cross/usr/libexec/gcc/x86_64-linux/7.3.0/cgo -objdir $WORK/github.com/mattn/go-sqlite3/_obj/ -importpath github.com/mattn/go-sqlite3 -gccgo -gccgopkgpath=github.com/mattn/go-sqlite3 -- -I $WORK/github.com/mattn/go-sqlite3/_obj/ -g -O2 --sysroot=/opt/fsl-qoriq/2.0/sysroots/ppc64e6500-fsl-linux -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_OMIT_DEPRECATED -DSQLITE_DISABLE_INTRINSIC -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -Wno-deprecated-declarations -DHAVE_PREAD64=1 -DHAVE_PWRITE64=1 -I. backup.go callback.go error.go sqlite3.go sqlite3_context.go sqlite3_load_extension.go sqlite3_opt_userauth_omit.go sqlite3_other.go sqlite3_type.go
# github.com/mattn/go-sqlite3
In file included from /home/docker-path/src/github.com/mattn/go-sqlite3/backup.go:14:0:
/opt/fsl-qoriq/2.0/sysroots/ppc64e6500-fsl-linux/usr/include/stdlib.h:30:26: error: no include path in which to search for stdlib.h
 # include_next <stdlib.h>
                          ^
root@2fe6f091a637:/mnt# 

@conradoplg
Copy link
Contributor Author

I haven't tested with newer gccgo versions, but in my original report the whole problem resulted from gccgo not using the flags specified in CC anymore, just the binary path. Maybe that's a separate bug?

@bcmills bcmills modified the milestones: Go1.12, Go1.13 Nov 15, 2018
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

9 participants