Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579540 - dev-lang/ruby: configure.in implicitly uses AC_LANG_WERROR
Summary: dev-lang/ruby: configure.in implicitly uses AC_LANG_WERROR
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-10 20:33 UTC by Robin Johnson
Modified: 2016-05-16 19:11 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-04-10 20:33:28 UTC
If your LDFLAGS contain -Wl,--build-id, then gcc may emit a harmless message to stderr; however many configure scripts decide that this means something is wrong.
The root of this seems to be the AC_TRY_LINK macro.

dev-lang/ruby-2.1.10/configure.ac
RUBY_WERROR_FLAG([
    AC_MSG_CHECKING([whether CFLAGS is valid])
    AC_TRY_COMPILE([], [],
    [AC_MSG_RESULT(yes)],
    [    
    AC_MSG_RESULT(no)
    AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"])
    ]    
    )    
    AC_MSG_CHECKING([whether LDFLAGS is valid])
    AC_TRY_LINK([], [],
    [AC_MSG_RESULT(yes)],
    [    
    AC_MSG_RESULT(no)
    AC_MSG_ERROR([something wrong with LDFLAGS="$LDFLAGS"])
    ]    
    )    
])

dev-lang/ruby-2.1.10/config.log snippet:
configure:7102: checking whether LDFLAGS is valid
configure:7115: x86_64-pc-linux-gnu-gcc -o conftest -march=native -O2 -pipe -frecord-gcc-switches -fno-lto -fno-strict-aliasing   -Wl,--hash-style=gnu -Wl,
-O1 -Wl,--as-needed -Wl,--build-id -fno-lto conftest.c  >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.
configure:7115: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:7120: result: no
configure:7122: error: something wrong with LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--build-id -fno-lto"

Portage 2.2.28 (python 2.7.10-final-0, default/linux/amd64/13.0/developer, gcc-4.9.2, glibc-2.22-r2, 4.5.0-rc6-00141-g6794402 x86_64)
=================================================================
System uname: Linux-4.5.0-rc6-00141-g6794402-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    32913372 total,   2021384 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 10 Feb 2016 16:00:01 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
ccache version 3.2.4 [enabled]
app-shells/bash:          4.3_p42-r2::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          9999::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.4_p6-r2::gentoo, 1.5-r2::gentoo, 1.6.3-r2::gentoo, 1.7.9-r3::gentoo, 1.8.5-r5::gentoo, 1.9.6-r4::gentoo, 1.10.3-r2::gentoo, 1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.2::gentoo, 5.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r2::gentoo
Repositories:

gentoo
    location: /code/gentoo/gentoo-git/repo/gentoo
    sync-type: git
    sync-uri: git+ssh://git@git.gentoo.org/repo/gentoo
    priority: -1000

usr-local
    location: /usr/local/portage
    masters: gentoo
    priority: 0

robbat2
    location: /code/gentoo/gentoo-git/robbat2
    masters: gentoo
    priority: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -frecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /opt/openjms/config /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-2.0/conf /usr/share/maven-bin-2.1/conf /usr/share/maven-bin-2.2/conf /usr/share/maven-bin-3.0/conf /usr/share/maven-bin-3.1/conf /usr/share/polkit-1/actions /var/bind /var/lib/hsqldb /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /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"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/home/gentoo/distfiles"
