Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 473700 - net-misc/dhcpcd-5.99.7-r1: if -std=c99 is not included in the CFLAGS, build fails on Gentoo/FreeBSD.
Summary: net-misc/dhcpcd-5.99.7-r1: if -std=c99 is not included in the CFLAGS, build f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All FreeBSD
: Normal normal
Assignee: William Hubbs
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-06-18 13:27 UTC by Yuta SATOH
Modified: 2013-07-08 14:30 UTC (History)
2 users (show)

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


Attachments
sample patch for dhcpcd-5.99.7-r1.ebuild (473700.patch,783 bytes, patch)
2013-06-18 13:42 UTC, Yuta SATOH
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta SATOH 2013-06-18 13:27:11 UTC
If -std=c99 is not included in the CFLAGS, it fails to build.



Reproducible: Always

Steps to Reproduce:
1. cd /tmp 
2. tar xjf dhcpcd-5.99.7.tar.bz2
3. cd dhcpcd-5.99.7
4. CFLAGS="-O2 -pipe" ./configure
5. gmake
Actual Results:  
# CFLAGS="-O2 -pipe" ./configure
Configuring dhcpcd for ... freebsd
Looking for compiler ... gcc
gcc (Gentoo 4.6.3 p1.11, pie-0.5.2) 4.6.3
Testing for getifaddrs ... yes
Testing for arc4random ... yes
Testing for closefrom ... yes
Testing for getline ... yes
Testing for strlcpy ... yes
Testing for TAILQ_FOREACH_SAFE ... yes
Testing for posix_spawn ... yes
Testing for pollts ... no
Testing for ppoll ... no
Testing for pselect ... yes
Checking for OpenRC ... yes
Checking for ntpd ... not found
Checking for ypind ... /usr/sbin/ypbind (50-ypbind)

   SYSCONFDIR =         /etc
   SBINDIR =            /sbin
   LIBDIR =             /lib
   LIBEXECDIR =         /libexec
   DBDIR =              /var/db
   RUNDIR =             /var/run
   MANDIR =             /usr/share/man
   HOOKSCRIPTS =        50-ypbind
# gmake
gcc -O2 -pipe -DINET -DINET6 -c common.c -o common.o
In file included from config.h:8:0,
                 from common.h:34,
                 from common.c:57:
compat/pollts.h:36:64: error: conflicting types for 'restrict'
compat/pollts.h:36:23: note: previous definition of 'restrict' was here
compat/pollts.h:37:21: error: conflicting types for 'restrict'
compat/pollts.h:36:64: note: previous definition of 'restrict' was here
gmake: *** [common.o] Error 1




# CFLAGS="-O2 -pipe -std=c99" ./configure
<snip>
# gmake
gcc -O2 -pipe -std=c99 -DINET -DINET6 -c common.c -o common.o
gcc -O2 -pipe -std=c99 -DINET -DINET6 -c control.c -o control.o
<snip>
        dhcpcd-run-hooks.8.in > dhcpcd-run-hooks.8

build to succeed.
Comment 1 Yuta SATOH 2013-06-18 13:42:36 UTC
Created attachment 351302 [details, diff]
sample patch for dhcpcd-5.99.7-r1.ebuild
Comment 2 Naohiro Aota gentoo-dev 2013-06-19 22:21:32 UTC
From README:
> We now default to using -std=c99.

So this is not FreeBSD specific problem. It may arise some issue even on Linux.

Take a loot at Makefile

> CFLAGS?=        -O2
> CSTD?=          c99
> CFLAGS+=        -std=${CSTD}
> include config.mk

CFLAGS is overwritten by config.mk. IMHO adding "-std=${CSTD}" should go after including config.mk.
Comment 4 Roy Marples 2013-06-25 09:24:34 UTC
Fixed in dhcpcd-6.0.2
Comment 5 William Hubbs gentoo-dev 2013-07-08 14:30:23 UTC
Dhcpcd-6.0.2 is in the tree.