Bug 20994 - %configure macro: Several problems
Summary: %configure macro: Several problems
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: RPM stack maintainers
QA Contact:
URL: https://copr.fedorainfracloud.org/cop...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-30 22:54 CEST by Alec Leamas
Modified: 2017-06-05 01:16 CEST (History)
2 users (show)

See Also:
Source RPM: rpm-mageia-setup
CVE:
Status comment:


Attachments
Fix build with -Wl,--no-undefined (1.12 KB, patch)
2017-05-31 13:35 CEST, Jani Välimaa
Details | Diff

Description Alec Leamas 2017-05-30 22:54:35 CEST
Description of problem: Building recent versions of lirc is not possible using the %configure macro which makes hardcoding a multitude of options to ./configure necessary


Version-Release number of selected component (if applicable): n/a (I'm not really sure where this belongs, mageia newbie)


How reproducible: Always


Steps to Reproduce:
1. Download source rpm from https://leamas.fedorapeople.org/lirc/lirc-0.10.0rc1-0.3.fc25.src.rpm

2. Change the ./configure invocation to %configure --enable-devinput --enable-uinput.

3 Watch build fail. In particular:
  - The -Wl,--no-undefined creates an error on an otherwise working build (yes, it's strange, but that's how it is)
  - One or more of the following makes configure re-build configure from configure.ac and then fail on missing files. These files was installed by an initial autoreconf -fi
    /usr/lib/rpm/mageia/force-as-needed-for-shared-lib-in-libtool ; 
    /usr/lib/rpm/mageia/drop-ld-no-undefined-for-shared-lib-modules-in-libtool ; 
    /usr/lib/rpm/mageia/fix-libtool-ltmain-from-overlinking ; 
    /usr/lib/rpm/mageia/fix-libtool-from-moving-options-after-libs 
$CONFIGURE_TOP
  - The docdir option is *not* set by %configure, shouldn't it be %{_defaultdocdir)?
Comment 1 Rémi Verschelde 2017-05-31 09:30:55 CEST
I can't test the build right now, but here's some feedback on:

>   - The -Wl,--no-undefined creates an error on an otherwise working build (yes, it's strange, but that's how it is)

That's a bug in lirc which should eventually be fixed. It means that you are underlinking something (a binary uses symbols for a library which it doesn't link with explicitly). See https://wiki.mageia.org/en/Underlinking_issues_in_packaging
Rémi Verschelde 2017-05-31 09:31:08 CEST

Assignee: bugsquad => rpmstack

Comment 2 Jani Välimaa 2017-05-31 12:31:48 CEST
And currently we should not use %configure in .spec, but %configure2_5x. It's another story (see bug 19902), though, and doesn't affect to linking issue in lirc itself.
Comment 3 Neal Gompa 2017-05-31 12:38:01 CEST
My recommendation is to do the following in the spec:

%{?configure2_5x:%global configure %configure2_5x}

I intend to have %configure2_5x die a nasty, horrible death, so the conditional above will deal with the difference properly.

CC: (none) => ngompa13

Comment 4 Jani Välimaa 2017-05-31 13:15:50 CEST
I'll check the linking issue and create git formatted patch if it's easily fixed.

CC: (none) => jani.valimaa

Comment 5 Jani Välimaa 2017-05-31 13:35:00 CEST
Created attachment 9367 [details]
Fix build with -Wl,--no-undefined

Here's the patch to fix the linking issue.
Comment 6 Alec Leamas 2017-05-31 13:46:17 CEST
(In reply to Neal Gompa from comment #3)
> My recommendation is to do the following in the spec:
> 
> %{?configure2_5x:%global configure %configure2_5x}
> 
> I intend to have %configure2_5x die a nasty, horrible death, so the
> conditional above will deal with the difference properly.

OK, configure2_5x does indeed resolve the issue. Together with Jan's patch that should be it (and even if not, preloading LDFLAGS isn't that bad)

Thanks for fast feedback, everyone. I cannot confirm the fixes right now since the COPR mageia repos seems broken (missing  python3-pip needed by lib64python3.5-stdlib), but assume this is just for the moment. Will close bug as soon as builders are up again.
Comment 7 Alec Leamas 2017-05-31 13:48:40 CEST
(In reply to Jani Välimaa from comment #5)
> Created attachment 9367 [details]
> Fix build with -Wl,--no-undefined
> 
> Here's the patch to fix the linking issue.

Thanks! (and I was so sure this was something entirely different I was about to write a silly answer instead)  ;-)
Neal Gompa 2017-05-31 13:52:26 CEST

Source RPM: rpm-4.13.0.1-2 (?) => rpm-mageia-setup

Neal Gompa 2017-05-31 13:52:47 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=19902

Comment 8 Alec Leamas 2017-05-31 22:27:47 CEST
thanks again for all feedback. Everything now builds OK; closing basically as not-a-bug

Status: NEW => RESOLVED
Resolution: (none) => INVALID

Frédéric "LpSolit" Buclin 2017-06-05 01:16:07 CEST

CC: (none) => LpSolit

Frédéric "LpSolit" Buclin 2017-06-05 01:16:17 CEST

CC: LpSolit => (none)


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