EMERGE_DEFAULT_OPTS="--verbose-conflicts"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles lmirror merge-sync mirror multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--build-id"
MAKEOPTS="-j8 -l10"
PKGDIR="/home/gentoo/packages/bohr-int/"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/dev/shm"
USE="a52 aac aalib acl acpi adns adplug agg aio alsa amd64 amr animgif ares arts audiofile audit avahi avx bash-completion berkdb bluetooth bonjour bzip2 cairo calendar cdaudio cdda cddb cdio cdparanoia cdr chardet chm clamav cli consolekit cracklib crypt cscope css ctype cups curl curlwrappers cvs cxx d3d daap dbus dc1394 designer-plugin dia diskio djbfft djvu dri dts dv dvb dvd dvdr dvdread ebook emf encode exif expat fam ffmpeg fftw firefox flac fltk fontconfig foomaticdb fortran gd gdbm geoip gif gimp glamor glut gmp gnokii gnutls gps graphviz gsm gstreamer hal ical iconv id3tag idea ieee1394 imagemagick imlib inkjar ipod ipv6 jack java5 java6 javacomm jbig jingle jpeg jpeg2k lash lcms ldap libgcrypt libnotify libsamplerate llvm llvm-shared-libs lm_sensors logitech-mouse lzma lzo mad maildir mhash midi mikmod mmap mmx mmxext mng modplug modules mozilla mp3 mp3tunes mp4 mpeg mplayer mudflap multilib multitarget musepack nas ncurses nls nocd nptl nptlonly nsplugin offensive ofx ogg openal opencl openexr opengl openmp oss otr pam pango pccntl pch pcre pda pdf perl plotutils png policykit posix postscript povray ppds pulseaudio python qt3support quicktime raw rdesktop readline reflection rpc rss ruby savedconfig scanner sdl seccomp semantic-desktop semantic-destkop session sid simplexml slp smp sms smux sndfile snmp sockets socks5 solver speex spell spl sqlite sqlite3 sse sse2 ssl ssse3 startup-notification subversion svg symlink sysfs syslog sysvipc taglib theora threads tidy tiff timidity truetype tta twolame udev udisks unicode upower urandom usb v4l v4l2 vcd vcdx videos vim-syntax vnc vorbis vorbis-psy wavpack webkit wideband wifi win32codecs wma wmf wxwidgets x264 xanim xattr xcb xcomposite xfs xine xinerama xinetd xml xorg xosd xpm xrandr xscreensaver xsl xulrunner xv xvid zeroconf zlib" ABI_X86="64 32" ALSA_CARDS="hda-intel usb-audio usb-usx2y ad1816a ad1848 ad1848-lib ad1889 serial-u16550 virmidi seq-dummy dummy" 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 asis auth_digest imagemap log_forensic proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http cern_meta cgi cgid dbd dumpio ident proxy_scgi reqtimeout substitute version authn_dbd" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" FOO2ZJS_DEVICES="hp1020" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc efi-32 efi-64" INPUT_DEVICES="evdev keyboard mouse void wacom" KERNEL="linux" LCD_DEVICES="g15 glk graphlcd iowarrior ncurses null png ppm text usbhub usblcd X xosd" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_CA en_GB en_ZA en_US en af" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 aarch64 arm i386 mips mips64 mips64el mipsel ppc ppc64" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="dummy fbdev ati radeon v4l vga vesa radeonhd r600 nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Mike Gilbert gentoo-dev 2016-04-10 22:35:33 UTC
The current autoconf manual has AC_TRY_LINK listed as an obsolete macro.

http://www.gnu.org/software/autoconf/manual/autoconf.html#Obsolete-Macros
Comment 2 Arfrever Frehtes Taifersar Arahesis 2016-04-11 01:10:06 UTC
Actually AC_TRY_LINK ignores warnings by default.

AC_LANG_WERROR macro sets ac_${language}_werror_flag=yes variable:

$ grep -A3 AC_LANG_WERROR /usr/share/autoconf-2.69/autoconf/lang.m4
# AC_LANG_WERROR
# --------------
# Treat warnings from the current language's preprocessor, compiler, and
# linker as fatal errors.
AC_DEFUN([AC_LANG_WERROR],
[m4_divert_text([DEFAULTS], [ac_[]_AC_LANG_ABBREV[]_werror_flag=])
ac_[]_AC_LANG_ABBREV[]_werror_flag=yes])# AC_LANG_WERROR
$


configure.in of dev-lang/ruby sets ac_c_werror_flag=yes which behaves as if 
AC_LANG_WERROR was used for C language.


$ cat configure.ac
AC_INIT
AC_PROG_CC

AC_MSG_CHECKING([whether LDFLAGS is valid])
AC_TRY_LINK([], [],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_ERROR([something wrong with LDFLAGS])])

AC_OUTPUT
$ autoconf
$ LDFLAGS="-Wl,--warn-section-align" ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether LDFLAGS is valid... yes
configure: creating ./config.status
$ LDFLAGS="-Wl,--warn-section-align" ac_c_werror_flag="yes" ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS
$
Comment 3 Hans de Graaff gentoo-dev Security 2016-05-16 19:07:39 UTC
(In reply to Robin Johnson from comment #0)

> dev-lang/ruby-2.1.10/config.log snippet:
> configure:7102: checking whether LDFLAGS is valid
> configure:7115: x86_64-pc-linux-gnu-gcc -o conftest -march=native -O2 -pipe
> -frecord-gcc-switches -fno-lto -fno-strict-aliasing   -Wl,--hash-style=gnu
> -Wl,
> -O1 -Wl,--as-needed -Wl,--build-id -fno-lto conftest.c  >&5
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/
> ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.

I'm trying to reproduce this, but with these LDFLAGS ruby configures fine and I don't see this warning in the log. Is there a way to trigger the --build-id warning?
Comment 4 Hans de Graaff gentoo-dev Security 2016-05-16 19:11:25 UTC
(In reply to Mike Gilbert from comment #1)
> The current autoconf manual has AC_TRY_LINK listed as an obsolete macro.
> 
> http://www.gnu.org/software/autoconf/manual/autoconf.html#Obsolete-Macros

Yes, but the documentation refers to use AC_LINK_IFELSE. In autoconf 2.69 AC_TRY_LINK is just syntactic sugar for AC_LINK_IFELSE, so the problem is actually with AC_LINK_IFELSE then.