Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 590094 - sys-libs/libieee1284 needs extra configure option applied when building on musl
Summary: sys-libs/libieee1284 needs extra configure option applied when building on musl
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: musl-porting
  Show dependency tree
 
Reported: 2016-07-30 23:07 UTC by A. Wilcox (awilfox)
Modified: 2016-08-02 05:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to libieee1284-0.2.11-r3.ebuild (0001-sys-libs-libieee1284-fix-build-on-musl-libc.patch,936 bytes, patch)
2016-07-30 23:07 UTC, A. Wilcox (awilfox)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description A. Wilcox (awilfox) 2016-07-30 23:07:59 UTC
Created attachment 442024 [details, diff]
Patch to libieee1284-0.2.11-r3.ebuild

When building sys-libs/libieee1284 on musl libc with the current ebuild:

./.libs/libieee1284.so: undefined reference to `outb_p'
collect2: error: ld returned 1 exit status
Makefile:546: recipe for target 'libieee1284_test' failed
make: *** [libieee1284_test] Error 1
 * ERROR: sys-libs/libieee1284-0.2.11-r3::gentoo failed (compile phase):
 *   emake failed

This is because musl's sys/io.h does not define outb_p, only outb, as outb_p was deprecated some number of years ago.  Passing "ac_cv_header_sys_io_h=no" to ./configure allows the build to proceed using a package-provided version of the function.

Attached patch to ebuild tested working for me on musl x86 and amd64, and glibc amd64.
Comment 1 Anthony Basile gentoo-dev 2016-07-31 02:04:33 UTC
(In reply to A. Wilcox (awilfox) from comment #0)
> Created attachment 442024 [details, diff] [details, diff]
> Patch to libieee1284-0.2.11-r3.ebuild
> 
> When building sys-libs/libieee1284 on musl libc with the current ebuild:
> 
> ./.libs/libieee1284.so: undefined reference to `outb_p'
> collect2: error: ld returned 1 exit status
> Makefile:546: recipe for target 'libieee1284_test' failed
> make: *** [libieee1284_test] Error 1
>  * ERROR: sys-libs/libieee1284-0.2.11-r3::gentoo failed (compile phase):
>  *   emake failed
> 
> This is because musl's sys/io.h does not define outb_p, only outb, as outb_p
> was deprecated some number of years ago.  Passing "ac_cv_header_sys_io_h=no"
> to ./configure allows the build to proceed using a package-provided version
> of the function.
> 
> Attached patch to ebuild tested working for me on musl x86 and amd64, and
> glibc amd64.

You don't want to "pass" ac_cv_header_sys_io_h=no to ./configure.  Its not a switch that you pass, like --without-python or something.  Rather it should go into the environment of ./configure, so you need something like

use elibc_musl && export ac_cv_header_sys_io_h=no

It "works" the way you did it, but adding it to myconf makes it look like a switch and its stylistically bad.  Do you mind testing to see if the above line works and I'll commit it like that (to save you from reproducing a patch).


@base-system: should be safe enough, may I commit with the above fix.
Comment 2 SpanKY gentoo-dev 2016-08-01 03:20:40 UTC
(In reply to Anthony Basile from comment #1)

configure scripts accept env vars on the command line.  that way they can be passed when re-running configure automatically (like when automake detects files are out of date and need to re-run autotools).

that said, i don't see why this test needs to be forced.  it's a header test for sys/io.h.  if musl didn't provide that, then configure shouldn't have detected it in the first place.
Comment 3 Anthony Basile gentoo-dev 2016-08-01 04:48:30 UTC
(In reply to SpanKY from comment #2)
> (In reply to Anthony Basile from comment #1)
> 
> configure scripts accept env vars on the command line.  that way they can be
> passed when re-running configure automatically (like when automake detects
> files are out of date and need to re-run autotools).

i've never seen that before, so thanks for the info.  i can see how its useful.

> 
> that said, i don't see why this test needs to be forced.  it's a header test
> for sys/io.h.  if musl didn't provide that, then configure shouldn't have
> detected it in the first place.

i'll try to take a look at what's going on tomorrow.
Comment 4 A. Wilcox (awilfox) 2016-08-02 01:06:35 UTC
(Quoting A. Wilcox (awilfox) from comment #0)
> This is because musl's sys/io.h does not define outb_p, only outb, as outb_p
> was deprecated some number of years ago.  Passing "ac_cv_header_sys_io_h=no"
> to ./configure allows the build to proceed using a package-provided version
> of the function.

This is why the test must be forced; libieee1284 blindly assumes outb_p exists in sys/io.h but only outb does in musl.
Comment 5 SpanKY gentoo-dev 2016-08-02 05:25:27 UTC
looks like musl is OK with adding the _p variants:
  http://www.openwall.com/lists/musl/2015/11/10/1

so should go that route i think.  sys/io.h is a mess of non-standard, so if musl is going to support it, should include the "full" api imo.