Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914715 - sys-devel/gcc fails to build with Dlang support
Summary: sys-devel/gcc fails to build with Dlang support
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-25 18:56 UTC by 331947hi
Modified: 2023-09-27 07:13 UTC (History)
2 users (show)

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


Attachments
* Please include /var/tmp/portage/sys-devel/gcc-13.2.1_p20230826/work/gcc-build-logs.tar.xz in your bug report. (gcc-build-logs.tar.xz,7.23 KB, application/x-xz)
2023-09-25 18:56 UTC, 331947hi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 331947hi 2023-09-25 18:56:28 UTC
Created attachment 871442 [details]
* Please include /var/tmp/portage/sys-devel/gcc-13.2.1_p20230826/work/gcc-build-logs.tar.xz in your bug report.

I want to build and install onedrive from the joecool-overlay. This requires support for the D programming language. When I set the USE=d flag, either globally or just for gcc, it will compile and then fail at a certain point. I have confirmed that this is a recurring error, and disabling the d USE flag will let it compile just fine. 

Attached are logs and build info, anything that Portage recommended I do upon encountering this error. I have omitted URLs because of the gentoo bugzilla policy, and I am impatient.
Comment 1 331947hi 2023-09-25 18:58:37 UTC
Output of "emerge --info '=sys-devel/gcc-13.2.1_p20230826::gentoo'":
```Portage 3.0.49 (python 3.11.5-final-0, default/linux/amd64/17.1/desktop, gcc-12, glibc-2.37-r3, 6.1.53-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.53-gentoo-dist-x86_64-AMD_Ryzen_5_5600X_6-Core_Processor-with-glibc2.37         : command-line option '-Wimplicit-function-declaration' is valid for C/O
KiB Mem:    16283060 total,   1023412 free
KiB Swap:    6291452 total,   6291452 free
Timestamp of repository gentoo: Mon, 25 Sep 2023 11:00:01 +0000
Head commit of repository gentoo: 0d2d88f34936fb54005c8dcf0dbe8eb1aaebf3d3
Timestamp of repository dlang: Mon, 11 Sep 2023 11:32:49 +0000
Head commit of repository dlang: 62daa0cdcdc5d4b0b7b87edcc23fb2726f8af994
a-libs/libvpx-1.13.0/work/libvpx-1.13.0/vp9 -I/var/tmp/portage/media-libs/libvpx-1.13.0/
Timestamp of repository guru: Mon, 25 Sep 2023 10:18:17 +0000
Head commit of repository guru: 4cdab542f63bbf2c9a29ac066c44d5e8d67a77d3
r -msse -msse2 -msse3 -mmmx -m3dnow -ftree-vectorize -flto -m64 -DNDEBUG -fPIC -U_FORTIF
Timestamp of repository joecool-overlay: Wed, 20 Sep 2023 16:16:41 +0000
Head commit of repository joecool-overlay: ab2cf4cb48c9f294b84303d52ac7826b9e2341c7
Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wimplicit-function-declaration -Wmissing
Head commit of repository librewolf: 8b30ac34d5317dda3808fdbcf67a2aee49778594
er-than=52000 -std=gnu89 -I. -I"/var/tmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.
Timestamp of repository steam-overlay: Sat, 23 Sep 2023 20:31:33 +0000
Head commit of repository steam-overlay: 275ac47be3a1baa90b370f1600884e2f979e5bd7
x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.13.0/t
sh dash 0.5.12
ld GNU ld (Gentoo 2.40 p5) 2.40.0
ccache version 4.8.2 [enabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.5::gentoo
dev-lang/rust:             1.71.1::gentoo
dev-lang/rust-bin:         1.72.0::gentoo
dev-util/ccache:           4.8.2::gentoo
dev-util/cmake:            3.26.5-r2::gentoo
dev-util/meson:            1.2.1-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.37::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/gcc:             11.3.1_p20230427::gentoo, 12.3.1_p20230526::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:
work/libvpx-1.13.0/vp9 -I/var/tmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.13.0/th
gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: OMITTED
    priority: -1000
    volatile: False
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
hird_party/libwebm -I/var/tmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.13.0/vp8 -I
dlang
    location: /var/db/repos/dlang
    sync-type: git
    sync-uri: OMITTED
    masters: gentoo
    volatile: False
ion-after-statement -Wdisabled-optimization -Wextra-semi -Wfloat-conversion -Wformat=2 -
guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: OMITTED
    masters: gentoo
    volatile: False
hird_party/libwebm -I/var/tmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.13.0/vp8 -I
joecool-overlay
    location: /var/db/repos/joecool-overlay
    sync-type: git
    sync-uri: OMITTED
    masters: gentoo
    volatile: False
ion-after-statement -Wdisabled-optimization -Wextra-semi -Wfloat-conversion -Wformat=2 -
librewolf
    location: /var/db/repos/librewolf
    sync-type: git
    sync-uri: OMITTED
    masters: gentoo
    volatile: False
hird_party/libwebm -I/var/tmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.13.0/vp8 -I
steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: OMITTED
    masters: gentoo
    volatile: False
ion-after-statement -Wdisabled-optimization -Wextra-semi -Wfloat-conversion -Wformat=2 -
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=znver3 -mtune=znver3 -pipe -fomit-frame-pointer -msse -msse2 -msse3 -mmmx -m3dnow -ftree-vectorize -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=znver3 -mtune=znver3 -pipe -fomit-frame-pointer -msse -msse2 -msse3 -mmmx -m3dnow -ftree-vectorize -flto"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--ask"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O3 -pipe -march=znver3 -mtune=znver3 -pipe -fomit-frame-pointer -msse -msse2 -msse3 -mmmx -m3dnow -ftree-vectorize -flto"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-stmp/portage/media-libs/libvpx-1.13.0/work/libvpx-1.13.0/trict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O3 -pipe -march=znver3 -mtune=znver3 -pipe -fomit-frame-pointer -msse -msse2 -msse3 -mmmx -m3dnow -ftree-vectorize -flto"
GENTOO_MIRRORS=I am omitting URLs here
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j13"
PKGDIR="/var/cache/binpkgs"
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="/var/tmp"
USE="aac acpi alsa amd64 branding builtin bzip2 cli crypt d dbus dri elogind encode gdbm gif gles2 gpm gstreamer gtk gui iconv icu introspection jpeg lcms ldap libnotify libtirpc libvirt lto mp3 mp4 mpeg multilib ncurses nptl ogg opengl openmp pam pango pcre pdf pipewire png policykit polkit pulseaudio qemu qt5 readline sdl seccomp server sound split-usr ssl svg test-rust tiff truetype udev udisks unicode upower usb virgl vorbis vulkan wayland wxwidgets x264 xattr xml xvid zlib" ABI_X86="32 64" ADA_TARGET="gnat_2021" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SHELL, SIZE, STRINGS, STRIP, YACC, YFLAGS```

