LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-08-2022, 12:27 PM   #1
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Rep: Reputation: 20
runc from slackbuilds.org does not build on Slackware 15.0


I always had issues with building runc on slackware post 14.2 current. But also the new script for Slackware 15.0 still fails.

Code:
runc-1.0.2/vendor/modules.txt
go build -trimpath "-mod=vendor" "-buildmode=pie"  -tags "seccomp" -ldflags "-X main.gitCommit=12644e614e25b05da6fd08a38ffa0cfe1903fdec -X main.version=1.0.2 " -o runc .
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# github.com/opencontainers/runc
/usr/bin/ld: $WORK/b001/_pkg1_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: $WORK/b001/_pkg2_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: $WORK/b001/_pkg3_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
collect2: Fehler: ld gab 1 als Ende-Status zurück
make: *** [Makefile:34: runc] Fehler 2
 
Old 04-08-2022, 01:55 PM   #2
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 594

Rep: Reputation: Disabled
This works for me on 15.0 without error: https://slackware.uk/people/alien/sl...ds/runc/build/
It is for runc-1.0.3 whereas SBo has 1.0.2 but the bump in 'microversion' should not make such a big difference.

But I think this is your real issue:
Code:
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
Either you forgot to install google-go-lang, or you did not logout/login after installing it.
 
Old 04-09-2022, 12:50 PM   #3
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Windu View Post
Either you forgot to install google-go-lang, or you did not logout/login after installing it.
No, I made sure that google-go-lang is installed and even after rebooting my computer I get the same error.
 
Old 04-09-2022, 12:55 PM   #4
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Windu View Post
This works for me on 15.0 without error: https://slackware.uk/people/alien/sl...ds/runc/build/
I get the exact same issue with alien's script
 
Old 04-09-2022, 12:58 PM   #5
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 594

Rep: Reputation: Disabled
What 'go' is foremost in your $PATH ?

If it is google's go then you would see:
Code:
$ go version
go version go1.17.5 linux/amd64
But if you invoke GCC go:
Code:
$ go version
go version go1.16.5 gccgo (GCC) 11.2.0 linux/amd64
The Google version of go should be placed first in your $PATH by the profile script "/etc/profile.d/go.sh" which should be executable... and you would have to be running a Bash-compatible shell of course. There's also "/etc/profile.d/go.csh" if you use a C-shell compatible shell.
 
Old 04-09-2022, 01:03 PM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
also, when you build scripts from SlackBuilds.org, you should do it in a root login shell or, as user, becoming root with "su -" (note the trailing slash) or it won't source the scripts in /etc/profile.d: it's explained in the HOWTO (at step 4) and it's also explained in google-go-lang's README.

Last edited by ponce; 04-09-2022 at 01:07 PM.
 
Old 04-09-2022, 01:09 PM   #7
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Original Poster
Rep: Reputation: 20
Ok, I get the same issue with all go programs... They always try to use gccgo and not go. Even when I move gccgo they try to is it instead of go. Rebooting or logging in and out again does not solve. Rebuilding google-go-lang does also not help
 
Old 04-09-2022, 01:11 PM   #8
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ponce View Post
also, when you build scripts from SlackBuilds.org, you should do it in a root login shell or, as user, becoming root with "su -" (note the trailing slash) or it won't source the scripts in /etc/profile.d: it's explained in the HOWTO (at step 4) and it's also explained in google-go-lang's README.
I know and did that
 
Old 04-09-2022, 01:13 PM   #9
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Windu View Post
What 'go' is foremost in your $PATH ?

But if you invoke GCC go:
Code:
$ go version
go version go1.16.5 gccgo (GCC) 11.2.0 linux/amd64
This is indeed what I see
Quote:
Originally Posted by Windu View Post
The Google version of go should be placed first in your $PATH by the profile script "/etc/profile.d/go.sh" which should be executable... and you would have to be running a Bash-compatible shell of course. There's also "/etc/profile.d/go.csh" if you use a C-shell compatible shell.
After running this script, which does exist and is executable I still see:
Code:
$ go version
go version go1.16.5 gccgo (GCC) 11.2.0 linux/amd64
 
Old 04-09-2022, 01:20 PM   #10
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ponce View Post
... (note the trailing slash)
OK, I have to apologize it seemed that I indeed forgot to add the trailing slash. Sorry about that and thanks for reminding me
 
Old 04-09-2022, 02:04 PM   #11
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
Quote:
Originally Posted by M0M0 View Post
OK, I have to apologize it seemed that I indeed forgot to add the trailing slash. Sorry about that and thanks for reminding me
I wanted to write "dash" but I wrote "slash" (*facepalm*).

Quote:
Originally Posted by M0M0 View Post
After running this script, which does exist and is executable I still see:
Code:
$ go version
go version go1.16.5 gccgo (GCC) 11.2.0 linux/amd64
you shouldn't run those scripts in /etc/profile.d, you have to source them, like
Code:
. /etc/profile.d/go.sh
or
Code:
source /etc/profile.d/go.sh

Last edited by ponce; 04-09-2022 at 02:06 PM.
 
Old 04-30-2022, 07:51 PM   #12
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 917

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by ponce View Post
...., you have to source them, like
Code:
. /etc/profile.d/go.sh
or
Code:
source /etc/profile.d/go.sh
A line like that {c,sh}ould be included early the runc.SlackBuild to avoid the problem.

chris
 
Old 04-30-2022, 11:40 PM   #13
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 917

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Further to the need to source /etc/profile.d/go.sh, it would be really helpful if any SlackBuild which requires go, either directly or indirectly through some other dependency, were to have a line something like:
Code:
[ -z "$GOROOT" ] && source /etc/profile.d/go.sh
I see there's no go-template.SlackBuild available at SBo and I don't know enough about go based packaging to know if it makes sense to have such a thing. If so, I'd like to see a check like that included.

chris
 
2 members found this post helpful.
Old 05-10-2024, 03:34 PM   #14
tasty_donut
LQ Newbie
 
Registered: May 2024
Posts: 2

Rep: Reputation: 0
Thumbs up runc build error Slackware 15

I was pulling my hair out with this too. I did what you said about using su with the - rather than just su and it was perfect . Thank you for the solution.
 
Old 05-10-2024, 03:37 PM   #15
tasty_donut
LQ Newbie
 
Registered: May 2024
Posts: 2

Rep: Reputation: 0
I had the same issue on Slackware 15. Was pulling my hair out and was annoyed for the whole day. Came across this post and did what was suggested about being root. Not just su but su - after doing this it was perfect. Thank you for the solution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fail to install runc package( ... for docker) mpregos Slackware 4 10-22-2017 04:55 PM
runc won't start a container jr_bob_dobbs Linux - Containers 0 09-18-2017 04:45 PM
LXer: runC: The little container engine that could LXer Syndicated Linux News 0 08-15-2016 10:01 AM
LXer: Docker 1.11 Debuts with runC, Supports IPv6 LXer Syndicated Linux News 0 04-14-2016 02:33 AM
Use SlackBuilds.org or my own hosting to offer up SlackBuilds? hollywoodb Slackware 6 11-30-2006 08:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration