Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 428728 - sys-kernel/ksymoops-2.4.11-r1 - In file included from ksymoops.h:9:0, from ksymoops.c:14: /usr/include/bfd.h:37:2: error: #error config.h must be included before this header
Summary: sys-kernel/ksymoops-2.4.11-r1 - In file included from ksymoops.h:9:0, from ks...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Miscellaneous
URL:
Whiteboard: Pending Removal: 2013-08-21
Keywords: PMASKED
: 431002 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-31 00:26 UTC by Gary E. Miller
Modified: 2013-08-31 15:16 UTC (History)
8 users (show)

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


Attachments
build.log (build.log,3.64 KB, text/plain)
2012-07-31 00:27 UTC, Gary E. Miller
Details
Workaround patch (ksymoops-2.4.11-binutils-fix.patch,257 bytes, patch)
2012-08-20 12:38 UTC, Ian Abbott
Details | Diff
build.log - JM (build.log,7.49 KB, text/plain)
2013-03-03 23:09 UTC, Jason Mours
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary E. Miller 2012-07-31 00:26:09 UTC
sys-kernel/ksymoops-2.4.11-r1 fails emerge.

In file included from ksymoops.h:9:0,
                 from ksymoops.c:14:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header


Reproducible: Always

Steps to Reproduce:
1. emerge -1  sys-kernel/ksymoops-2.4.11-r1

Actual Results:  
x86_64-pc-linux-gnu-gcc -march=core2 -O2 -pipe -Dlinux -Wall -Wno-conversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -DINSTALL_PREFIX="\"/usr\"" -DCROSS="\"\""  -DDEF_KSYMS=\"/proc/ksyms\" -DDEF_LSMOD=\"/proc/modules\" -DDEF_OBJECTS=\"/lib/modules/*r/\" -DDEF_MAP=\"/usr/src/linux/System.map\"   -c -o ksyms.o ksyms.c
In file included from ksymoops.h:9:0,
                 from ksymoops.c:14:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header


Expected Results:  
successful emerge

