Compiling failed with gcc -B option on Ubuntu 18.04 update

Bug #1769939 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
High
Canonical Foundations Team
gcc-7 (Ubuntu)
Fix Released
High
Canonical Foundations Team
Bionic
Fix Released
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)
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)
Changed in ubuntu-power-systems:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Canonical Foundations Team (canonical-foundations)
tags: added: triage-g
Revision history for this message
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)
Changed in ubuntu-power-systems:
status: Triaged → In Progress
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- 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)
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
Revision history for this message
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 ?

Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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)
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)
Changed in gcc-7 (Ubuntu Bionic):
milestone: ubuntu-18.04.1 → bionic-updates
Revision history for this message
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.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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