-buildmode=pie not supported on riscv64

Bug #1881417 reported by Dimitri John Ledkov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
golang-1.14 (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

[impact]
-buildmode=pie not supported on riscv64

it should be, tried forcing to enable it on top of our patches, but golang toolchain failed to build (testsuire errors)

[test case]
The tests run during build should be sufficient

[regression potential]
There should be no impact away from riscv at all.

There is no standard way to probe for buildmode=pie being enabled but it's possible that a package might test for it and use it now that it's present and then encounter new bugs. But it seems very unlikely.

Revision history for this message
Joel Sing (jsing) wrote :

It is not clear what series this is on or what packages you're using. That said, the 1.14.3-2ubuntu1 packages available for groovy include external linking support and support -buildmode=pie:

$ dpkg -l | grep golang
ii golang-1.14 1.14.3-2ubuntu1 all Go programming language compiler - metapackage
ii golang-1.14-doc 1.14.3-2ubuntu1 all Go programming language - documentation
ii golang-1.14-go 1.14.3-2ubuntu1 riscv64 Go programming language compiler, linker, compiled stdlib
ii golang-1.14-src 1.14.3-2ubuntu1 riscv64 Go programming language - source files
$ go version
go version go1.14.3 linux/riscv64
$ go build -ldflags=-buildmode=pie
$ file cgo
cgo: ELF 64-bit LSB shared object, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=d8469e80723306c9291b7b117c91b5f7297b49de, for GNU/Linux 4.15.0, not stripped
$ ./cgo
Hi from cgo on linux/riscv64!

If you're still running into issues, please provide full details of the problem and how it can be reproduced.

Revision history for this message
Joel Sing (jsing) wrote :

Ah, looks like `go build -ldflags=-buildmode=pie` works but `go build -buildmode=pie` does not - will investigate further.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I think it's to do with allowing '-shared' too, no? I've tried enabling all the things. But then the build fails.

Let me paste my patches.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in golang-defaults (Ubuntu):
status: New → Confirmed
tags: added: patch
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

golang-1.14 (1.14.3-2ubuntu2) groovy; urgency=medium

  * Add one more patch from Joel Sing for riscv64.

 -- Dimitri John Ledkov <email address hidden> Tue, 02 Jun 2020 14:50:32 +0100

Changed in golang-defaults (Ubuntu):
status: Confirmed → Fix Released
affects: golang-defaults (Ubuntu) → golang-1.14 (Ubuntu)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Dimitri, or anyone else affected,

Accepted golang-1.14 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/golang-1.14/1.14.3-2ubuntu2~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in golang-1.14 (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Started the test build at https://code.launchpad.net/~xnox/+archive/ubuntu/nonvirt/+build/19461868

The build step should suceed, using the golang-1.14 from focal-proposed, whilst using cgo & buildmode=pie.

It will fail during tests, but that's irrelevant for validating this bug in question.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The build finished the build stage correctly, and only failed in testing.

Get:93 http://ftpmaster.internal/ubuntu focal-proposed/main riscv64 golang-1.14-src riscv64 1.14.3-2ubuntu2~20.04.1 [13.3 MB]
Get:94 http://ftpmaster.internal/ubuntu focal-proposed/main riscv64 golang-1.14-go riscv64 1.14.3-2ubuntu2~20.04.1 [49.9 MB]

....

make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_test -- -pkgdir=/<<PKGBUILDDIR>>/_build/std -buildmode=pie

This is verified as good.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package golang-1.14 - 1.14.3-2ubuntu2~20.04.1

---------------
golang-1.14 (1.14.3-2ubuntu2~20.04.1) focal; urgency=medium

  * Backport to focal. (LP: #1880040, #1881417)
  * Drop debhelper-compat back to 12.

 -- Michael Hudson-Doyle <email address hidden> Thu, 04 Jun 2020 11:58:08 +1200

Changed in golang-1.14 (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for golang-1.14 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.