Output of "emerge -pqv '=sys-devel/gcc-13.2.1_p20230826::gentoo'":
```[ebuild  NS   ] sys-devel/gcc-13.2.1_p20230826 [11.3.1_p20230427, 12.3.1_p20230526] USE="(cxx) d* lto* (multilib) nptl openmp (pie) sanitize ssp -ada (-cet) (-custom-cflags) -debug -default-stack-clash-protection -default-znow -doc (-fixed-point) -fortran -go -graphite -hardened (-ieee-long-double) -jit (-libssp) -modula2% -nls -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv -zstd"```
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-25 19:15:12 UTC
Your emerge --info appears to be extremely mangled?
Comment 3 Arsen Arsenović gentoo-dev 2023-09-25 19:40:18 UTC
it seems that the currently selected toolchain does not have the 'd' USE-flag enabled.

unfortunately, the process for setting up D and Ada support is a bit roundabout currently, and requires manual intervention.

you should build sys-devel/gcc:11[d] first (11 is the last version which is not self-hosting, i.e. written in D), select that via eselect gcc, and build sys-devel/gcc[d] with it.  if you also want ada, you might need even older gcc (dev-lang/gnat-gpl[d,ada], maybe sys-devel/gcc:10 works too?)

upon completing that, you can get rid of the old version.  as long as you don't 'break the chain', you should be able to continually have D (and Ada) support.
Comment 4 Mike Gilbert gentoo-dev 2023-09-25 20:33:06 UTC
Sounds like CANTFIX?
Comment 5 Arsen Arsenović gentoo-dev 2023-09-25 20:54:24 UTC
possibly, but there are still some things we could do here.  1) portage should require one of those packages to exist, 2) we should error in pkg_pretend about it presumably
Comment 6 331947hi 2023-09-25 21:54:17 UTC
(In reply to Arsen Arsenović from comment #3)
> it seems that the currently selected toolchain does not have the 'd'
> USE-flag enabled.
> 
> unfortunately, the process for setting up D and Ada support is a bit
> roundabout currently, and requires manual intervention.
> 
> you should build sys-devel/gcc:11[d] first (11 is the last version which is
> not self-hosting, i.e. written in D), select that via eselect gcc, and build
> sys-devel/gcc[d] with it.  if you also want ada, you might need even older
> gcc (dev-lang/gnat-gpl[d,ada], maybe sys-devel/gcc:10 works too?)
> 
> upon completing that, you can get rid of the old version.  as long as you
> don't 'break the chain', you should be able to continually have D (and Ada)
> support.

Acknowledged, I will do this the next time I have a chance. Meanwhile, it is my understanding that portage shouldn't have a compile error, or at least have some guidance on how to fix it. I read the wiki on Dlang support, although my dumb brain didn't seem to comprehend that this was a problem I may run into.
Comment 7 Mike Gilbert gentoo-dev 2023-09-25 21:57:21 UTC
(In reply to Arsen Arsenović from comment #5)

I hesitate to error in pkg_pretend based on has_version checks; that doesn't work out well when cross compiling or using some other custom toolchain.

It seems like a better idea to test the toolchain by invoking in src_configure and error out there.
Comment 8 Arsen Arsenović gentoo-dev 2023-09-26 01:12:21 UTC
sure, that makes sense too
Comment 9 Andrei Horodniceanu 2023-09-26 09:03:23 UTC
(In reply to 331947hi from comment #0)
> I want to build and install onedrive from the joecool-overlay. This requires
> support for the D programming language. When I set the USE=d flag, either
> globally or just for gcc, it will compile and then fail at a certain point.
> I have confirmed that this is a recurring error, and disabling the d USE
> flag will let it compile just fine. 

If you specifically want to use the onedrive package in the joecool-overlay then you would have to do as Arsen explained, build an older version of gcc first (any gcc-11* works) and then try again to build the newer versions.

However, if you are fine using another overlay, since you have the dlang overlay enabled you can try installing onedrive from there as it is the same version. This would allow you to use one of the other 2 D compilers, which are a bit easier to bootstrap. If you don't really care about which D compiler you choose and only want a working onedrive client I recommend you do:
1. Add this to package.use/onedrive (the name of the file doesn't matter):

net-misc/onedrive::dlang dmd-2_099

2. Run: emerge net-misc/onedrive::dlang

This should be the simplest way to get a working onedrive if you don't have a D compiler installed. As a bonus, dmd compiles pretty fast for a compiler so you won't even have to wait long.

If you, at some point, will want to change the compiler used to build onedrive, just change the `dmd-2_099` use flag to what you prefer, so long as it exists in the dlang overlay.
Comment 10 331947hi 2023-09-26 21:26:55 UTC
The GCC D compiler works now. I am impressed by your speedy response to the support ticket. There was a compile error with DMD though. However, I require admin access from my organisation to sync onedrive *facepalm*.

Anyways, what do I mark this as? Can I assume its not resolved yet as there is work to be done in regards to Portage's error handling for the D compiler packages?
Comment 11 331947hi 2023-09-26 21:30:31 UTC
(In reply to 331947hi from comment #10)
> The GCC D compiler works now. I am impressed by your speedy response to the
> support ticket. There was a compile error with DMD though. However, I
> require admin access from my organisation to sync onedrive *facepalm*.
> 
> Anyways, what do I mark this as? Can I assume its not resolved yet as there
> is work to be done in regards to Portage's error handling for the D compiler
> packages?

Sorry, i forgot to mention the issue was solved by selecting the self-hosting GCC version 11 and then compiling onedrive and any future GCC versions using that.
Comment 12 Arsen Arsenović gentoo-dev 2023-09-26 22:14:38 UTC
(In reply to 331947hi from comment #11)

> Sorry, i forgot to mention the issue was solved by selecting the
> self-hosting GCC version 11 and then compiling onedrive and any future GCC
> versions using that.
you don't need to compile future GCC versions with that one, if you emerged gcc:13[d].  as long as you keep the 'chain'.

ps: self-hosting versions are those written in the language they compile, so that'd be gcc-12+.  gcc-11 works because gdc in it is not self hosting
Comment 13 Andrei Horodniceanu 2023-09-26 22:20:31 UTC
(In reply to 331947hi from comment #10)
> The GCC D compiler works now. I am impressed by your speedy response to the
> support ticket. There was a compile error with DMD though. However, I
> require admin access from my organisation to sync onedrive *facepalm*.

If you could I'd appreciate you opening an issue at https://github.com/gentoo/dlang about the error with DMD. A build.log would help me fix the problem for future users.
Comment 14 Arsen Arsenović gentoo-dev 2023-09-26 22:25:42 UTC
hmm.  i'm surprised gcc 13 works where dmd does not given that dmd is also the frontend for gdc
Comment 15 Andrei Horodniceanu 2023-09-27 07:11:23 UTC
(In reply to Arsen Arsenović from comment #14)
> hmm.  i'm surprised gcc 13 works where dmd does not given that dmd is also
> the frontend for gdc

Though all the D compilers have the same frontend they have them at different versions, gcc-11 is using dmd-2.076 (I don't know how heavily patched since 2.068 was the first version to require a D compiler being present), gcc-12 is on 2.100 and gcc-13 is on 2.103. This is the usual cause for failures, the dmd version supporting or not supporting a certain feature.

Sometimes however, this frontend can have tiny differences across the 3 compilers. In this particular case, plain onedrive doesn't build with gdc because gdc is missing the module: etc/c/sqlite3. The version in ::dlang is affected by this and, if trying to compiled with any gdc, it will result in a failure. The version in ::joecool however does include a patch to enable this compatibility and, I assume, will build just fine.