Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 565466

Summary: app-laptop/i8kutils-1.42 fails to build with GCC 5 (and has other problems)
Product: Gentoo Linux Reporter: Ryan Hill (RETIRED) <rhill>
Component: [OLD] GCC PortingAssignee: adi
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 536984    
Attachments: i8kutils-1.42-gcc5.patch
i8kutils-1.42-Makefile.patch
i8kutils-1.42.ebuild.diff

Description Ryan Hill (RETIRED) gentoo-dev 2015-11-11 10:01:01 UTC
Created attachment 416654 [details, diff]
i8kutils-1.42-gcc5.patch

The new version is failing to build due to changes in inline rules for C99:

x86_64-pc-linux-gnu-gcc -O2 -march=native -g -pipe   -c -o i8kctl.o i8kctl.c
gcc -Wall -c -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -DLIB i8kctl.c
gcc -Wall -c -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -DLIB probe_i8k_calls_time.c
gcc -o probe_i8k_calls_time i8kctl.o probe_i8k_calls_time.o
probe_i8k_calls_time.o: In function `main':
probe_i8k_calls_time.c:(.text+0x62): undefined reference to `timestamp'
probe_i8k_calls_time.c:(.text+0x82): undefined reference to `timestamp'
probe_i8k_calls_time.c:(.text+0xa2): undefined reference to `timestamp'
probe_i8k_calls_time.c:(.text+0xbf): undefined reference to `timestamp'
probe_i8k_calls_time.c:(.text+0xdc): undefined reference to `timestamp'
probe_i8k_calls_time.o:probe_i8k_calls_time.c:(.text+0xf9): more undefined references to `timestamp' follow
collect2: error: ld returned 1 exit status
Makefile:24: recipe for target 'probe_i8k_calls_time' failed


While looking at this I ran into a race condition with parallel make.  While looking into that I found more things wrong, etc. etc.  Rather than filing multiple bugs I'll just attach a couple patches for those problems here.
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2015-11-11 10:03:40 UTC
Created attachment 416656 [details, diff]
i8kutils-1.42-Makefile.patch

Fix a race condition causing parallel builds to sometimes fail.

Both probe_i8k_calls_time and i8kctl contain a main() function, though
i8kctl's is omitted when built with -DLIB so they can link without a
conflict.  i8kctl is also a standalone exe so it is built twice, with
and without -DLIB.  When building in parallel you can get into a 
situation where the object file created by the probe_i8k_calls_time
target gets overwritten with the one from i8kctl and bad things happen.
Nothing actually uses the i8kctl.o that has main() so we can just not
build it.

Also move CFLAGS, CC, LDFLAGS respect out of the ebuild.
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2015-11-11 10:22:19 UTC
Created attachment 416658 [details, diff]
i8kutils-1.42.ebuild.diff

Just some little stuff

- Drop examples USE flag since that directory doesn't exist in the sources anymore
- Convert DOCS=( README.i8kutils ) to a dodoc.  None of the eclasses we're inheriting handles DOCS so this wasn't getting installed.
- It looks like the newconfd line got dropped when you did your version bump.
- Drop all the compiler flag sed stuff.  None of it actually did anything, except add LDFLAGS when compiling (but not linking).  As far as I can tell this never worked.  Moved to the Makefile patch.
Comment 3 adi 2015-11-11 17:36:24 UTC
I'll apply these patches locally and send them to upstream. Thank you!
Comment 4 Ian Delaney (RETIRED) gentoo-dev 2015-11-13 12:13:22 UTC
commit 4b4234a933a25f93131c443b51cc3bd5b79ce345
Author: Ioan-Adrian Ratiu <adi@adirat.com>
Date:   Wed Nov 11 20:37:47 2015 +0200

    app-laptop/i8kutils: fix gcc5 build for v1.42
    
    Recipe enhancements requested in the bug are also included
    
    Gentoo bug: #565466
    
    Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>

commit e8fa20278328ff3ac39a2bfd89d1c3287f57a9b1
Author: Ioan-Adrian Ratiu <adi@adirat.com>
Date:   Sat Nov 7 20:51:22 2015 +0200

    app-laptop/i8kutils: bump to v1.42
    
    sys-power/acpi added to RDEPEND