Bug 1538318 - llvm5.0 compatibility package doesn't build with -Wl,-z,defs
Summary: llvm5.0 compatibility package doesn't build with -Wl,-z,defs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm5.0
Version: 28
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Tilmann Scheller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-24 19:48 UTC by Tom Stellard
Modified: 2018-10-04 22:37 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-10-04 22:37:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tom Stellard 2018-01-24 19:48:26 UTC
Description of problem:
The llvm5.0 compatibility package no longer builds in rawhide.  The previous successful build is here: https://koji.fedoraproject.org/koji/buildinfo?buildID=1013148

My guess is that this is caused by Fedora changing the default C_FLAGS and CXX_FLAGS.

Version-Release number of selected component (if applicable):
llvm5.0-5.0.1-1.fc28

How reproducible:
Always


Steps to Reproduce:
1. fedpkg clone llvm5.0
2. cd llvm5.0
3. fedpkg scratch-build

Actual results:
Build fails.

Expected results:
Build succeeds.

Comment 1 Tilmann Scheller 2018-01-26 19:35:09 UTC
I found the root cause of the build failures: "-Wl,-z,defs" was added to
the linker flags a couple of days ago (it was added in
redhat-rpm-config-84-1.fc28, additional details in bug 1535422).

This causes the linker invocation of LLVMHello.so to fail with several
undefined references. LLVMHello.so is an example optimization pass that is
loaded dynamically by the opt tool. Since LLVMHello.so is effectively a plugin
that dynamically links to an executable (opt) when it is loaded it can never be
built with "-Wl,-z,defs".

I think the pragmatic way forward for the llvm5.0 compatibility package is to
just build it with "%undefine _strict_symbol_defs_build" for now (this is the
canonical way to disable the linker flag from above). I did a test build and
that fixed the build failures.

Longer term (e.g. for LLVM 7.0) we should probably inspect every shared object
that is part of the package and build it with "-Wl,-z,defs" if possible), I
believe that we are already building libLLVM.so with "-Wl,-z,defs" but I need
to double check to be sure.

Comment 2 Tom Stellard 2018-01-29 12:47:14 UTC
I added %undefine _strict_symbol_defs_build in llvm5.0-5.0.1-2.fc28.  Leaving this bug open until we have a long term fix.

Comment 3 Tilmann Scheller 2018-01-29 14:56:06 UTC
It looks like the "-Wl,-z,defs" change was just reverted again: https://bugzilla.redhat.com/show_bug.cgi?id=1535422#c6

I guess independently of that it would still be good to build as many LLVM shared libraries as possible with "-Wl,-z,defs" in the long term.

Comment 4 Fedora End Of Life 2018-02-20 15:37:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 5 Adam Williamson 2018-03-10 22:24:41 UTC
adjusting for accuracy.

Comment 6 Tom Stellard 2018-10-04 22:37:42 UTC
llvm5.0-5.0.1-7.fc28 was successfully built for f28.


Note You need to log in before you can comment on or make changes to this bug.