dagwood ~ # emerge --info '=sys-kernel/ksymoops-2.4.11-r1'
Portage 2.1.11.9 (default/linux/amd64/10.0/desktop, gcc-4.6.3, glibc-2.15-r2, 3.4.5-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.4.5-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8400_@_2.26GHz-with-gentoo-2.1
Timestamp of tree: Mon, 30 Jul 2012 16:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.5-r1, 1.9.6-r3, 1.10.3, 1.11.6, 1.12.2
sys-devel/binutils:       2.22.90
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.5 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo java-overlay
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/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=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://mirror.usu.edu/mirrors/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-z,now,--as-needed,-O1,--hash-style=gnu,--sort-common"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/java-overlay"
SYNC="rsync://spidey.rellim.com/gentoo-portage"
USE="X a52 aac acl acpi adns aesicm aio alsa amazon amd64 amr apng ares asyncns audiofile avahi bash-completion bcmath berkdb binary-drivers bonjour bookmarks branding btrfs bzip2 cairo calendar capi caps cdaudio cdb cdda cdio cdr celt cgroup chroot cli consolekit cracklib crypt cscope ctype cups curl custom-optimization cxx daap dbus dc1394 declarative dirac directfb diskio divx dlz dri dtmf dts dv dvb dvbplayer dvd dvdr dvi ecwj2k egl emboss encode exif expat extrafilters extras faac faad fam fame fat festival ffmpeg ffmpeg-mt fftw fileinfo filter firefox fits flac fontconfig foomaticdb fortran ftp g3dvl gallium gcdmaster gcrypt gd gdbm geoip geoloc geonames geos geotiff gif gimp gkrellm gles1 gles2 glib gmath gml gmp gnuplot gnutls gost gpac gpg gpgme gphoto2 gpm grass gs gsl gsm gstreamer gtk gucharmap gutenprint h323 hardened hash hfs hostip hpijs http iax iconv icu id3tag imagemagick inkjar inotify ipp iproute2 ipv6 irc ivr jabber jack java javascript jbig jpeg jpeg2k json krb4 ladspa lame largefile latex lcms ldap less libass libburn libedit libextractor libgcrypt liblockfile libnotify libsamplerate libsysfs libv4l2 libvisual live lm_sensors logrotate lv2 lzo mad manual matroska mbrola mdadm mdnsresponder-compat mhash midi mkl mmx mng modules mp2 mp3 mp3rtp mp4 mp4live mpeg mpeg2 mplayer mtp mudflap multilib music musicbrainz mysql ncurses netcdf netlink network nls nodrm nominatim nptl nsplugin ntfs offensive ogdi ogg ogm openexr opengl openmp openvg oss pam pango passwdqc pcap pch pcntl pcre pdf pdfimport perl phar pixmaps plazes plotutil plotutils png pnm policykit posix postproc ppds pppd proj pth pvr python qos qt-static qt3support qt4 rar raw rdesktop readline realmedia realtime rle rpz rrdtool rtc rtsp run-as-root scanner schroedinger screen sdl secure-delete semantic-desktop server session shm shout simplexml sip sipim skins smi smime smp sndfile snmp sound spamassassin speex spell sqlite srt srtp sse sse2 sse3 ssh ssl ssse3 startup-notification stream svg swat syntax-check syslog taglib tcpd tcpwrapper theora threads thumbnail tidy tiff timidity tokenizer tools transcode truetype tunepimp twolame udev udisks unicode upower urandom usb v4l2 vamp vcd vcdinfo vcdx vdpau vdr video vim-syntax visualization vlc vlm vnc vorbis vorbis-psy vpx vxml wav wavpack webkit wifi wikipedia wireshark wma wmf wmp wps wxwidgets x264 xanim xattr xcap xcb xcf xcomposite xface xfce xforms xft xine xinerama xml xmlrpc xmp xorg xosd xpm xrandr xrender xscreensaver xsl xslt xulrunner xv xvfb xvid xvmc yahoo yahoo-geo youtube zephyr zeroconf zip zlib zrtp zvbi" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="canon fuji ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" 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 ubx" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nouveau vesa" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-kernel/ksymoops-2.4.11-r1 was built with the following:
USE="(multilib)"


dagwood ~ # emerge -pqv '=sys-kernel/ksymoops-2.4.11-r1'
[ebuild   R   ] sys-kernel/ksymoops-2.4.11-r1
Comment 1 Gary E. Miller 2012-07-31 00:27:02 UTC
Created attachment 319800 [details]
build.log
Comment 2 Gary E. Miller 2012-07-31 00:28:19 UTC
Similar to bugs 428636 and 428506
Comment 3 Gary E. Miller 2012-07-31 00:31:05 UTC

See the binutils bugtracker at http://sourceware.org/bugzill/show_bug.cgi?id=14243
Comment 4 Ian Abbott 2012-08-20 12:38:53 UTC
Created attachment 321748 [details, diff]
Workaround patch

Add a dummy macro called `PACKAGE` to ksymoops.h before the `#include <bfd.h>`. This is enough to stop <bfd.h> from binutils 2.22.90 complaining.
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-08-25 03:52:26 UTC
*** Bug 431002 has been marked as a duplicate of this bug. ***
Comment 6 Martin von Gagern 2012-09-01 19:27:01 UTC
(In reply to comment #4)
> Add a dummy macro called `PACKAGE` to ksymoops.h before the `#include
> <bfd.h>`. This is enough to stop <bfd.h> from binutils 2.22.90 complaining.

http://sourceware.org/bugzilla/show_bug.cgi?id=14243#c1 indicates that this solution might be have unintended consequences. Quoting from that comment:

"This is a correctness issue.  bfd.h and the headers that bfd.h #include test
 at least one HAVE_* macro.  So you need to include the file that defines
 those HAVE_* macros before bfd.h.  You may argue that the use of
 HAVE_STRINGSIZE will never affect any host that builds oprofile. While that
 may be true, it's still a correctness issue.  Future versions of bfd.h may
 test other HAVE_* macros."

Looking at the headers, this should probably be "HAVE_STRINGIZE" not "HAVE_STRINGSIZE". And as long as __STDC__ is defined, the value of HAVE_STRINGIZE should be irrelevant. But the fact about possibly different behaviour in a future release of binutils remains. Even now, there are other HAVE_* macros in use in binutils headers, though only in libiberty.h which apparently isn't included by bfd.h.

In short, the workaround seems to work for now, but might break again in the future. I'd like to at least document this possibility here, with this comment.
Comment 7 Jason Mours 2013-03-03 23:09:28 UTC
Created attachment 340896 [details]
build.log - JM

I was able to pull a few a bit more out ... not sure if these affected object files will help.

x86_64-pc-linux-gnu-gcc -march=native -Os -pipe -ggdb -Dlinux -Wall -Wno-conversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -DINSTALL_PREFIX="\"/usr\"" -DCROSS="\"\""  -DDEF_KSYMS=\"/proc/ksyms\" -DDEF_LSMOD=\"/proc/modules\" -DDEF_OBJECTS=\"/lib/modules/*r/\" -DDEF_MAP=\"/usr/src/linux/System.map\"   -c -o symbol.o symbol.c
In file included from ksymoops.h:9:0,
                 from io.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
In file included from ksymoops.h:9:0,
                 from map.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
In file included from ksymoops.h:9:0,
                 from ksymoops.c:14:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
In file included from ksymoops.h:9:0,
                 from misc.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
In file included from ksymoops.h:9:0,
                 from object.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
In file included from ksymoops.h:9:0,
                 from ksyms.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
In file included from ksymoops.h:9:0,
                 from re.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this headerIn file included from ksymoops.h:9:0,
                 from symbol.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header

make: *** [io.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ksymoops.h:9:0,
                 from oops.c:11:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
ksymoops.c: In function 'parse':
ksymoops.c:452:6: warning: pointer targets in passing argument 2 of 'adhoc_addresses' differ in signedness [-Wpointer-sign]
ksymoops.c:264:13: note: expected 'const unsigned char *' but argument is of type 'char *'
make: *** [ksyms.o] Error 1
make: *** [map.o] Error 1
make: *** [ksymoops.o] Error 1
make: *** [object.o] Error 1
make: *** [misc.o] Error 1
oops.c: In function 'Oops_code_values':re.c: In function 're_compile':
re.c:34:5: warning: format '%d' expects argument of type 'int', but argument 2 has type 'size_t' [-Wformat]

oops.c:363:7: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
oops.c: In function 'Oops_decode':
oops.c:2248:5: warning: pointer targets in passing argument 2 of 'Oops_code_values' differ in signedness [-Wpointer-sign]
oops.c:339:12: note: expected 'unsigned char *' but argument is of type 'char *'
oops.c: In function 'Oops_read':
oops.c:2464:5: warning: pointer targets in passing argument 1 of 'Oops_decode' differ in signedness [-Wpointer-sign]
oops.c:2238:13: note: expected 'const unsigned char *' but argument is of type 'const char *'
make: *** [re.o] Error 1
make: *** [symbol.o] Error 1
make: *** [oops.o] Error 1
emake failed

ref bug 430706 dev-util/mutrace-0.2 with similar bfd.h issues. Reading the correctness issues on sourceware, I'm not sure if it's fixable.
Comment 8 Jason Mours 2013-06-23 22:34:05 UTC
!PING! ... was wondering as to the status of this issue. I'm sharing Gary's concerns over future errata or outright breakage with the */dummy/* package being a workaround. janice, my gentoo, is a traced stage3 -march=native !(-Os)! -pipe(ed) -ggdb that is over a year old this summer. I am very deep into the machine at this point. Anything that 'may' pop up 6-8 months from now, especially with the 3.9 tracing bug getting squished well into 3.10, is just reason to pop some pepcid and hum along to the tums commercials.

That being said, I can only express how much further I can dive into the silicon with the addition of ksymoops. Especially before I mlton her... then move into gcc-4.8 territory. BUT I will not venture outside of ~testing for package assimilation/integration.

If it's a no go with bfd.h & binutils so be it. I'll live without.
Comment 9 Ian Abbott 2013-06-24 09:51:41 UTC
A suggested fix by Mike Frysinger is ``people can #define PACKAGE "foo" just as easily as autotools'' (see <http://sourceware.org/bugzilla/show_bug.cgi?id=14243#c10>), which is basically what my workaround patch did.

It may also be worth pointing out that ksymoops is not useful for analyzing the Oops messages produced by 2.6 and 3.x kernels, only for 2.4 kernels.
Comment 10 Samuli Suominen gentoo-dev 2013-06-24 10:09:18 UTC
(In reply to Ian Abbott from comment #9)
> It may also be worth pointing out that ksymoops is not useful for analyzing
> the Oops messages produced by 2.6 and 3.x kernels, only for 2.4 kernels.

OK, CCing treecleaners for removal then
Comment 11 Jason Mours 2013-06-24 16:17:44 UTC
(In reply to Ian Abbott from comment #9)
> A suggested fix by Mike Frysinger is ``people can #define PACKAGE "foo" just
> as easily as autotools'' (see
> <http://sourceware.org/bugzilla/show_bug.cgi?id=14243#c10>), which is
> basically what my workaround patch did.
> 
> It may also be worth pointing out that ksymoops is not useful for analyzing
> the Oops messages produced by 2.6 and 3.x kernels, only for 2.4 kernels.

That may be true for human readable output, I'm pretty sure that it still produces interpretive machine output for the 2.6 & 3.x kernels.
Comment 12 Ian Abbott 2013-06-24 17:17:37 UTC
Well Documentation/oops-tracing.txt in the kernel sources says this right at the top of the file:

NOTE: ksymoops is useless on 2.6.  Please use the Oops in its original format
(from dmesg, etc).  Ignore any references in this or other docs to "decoding
the Oops" or "running it through ksymoops".  If you post an Oops from 2.6 that
has been run through ksymoops, people will just tell you to repost it.
Comment 13 Jason Mours 2013-06-24 17:37:41 UTC
(In reply to Ian Abbott from comment #12)
> Well Documentation/oops-tracing.txt in the kernel sources says this right at
> the top of the file:
> 
> NOTE: ksymoops is useless on 2.6.  Please use the Oops in its original format
> (from dmesg, etc).  Ignore any references in this or other docs to "decoding
> the Oops" or "running it through ksymoops".  If you post an Oops from 2.6
> that
> has been run through ksymoops, people will just tell you to repost it.

Fair enough ... I can't ignore the manual, but from a GDB standpoint, when compiling global heuristics... the output is useful for pulling out errata.
Comment 14 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2013-07-12 05:19:01 UTC
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header

i had some problem today, resolved using workaround patch
Comment 15 Jason Mours 2013-07-14 18:02:15 UTC
(In reply to Alice Ferrazzi from comment #14)
> /usr/include/bfd.h:37:2: error: #error config.h must be included before this
> header
> 
> i had some problem today, resolved using workaround patch

I know the patch resolves the build issues. Here is what I know of ksymoops, it is outdated as generates useless human interpretive output. But as it was explained to me, the source code is *amazing* at analyzing the kernel - 2.4, 2.6 , 3.x , etc. THUS, as you introduce it to your @world and *assimilate* it into your system - glibc, gcc, binutils, sed, etc. acquire these functions from ksymoops source and through the magic of GNU/Linux & *emerging* an evolving build environment over time a superior kernel can be produced. Which is why I stress -march=native & -Os. The patch defeats the purpose and the outdated human readable output give no reason to have it in your system to begin with.

my 2cents...
Comment 16 Pacho Ramos gentoo-dev 2013-08-31 15:16:20 UTC
dropped