Compiling failed with gcc -B option on Ubuntu 18.04 update

Bug #1769939 reported by bugproxy on 2018-05-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
High
Canonical Foundations Team
gcc-7 (Ubuntu)
High
Canonical Foundations Team
Bionic
High
Canonical Foundations Team

Bug Description

--Problem Description--
Compiling failed with -B on Ubuntu 18.04 updated kernel. The gcc -B option does not recognize the custom ld script..

---Issue observed---
# gcc -m64 -B ./obj64 -L../obj64 -o obj64/linkhuge_rw -Wl,--no-as-needed -lpthread -ldl -lhugetlbfs_privutils -Wl,--hugetlbfs-align obj64/linkhuge_rw.o obj64/testutils.o
/usr/bin/powerpc64le-linux-gnu-ld: unrecognized option '--hugetlbfs-align'
/usr/bin/powerpc64le-linux-gnu-ld: use the --help option for usage information
collect2: error: ld returned 1 exit status

---Env details---

Hardware: Tuleta
DD revision: 2,1
Operating Env.: Power KVM/BML
Host OS version:

# uname -a
Linux lep8d 4.15.0-20-generic #16-Ubuntu SMP Wed Apr 4 13:57:51 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux

----Additional Info-----
Note:
It was working on 18 04 till "4.15.0-15-generic" kernel and does not work on gcc built with ld on any update after 4.15.0-15 kernel.

From doc:
For each subprogram to be run, the compiler driver first tries the
     '-B' prefix, if any.

Reproducible : 100%

---Steps to Reproduce---
1. git clone https://github.com/libhugetlbfs/libhugetlbfs.git
2. apt install libpthread-stubs0-dev
3. Apply the patches specific to power.
patch -p1 < ppc.patch
ppc.patch : https://bugzilla.linux.ibm.com/attachment.cgi?id=121185

4. Run make and make check.
make BUILDTYPE=NATIVEONLY
(and/or)
4.cd tests;
gcc -m64 -B ./obj64 -L../obj64 -o obj64/linkhuge_rw -Wl,--no-as-needed -lpthread -ldl -lhugetlbfs_privutils -Wl,--hugetlbfs-align obj64/linkhuge_rw.o obj64/testutils.o
/usr/bin/powerpc64le-linux-gnu-ld: unrecognized option '--hugetlbfs-align'
/usr/bin/powerpc64le-linux-gnu-ld: use the --help option for usage information
collect2: error: ld returned 1 exit status

---Expected---
Compilation to succeed.

== Comment: #1 - William J. Schmidt <email address hidden> - 2018-05-07 11:10:59 ==
Ubuntu is aware and has fixed this in their 18.10 code base, with backport to 18.04 coming. I've asked Segher to run down a little more information for you.

== Comment: #3 - Segher Boessenkool <email address hidden> - 2018-05-07 11:23:27 ==
This is fixed here:

https://anonscm.debian.org/viewvc/gcccvs?view=revision&revision=10188

so should be available pretty soon.

bugproxy (bugproxy) on 2018-05-08
tags: added: architecture-ppc64le bugnameltc-167514 severity-high targetmilestone-inin1804
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → gcc-defaults (Ubuntu)
Frank Heimes (fheimes) on 2018-05-08
Changed in ubuntu-power-systems:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Canonical Foundations Team (canonical-foundations)
tags: added: triage-g
Matthias Klose (doko) wrote :

fixed in cosmic, fix waiting in the ubuntu-toolchain-r/ppa for bionic

affects: gcc-defaults (Ubuntu) → gcc-7 (Ubuntu)
Changed in gcc-7 (Ubuntu):
status: New → Fix Released
Frank Heimes (fheimes) on 2018-05-09
Changed in ubuntu-power-systems:
status: Triaged → In Progress

------- Comment From <email address hidden> 2018-06-11 04:32 EDT-------
Can Canonical confirm us its fixed in latest bionic kernel? 18.04.1 kernel -> 4.15.0-23-generic.

Its pending on test to validate this on 18.04.1 and close.

Manoj Iyer (manjo) on 2018-06-18
Changed in ubuntu-power-systems:
status: In Progress → Incomplete
Changed in gcc-7 (Ubuntu):
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → Canonical Foundations Team (canonical-foundations)
Changed in gcc-7 (Ubuntu Bionic):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Changed in gcc-7 (Ubuntu):
importance: Undecided → High
Changed in gcc-7 (Ubuntu Bionic):
importance: Undecided → High
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-06-24 02:17 EDT-------
What is the update on this, which 18.04.1 Ubu kernel will have this fix ?

Matthias Klose (doko) wrote :

my plan was to get the compilers in the ubuntu-toolchain-r/ppa tested with a test rebuild of the main component, and then do the upload to the proposed pocket. I expect this to be finished until the end of July.

tags: added: id-5b342312b9323847933adb99
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-07-01 10:16 EDT-------
I assume we can not validate this as part of Ubu 18.04.1 GA, which is July 24, 2018.

Dimitri John Ledkov (xnox) wrote :

This bug does not appear to affect the process of installing Ubuntu itself. Therefore it is not critical for the respin of installation media as done for the point release. Once the package update is available, any bionic system will receive it.

Changed in ubuntu-power-systems:
status: Incomplete → In Progress
Manoj Iyer (manjo) on 2018-07-16
Changed in gcc-7 (Ubuntu Bionic):
milestone: none → ubuntu-18.04.1
Changed in gcc-7 (Ubuntu):
milestone: none → ubuntu-18.04.1
Manoj Iyer (manjo) on 2018-08-06
Changed in gcc-7 (Ubuntu Bionic):
milestone: ubuntu-18.04.1 → bionic-updates
Patricia Gaughen (gaughen) wrote :

The test rebuild has completed, and the SRU is being prepared with the test results. We are expecting to start the SRU process towards the end of this week.

Matthias Klose (doko) wrote :

GCC update is now in bionic

Changed in gcc-7 (Ubuntu Bionic):
status: New → Fix Released
Changed in ubuntu-power-systems:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers