Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 449060 - games-emulation/dosbox-0.74 fails to compile with clang-3.2
Summary: games-emulation/dosbox-0.74 fails to compile with clang-3.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2012-12-28 16:07 UTC by Julian Ospald
Modified: 2016-06-29 22:34 UTC (History)
7 users (show)

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


Attachments
dosbox-0.74:20121228-154251.log (dosbox-0.74:20121228-154251.log,89.75 KB, text/plain)
2012-12-28 16:07 UTC, Julian Ospald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2012-12-28 16:07:18 UTC
Created attachment 333598 [details]
dosbox-0.74:20121228-154251.log

relevant lines:

clang++ -DHAVE_CONFIG_H -I. -I..  -I../include -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -march=core2 -O3  -c -o dosbox.o dosbox.cpp
clang++  -march=core2 -O3   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o dosbox dosbox.o  cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a  hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a -lSDL_sound -lasound -lm -ldl -lpthread -lSDL -lpng -lz -lSDL_net -lX11 -lGL
cpu/libcpu.a(core_dynrec.o): In function `CreateCacheBlock(CodePageHandlerDynRec*, unsigned int, unsigned long)':
core_dynrec.cpp:(.text+0x291c): relocation truncated to fit: R_X86_64_32S against symbol `Segs' defined in .bss section in cpu/libcpu.a(cpu.o)
core_dynrec.cpp:(.text+0x164f3): relocation truncated to fit: R_X86_64_32S against symbol `cpu_regs' defined in .bss section in cpu/libcpu.a(cpu.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Julian Ospald 2012-12-28 16:09:06 UTC
see also: http://clang.debian.net/logs/2012-06-23/dosbox_0.74-3_unstable_clang.log


# clang --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-pc-linux-gnu
Thread model: posix

# cat /etc/portage/env/clang
FEATURES="-ccache -buildpkg -distcc -splitdebug"
USE="clang"
CC=clang
CXX=clang++
CFLAGS="-march=core2 -O3"
CXXFLAGS="${CFLAGS}"


# emerge --info
Portage 2.2.0_alpha149 (default/linux/amd64/10.0, gcc-4.5.4, glibc-2.15-r3, 3.4.9-gnu-ck3 x86_64)
=================================================================
System uname: Linux-3.4.9-gnu-ck3-x86_64-Intel-R-_Core-TM-2_CPU_6400_@_2.13GHz-with-gentoo-2.1
Timestamp of tree: Mon, 24 Dec 2012 13:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.8 [enabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.5.4-r4, 2.6.8, 2.7.3-r2, 3.1.5, 3.2.3
dev-util/ccache:          3.1.8
dev-util/cmake:           2.8.10.2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.1, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.7, 4.5.4, 4.6.3, 4.7.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo crossdev hasufell-overlay gentoo-zh neurogeek sunrise hasufell arx-libertatis
Installed sets: @optional, @steam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -Wall -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/applications /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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 -Wall -ggdb"
DISTDIR="/home/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://de-mirror.org/gentoo/ ftp://mirror.netcologne.de/gentoo/ ftp://gentoo.imj.fr/pub/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j2"
PKGDIR="/home/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-z -9"
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/local/crossdev /usr/local/portage /var/lib/layman/gentoo-zh /var/lib/layman/neurogeek /var/lib/layman/sunrise /var/lib/layman/hasufell /var/lib/layman/arx-libertatis"
SYNC="rsync://rsync1.de.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 apng bash-completion berkdb bzip2 cairo cdr cli consolekit cracklib crypt cscope css cxx dbus dri dv dvd dvdr exif fat ffmpeg flac fontconfig fortran gdbm gif gpm gstreamer hddtemp iconv icq ipv6 jabber java jpeg jpeg2k lame libnotify lm_sensors matroska mmx modules mp3 mp4 mpeg mudflap multilib musepack ncurses nls nptl nsplugin ntfs ogg opengl openmp oscar pam pcre pdf png policykit pppd python raw readline sdl session sound sse sse2 ssl ssse3 svg tcpd tiff timidity truetype udev unicode usb v4l vcd vdpau vim-syntax vnc vorbis wavpack wmf x264 xv xvid xvmc zlib" 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="authn_core authz_core socache_shmcb unixd 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="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="evdev keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer wiki-publisher" LINGUAS="de en" NETBEANS_MODULES="*" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="*" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" 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"
USE_PYTHON="2.5 2.6 2.7 3.1 3.2"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Fabio Scaccabarozzi 2015-01-18 13:39:35 UTC
I am unable to reproduce the issue with clang-3.5.0 and dosbox-0.74, everything looks good and tests pass.

Note that I'm using the gold linker with binutils-2.24-r3, and this was a linker error (or maybe an incompatibility between old clang and binutils).

Can you please try and see if this bug can be reproduced with clang-3.5.0 and a newer binutils version?
Comment 3 Julian Ospald 2015-01-18 14:25:10 UTC
fails at linking stage now
Comment 4 Julian Ospald 2015-01-18 14:25:56 UTC
as in: exact same error
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2015-01-18 15:08:34 UTC
Does -9999 build?
Comment 6 Julian Ospald 2015-01-18 21:13:48 UTC
it only works if I add -fPIC to cflags/cxxflags
Comment 7 Mr. Bones. (RETIRED) gentoo-dev 2015-01-21 21:13:09 UTC
try -9999 again and see if that recent commit helped.
Comment 8 Julian Ospald 2015-01-22 00:52:43 UTC
(In reply to Mr. Bones. from comment #7)
> try -9999 again and see if that recent commit helped.

seems to work
Comment 9 Mr. Bones. (RETIRED) gentoo-dev 2015-01-22 03:40:01 UTC
There's word that -O0 is also needed to make the resulting binary actually useful for running more complicated dos programs.
Comment 10 Austin English (RETIRED) gentoo-dev 2016-06-03 04:16:36 UTC
I pushed a patch to my local fork here:
https://github.com/austin987/gentoo/commit/4ee3caba67cb9c355f915693917e871cba7718a4

This lets me compile dosbox 0.74 with clang 3.5.
Comment 11 Mr. Bones. (RETIRED) gentoo-dev 2016-06-03 05:56:37 UTC
Just use the live build for dosbox.  It usually works great and should already be clang-friendly.
Comment 12 Austin English (RETIRED) gentoo-dev 2016-06-03 07:25:18 UTC
(In reply to Mr. Bones. from comment #11)
> Just use the live build for dosbox.  It usually works great and should
> already be clang-friendly.

I don't see why we can't fix bugs that exist in existing ebuilds. I personally don't have a need for dosbox on my machine, my goal is to fix the problem with clang.
Comment 13 Pacho Ramos gentoo-dev 2016-06-06 18:49:18 UTC
Mr. Bones, Have you think in making a snapshot of dosbox to fix this (and probably, many other bugs)? In general it would be better to try to have a fixed "stalled" version instead of pushing people to use a live ebuild that can break at any time if upstream makes any mistake

Thanks
Comment 14 Austin English (RETIRED) gentoo-dev 2016-06-22 03:01:27 UTC
(In reply to Austin English from comment #10)
> I pushed a patch to my local fork here:
> https://github.com/austin987/gentoo/commit/
> 4ee3caba67cb9c355f915693917e871cba7718a4
> 
> This lets me compile dosbox 0.74 with clang 3.5.

I'm going to commit this in 1 week, unless there is a technical objection to that.
Comment 15 Austin English (RETIRED) gentoo-dev 2016-06-28 08:34:11 UTC
(In reply to Austin English from comment #14)
> (In reply to Austin English from comment #10)
> > I pushed a patch to my local fork here:
> > https://github.com/austin987/gentoo/commit/
> > 4ee3caba67cb9c355f915693917e871cba7718a4
> > 
> > This lets me compile dosbox 0.74 with clang 3.5.
> 
> I'm going to commit this in 1 week, unless there is a technical objection to
> that.

Fixed by https://github.com/gentoo/gentoo/commit/143e036505e2b27b1aa5037d52a5f999391b4168
Comment 17 Mr. Bones. (RETIRED) gentoo-dev 2016-06-29 03:56:40 UTC
clang patch is part of the dosbox-3989 snapshot build but I encourage people who have system-wide clang to use dosbox-9999.
Comment 18 Pacho Ramos gentoo-dev 2016-06-29 12:41:18 UTC
(In reply to Mr. Bones. from comment #17)
> clang patch is part of the dosbox-3989 snapshot build but I encourage people
> who have system-wide clang to use dosbox-9999.

It seems that the snapshot is not keyworded on any arch... then, even people running testing won't get the fixes. Was that a mistake or... :/
Comment 19 Pacho Ramos gentoo-dev 2016-06-29 12:44:54 UTC
CCing QA team because of this strange "policy" of not keywording snapshots and forcing people to use a live ebuild for getting bugs fixed
Comment 20 Austin English (RETIRED) gentoo-dev 2016-06-29 22:34:42 UTC
(In reply to Pacho Ramos from comment #19)
> CCing QA team because of this strange "policy" of not keywording snapshots
> and forcing people to use a live ebuild for getting bugs fixed

QA has fixed this here:
https://github.com/gentoo/gentoo/commit/5edb412a63031c0372093d5e5fb038e5da4f52f1