Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 293324 - net-misc/socat fails to build with -Wno-error
Summary: net-misc/socat fails to build with -Wno-error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-15 21:40 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2010-01-17 22:46 UTC (History)
3 users (show)

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


Attachments
Build log (net-misc:socat-1.7.1.1:20091115-213104.log,22.30 KB, text/plain)
2009-11-15 21:41 UTC, Diego Elio Pettenò (RETIRED)
Details
config.log (config.log,148.48 KB, text/plain)
2009-11-15 21:41 UTC, Diego Elio Pettenò (RETIRED)
Details
Build log for 2.0 (net-misc:socat-2.0.0_beta3:20091115-215017.log,19.95 KB, text/plain)
2009-11-15 21:52 UTC, Diego Elio Pettenò (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-15 21:40:53 UTC
flame@yamato ~ % emerge --info
Portage 2.2_rc49 (default/linux/amd64/10.0, gcc-4.4.2-asneeded, glibc-2.11-r0, 2.6.32-rc7 x86_64)
=================================================================
System uname: Linux-2.6.32-rc7-x86_64-Quad-Core_AMD_Opteron-tm-_Processor_2350-with-gentoo-2.0.1
Timestamp of tree: Sun, 15 Nov 2009 16:00:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.4
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r2
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.64
sys-devel/automake:  1.10.2, 1.11
sys-devel/binutils:  2.20.51.0.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -floop-block -g -ggdb -Wstrict-aliasing=2 -Wno-format-zero-length -Wformat=2 -Wno-error -Wno-pointer-sign "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -floop-block -g -ggdb -Wno-error -Wformat=2 -Wstrict-aliasing=2 -fvisibility-inlines-hidden"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=n"
FEATURES="assume-digests autoaddcvs autoconfig collision-protect cvs distlocks fixpackages multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -g -ggdb"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common"
LINGUAS="en it"
MAKEOPTS="-j12 -s"
PKGDIR="/var/spool/portage/packages"
PORTAGE_COMPRESS=""
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=ChangeLog"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/media/repos/gentoo-x86-sync"
PORTDIR_OVERLAY="/var/spool/portage/overlays/cross /var/spool/portage/overlays/layman/x11 /var/spool/portage/overlays/layman/x11 /var/spool/portage/overlays/layman/tante_overlay /var/spool/portage/overlays/layman/emacs /var/spool/portage/overlays/layman/java-overlay /var/spool/portage/overlays/layman/ruby /var/spool/portage/overlays/layman/gnome /media/repos/flame/flame-overlay /media/repos/flame/gentoo/ruby-scripts/ruby-ng-testbed /var/spool/portage/overlays/java-experimental"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowex 3dnowext S3TC a52 aac acl acpi4linux alsa amd64 apm audiofile avahi avi bluetooth bzip2 bzlib caps cjk cli crypt css cups custom-cflags custom-cxxflags dbus dlloader dnd dpms dri dts emacs emboss fame ffmpeg flac foomaticdb gif gmp gnome gnome-keyring gnutls gpgme gphoto2 gtk gtk2 hal idn ieee1394 imlib imlib2 inotify ipv6 ithreads java5 java6 jpeg kdehiddenvisibility latex libnotify lm_sensors lx700 lzw lzw-tiff maildir matroska midi mmx mmx2 mmxext mng modules mozsvg mp3 mpeg mpeg4 mpm-threadpool mudflap multilib native network-cron nls no_wxgtk1 noantlr nobcel nobeanutils nobsh nocommonslogging nocommonsnet nodrm nojdepend nojsch nojython nolog4j nomotif nooro noregexp norhino noxalan noxerces nptl nptlonly nsplugin ogg oggvorbis openmp pam pch pdf pdflib pic pmount png policykit ppds pppd pulseaudio qemu-fast reflection rtc session snmp speex spell spl sse sse2 ssl ssse3 startup-notification stencil-buffer subversion svg svgz sysfs syslog tetex theora threads tiff truetype truetype-fonts type1 type1-fonts udev uncompressed-sounds unicode usb userlocales utf8 v4l v4l2 vhosts vorbis wxwindows x11vnc xcb xcomposite xorg xpm xv xvid zeroconf zlib zsh-completion zvbi" ALSA_CARDS="hda-intel usb-audio mpu401 ice1712" ALSA_PCM_PLUGINS="iec958 plug ioplug hooks empty route asym softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en it" LIRC_DEVICES="kworld" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19 jruby" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="radeon" 
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-15 21:41:34 UTC
Created attachment 210354 [details]
Build log
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-15 21:41:52 UTC
Created attachment 210356 [details]
config.log
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-15 21:52:03 UTC
Created attachment 210363 [details]
Build log for 2.0

Same with 2.0; seems like there is a new warning now with GCC 4.4 that makes the stupid configure tests to fail.
Comment 4 Didier Barvaux 2010-01-02 13:18:24 UTC
The problem has nothing to do with GCC 4.4 but with custom CFLAGS. I can reproduce it with GCC 4.3.2 with CFLAGS=-Wno-error.

Steps to reproduce:
1. CFLAGS=-Wno-error emerge -1 net-misc/socat

The problem comes from the AC_BASIC_TYPE macro defined in configure.in (see below). The macro does not filter customs CFLAGS that may cause it to fail. For exactly the same reason, flag -Wall is already filtered by the ebuild (see bug 133527). Note that the 2.0.0_beta3 ebuild does not filter -Wall, only the 1.7.1.1 does it.

Upstream is aware of the -Wall problem (see the news item 2009/05/09 at http://www.dest-unreach.org/socat/) but the proposed fix only handles -Wall and no other custom CFLAGS such as -Wno-error.

Why not filter all custom CFLAGS in the AC_BASIC_TYPE macro (ie. omit $CFLAGS1 in the redefinition of $CFLAGS) ?

dnl find what physical type (basic C type) is equivalent to the given type.
dnl arg1: include file(s)
dnl arg2: type name
dnl arg3: output variable
dnl arg4: cache variable (might be constructed automatically)
dnl   output values: 1..short, 2..unsigned short, 3..int, 4..u-int,
dnl                  5..long, 6..u-long; others not yet supported
define(AC_BASIC_TYPE,[
AC_CACHE_CHECK(for equivalent simple type of $2, $4,
[CFLAGS1="$CFLAGS"; CFLAGS="-Werror -O0 $CFLAGS1"
 AC_TRY_COMPILE([$1],[$2 u; short v; &u==&v;],
 [$4="1 /* short */"],
 [AC_TRY_COMPILE([$1],[$2 u; unsigned short v; &u==&v;],
  [$4="2 /* unsigned short */"],
  [AC_TRY_COMPILE([$1],[$2 u; int v; &u==&v;],
   [$4="3 /* int */"],
   [AC_TRY_COMPILE([$1],[$2 u; unsigned int v; &u==&v;],
    [$4="4 /* unsigned int */"],
    [AC_TRY_COMPILE([$1],[$2 u; long v; &u==&v;],
     [$4="5 /* long */"],
     [AC_TRY_COMPILE([$1],[$2 u; unsigned long v; &u==&v;],
      [$4="6 /* unsigned long */"],
      [AC_TRY_COMPILE([$1],[$2 u; long long v; &u==&v;],
       [$4="7 /* long long */"],
       [AC_TRY_COMPILE([$1],[$2 u; unsigned long long v; &u==&v;],
        [$4="8 /* unsigned long long */"],
        [$4="0 /* unknown, taking default */"
]) ]) ]) ]) ]) ]) ]) ])
 CFLAGS="$CFLAGS1" ])
AC_DEFINE_UNQUOTED($3, ${$4})
])
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-01-13 22:00:08 UTC
How about 1.7.1.2 (a new 2.* is probably forthcoming as well)? 
Comment 6 Didier Barvaux 2010-01-14 20:07:50 UTC
(In reply to comment #5)
> How about 1.7.1.2 (a new 2.* is probably forthcoming as well)? 

Same problem as 1.7.1.1 with CFLAGS="-Wno-error" because the macro was updated to ignore -Wall but not -Wno-error (or other similar cflags).

1.7.1.1:
[CFLAGS1="$CFLAGS"; CFLAGS="-Werror -O0 $CFLAGS1"

1.7.1.2:
[CFLAGS1="$CFLAGS"; CFLAGS="$ERRONWARN $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')"
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2010-01-17 20:25:40 UTC
OK, so -Werror is used by the configure system in a funny way and it's not a problem related to GCC features (versions).

All the ebuilds filter -Wno-error* now.
Comment 8 Didier Barvaux 2010-01-17 22:46:03 UTC
(In reply to comment #7)
> OK, so -Werror is used by the configure system in a funny way and it's not a
> problem related to GCC features (versions).
> 
> All the ebuilds filter -Wno-error* now.
> 

Successfully tested with 1.7.1.1 and 1.7.1.2 ebuilds. Thanks.