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/compile: unknown ARM relocation type 7 #38020
Comments
Can you tell us more about the program you're compiling? The particular error you're seeing is strange. There is no relocation type 7 in our codebase. |
@jordanrh1 You added the |
Hello, my project is commercial and cannot share the source code, the go mod looks like this: require ( it's a project who use serial library to send commands over the serial port. I think what you say about the different versions of Go compiler with another version of linker makes sense and i will try it immediately. I will try to reinstall everything go related. |
The serial package does use cgo, so it's possible the C toolchain is involved somehow. |
I'm perplexed. The error message seems to be coming from cmd/link/internal/loadpe/ldpe.go, but we should not be running that code on an ELF system. It's almost as though a PE object file snuck into the link somehow. Am I missing something? |
Hello again,
After i received this error i deleted the entire directory /Users/work/Library/Caches/go-build/
I run go on mac os catalina 10.15.3 on a macbook pro 15" with a i9 processor.
I confirm that the executable generated is running with no problem on my system. |
From go env output i tried to identify the gccgo and clang :
I didn't find the gccgo executable. |
Can you run |
Of course, below i paste the output: GOOS=linux GOARCH=arm GOARM=6 go build -x -o out/release/linux/arm/ProjectName WORK=/var/folders/pn/q3538lx9107cgpdvj95xzd2m0000gn/T/go-build802747127 ` |
I tried to build the same project from Windows 10 Pro within the same machine with the help of Parallels Desktop 15. I received the same error. On Windows was installed Go 1.11 but i uninstalled and installed the go1.14. Maybe this information is helpful. I will try on a freshly linux instance on parallels desktop tonight. |
Hm, that shows only the link step. It's caching all the compilations and the filling of the directories where that file must have been found. Try |
It sounds like you are doing a cross-build that includes C code, but you haven't set |
How can i set the point to a cross compiler?
Maybe my project dependencies use C code.
On Wed, 25 Mar 2020 at 8:44 PM Ian Lance Taylor ***@***.***> wrote:
It sounds like you are doing a cross-build that includes C code, but you
haven't set CC to point to a cross-compiler.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#38020 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHIE3V44JO5HKMKHOXJGDRJJGI3ANCNFSM4LRZUU7A>
.
--
Lucian Boldu
|
You need to have a C cross-compiler from your host to your target. You need exactly what you would need to build a C program for your target. When you have that, set the |
Thank You! I will try tomorrow morning and i will let you know.
On Wed, 25 Mar 2020 at 9:03 PM Ian Lance Taylor ***@***.***> wrote:
You need to have a C cross-compiler from your host to your target. You
need exactly what you would need to build a C program for your target. When
you have that, set the CC environment variable to that program when
running go build.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#38020 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHIE27ON52CWTUMSZTQ33RJJIRVANCNFSM4LRZUU7A>
.
--
Lucian Boldu
|
Hello again, % go env And i already have setup the CC and C++ apps. % clang --version % clang++ --version And i want to say that i already build for linux, windows and macos and it's working without problems. The problem is only when i choose ARM on building. If i build for windows, linux it's means that cross compiler is functional. % gccgo Maybe this is the problem. |
Missing gccgo is not a problem. The clang that you are using is not a cross-compiler. As it says: "Target: x86_64-apple-darwin19.4.0". Since you are building for ARM, you need a clang that targets an ARM processor. |
Ok i understand. Thank you
On Wed, 25 Mar 2020 at 9:30 PM Ian Lance Taylor ***@***.***> wrote:
Missing gccgo is not a problem.
The clang that you are using is not a cross-compiler. As it says: "Target:
x86_64-apple-darwin19.4.0". Since you are building for ARM, you need a
clang that targets an ARM processor.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#38020 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHIE6TMI3YOH3D5KQ3BK3RJJLV7ANCNFSM4LRZUU7A>
.
--
Lucian Boldu
|
Hello, I think the problem persists. I use Docker to run an Centos 8 ARM version (the image is located at link: https://hub.docker.com/layers/centos/library/centos/latest/images/sha256-85313b812ad747dd19cf18078795b576cc4ae9cd2ca2ccccd7b5c12722b2effd?context=explore) I download in image go version 1.14.1 ARM version from this link https://dl.google.com/go/go1.14.1.linux-arm64.tar.gz
I run yum update on centos image to be full updated. The go env contained gcc on CC anc CXX variables. I run in this way and i received the same error. After that i installed clang and updated the go variables to use it.
After that i run again the command with -a -x and i receive the same error. Maybe i do something wrong.
|
Do you have a |
Yes, it's generated by the project
https://github.com/josephspurrier/goversioninfo.
I'm using this project to embed on windows executables information about
the application version and icons.
The resource.syso is generated on every new version of the project and
after resource.syso generation is running the build script for generating
executables for every OS.
The resource.syso file is on the project root directory.
Do i need to delete the file when i generate arm build ?
…On Thu, Mar 26, 2020 at 5:26 PM Keith Randall ***@***.***> wrote:
cd /mnt/ProjectName
/usr/local/go/pkg/tool/linux_arm64/compile -o $WORK/b001/*pkg*.a
-trimpath "$WORK/b001=>" -p main -lang=go1.14 -buildid
Kw5EX4Nvp3elczpdPaAu/Kw5EX4Nvp3elczpdPaAu -goversion go1.14.1 -D ""
-importcfg $WORK/b001/importcfg -pack -c=4 ./main.go $WORK/b001/*gomod*.go
/usr/local/go/pkg/tool/linux_arm64/pack r $WORK/b001/*pkg*.a
./resource.syso # internal
Do you have a resource.syso file anywhere in your source tree? Probably
in package ProjectName? Anywhere else, like in a dependency?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#38020 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHIE43DWV3N5KBEPSLB3LRJNXZVANCNFSM4LRZUU7A>
.
--
Lucian Boldu
*** Internet Email Confidentiality Disclaimer ***
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message or responsible for
delivery of the message to such person, you may not copy or deliver this
message to anyone
|
A (@randall77 Good call.) |
I didn't know that. I modified and try again.
…On Thu, Mar 26, 2020 at 6:09 PM Ian Lance Taylor ***@***.***> wrote:
A .syso file is going to be linked in for every build. If you have a
Windows-specific .syso file, you need to name it resource_windows.syso so
that it is only included in Windows builds.
***@***.*** <https://github.com/randall77> Good call.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#38020 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHIE6K67IV5WYG7HKSKBLRJN42JANCNFSM4LRZUU7A>
.
--
Lucian Boldu
*** Internet Email Confidentiality Disclaimer ***
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message or responsible for
delivery of the message to such person, you may not copy or deliver this
message to anyone
|
Ohh my god, it's working. I modified the comment from //go:generate goversioninfo to //go:generate goversioninfo -o=resource_windows.syso and everything works like it used to. |
Happy to help. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried to build an ARM version from a project made with version go1.11. In go1.11 everything worked well.Until i moved to go1.14 i released 3 ARM versions compiled with go1.11.
What did you expect to see?
An compiled ARM version 6 of my project build with command:
GOOS=linux GOARCH=arm GOARM=6 go build -o out/release/linux/arm/
What did you see instead?
I receive this error when i run the command below:
GOOS=linux GOARCH=arm GOARM=6 go build -o out/release/linux/arm/
/Users/work/Library/Caches/go-build/f1/f1abdf46b4e5bb946645d1d2602052a096e3abf0af23ba23a1f90dd443051323-d(resource.syso): main(.rsrc)<153>: unknown ARM relocation type 7
This exact error i received with every go version lower than 1.14 until 1.11.
The text was updated successfully, but these errors were encountered: