Re: Instruct gdc to look for standard library in another directory
On Saturday, 1 July 2023 at 15:36:55 UTC, Johann wrote: On Saturday, 1 July 2023 at 10:18:43 UTC, Iain Buclaw wrote: Is it too much to ask downstream package maintainers to politely use `/usr/share/dlang/{ldc,dmd}` ? :-) Thanks for your help, Iain. I am going to report a bug to the distro maintainers then. Meanwhile, I found out the problem can be worked around by using `-nostdinc` option. ``` -nostdinc Do not search the standard system directories for D source and interface files. Only the directories that have been specified with -I options (and the directory of the current file, if appropriate) are searched. ```
Re: Instruct gdc to look for standard library in another directory
On Saturday, 1 July 2023 at 10:18:43 UTC, Iain Buclaw wrote: Is it too much to ask downstream package maintainers to politely use `/usr/share/dlang/{ldc,dmd}` ? :-) Thanks for your help, Iain. I am going to report a bug to the distro maintainers then.
Re: Instruct gdc to look for standard library in another directory
On Saturday, 1 July 2023 at 06:53:02 UTC, Johann wrote: I have both `ldc` and `gdc` install on my OpenSUSE tumbleweed machine. ` Without `ldc-runtime-devel`, `gdc` is able to compile successfully. [--snip--] How may I fix it? I tried to use "-I" and "-B" option, but to no avail. Looks like ldc [might be too old](https://packagehub.suse.com/packages/ldc/1_29_0-bp155_3_26/)? Regardless, I'd ask the package maintainers why they are putting compiler-dependent sources in /usr/include/d. Actually, just any D sources in `/usr/include` has always seemed dubious to me. i.e: On my system... - Ada "includes" are installed into `/usr/share/ada/adainclude` - Go "includes" are installed into `/usr/share/gocode/src` - Rust "includes" are installed into `/usr/share/cargo/registry` - Haskell "includes" are installed into `/usr/lib/haskell-packages` - Ocaml "includes" are installed into `/usr/lib/ocaml` Is it too much to ask downstream package maintainers to politely use `/usr/share/dlang/{ldc,dmd}` ? :-)
Re: Regression - quality of generated x86-64 code between GDC v12.3 and v13.1
On Thursday, 8 June 2023 at 11:39:38 UTC, Iain Buclaw wrote: On Thursday, 8 June 2023 at 04:13:30 UTC, Cecil Ward wrote: I wrote a very small procedure in D and the x86-64 asm code generated in GDC 12.3 was excellent whereas that from 13.1 was insanely bloated, totally different. Note: the badness is independent of the -On optimisation level (-O3 used initially.) So you're saying that a 4-int struct is not being treated as equivalent to an `int[4]`? https://d.godbolt.org/z/G77fW48xG If possible, a bug report would be great on this. Fix has been committed to mainline and gcc-13. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=f2eeda5652438fe783d4e3878139481a1b8606b6;hp=09124b7ed7709721e86556b4083ef40925d7489b
Instruct gdc to look for standard library in another directory
I have both `ldc` and `gdc` install on my OpenSUSE tumbleweed machine. Without `ldc-runtime-devel`, `gdc` is able to compile successfully. ```bash binary/usr/lib64/gcc/x86_64-suse-linux/13/d21 version v2.103.0-rc.1 predefs GNU D_Version2 LittleEndian GNU_DWARF2_Exceptions GNU_StackGrowsDown GNU_InlineAsm D_LP64 assert D_PreConditions D_PostConditions D_Invariants D_ModuleInfo D_Exceptions D_TypeInfo all X86_64 D_HardFloat Posix linux CRuntime_Glibc CppRuntime_Gcc parse app importall app import object (/usr/lib64/gcc/x86_64-suse-linux/13/include/d/object.d) ... rest omitted ``` However, after installing `ldc-runtime-devel`, gdc fails to compile a "hello world" because it tries to use the phobos library provided by ldc. gdc installs its library at `/usr/lib64/gcc/x86_64-suse-linux/13/include/d/` ldc installs its library at `/usr/include/d` `gdc -v source/app.d` shows, ```bash gcc version 13.1.1 20230522 [revision dd36656ada05731c069ecd5b1878380294fb1f3e] (SUSE Linux) COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a-' /usr/lib64/gcc/x86_64-suse-linux/13/d21 source/app.d -quiet -dumpdir a- -dumpbase app.d -dumpbase-ext .d -mtune=generic -march=x86-64 -version -v -o /tmp/ccFpibdu.s GNU D (SUSE Linux) version 13.1.1 20230522 [revision dd36656ada05731c069ecd5b1878380294fb1f3e] (x86_64-suse-linux) compiled by GNU C version 13.1.1 20230522 [revision dd36656ada05731c069ecd5b1878380294fb1f3e], GMP version 6.2.1, MPFR version 4.2.0-p9, MPC version 1.3.1, isl version isl-0.26-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 binary/usr/lib64/gcc/x86_64-suse-linux/13/d21 version v2.103.0-rc.1 predefs GNU D_Version2 LittleEndian GNU_DWARF2_Exceptions GNU_StackGrowsDown GNU_InlineAsm D_LP64 assert D_PreConditions D_PostConditions D_Invariants D_ModuleInfo D_Exceptions D_TypeInfo all X86_64 D_HardFloat Posix linux CRuntime_Glibc CppRuntime_Gcc parse app importall app importobject(/usr/include/d/object.d) importcore.attribute(/usr/include/d/core/attribute.d) import gcc.attributes (/usr/lib64/gcc/x86_64-suse-linux/13/include/d/gcc/attributes.d) importcore.internal.hash(/usr/include/d/core/internal/hash.d) import core.internal.traits (/usr/include/d/core/internal/traits.d) import core.internal.entrypoint (/usr/include/d/core/internal/entrypoint.d) import core.internal.array.appending (/usr/include/d/core/internal/array/appending.d) import core.internal.array.comparison (/usr/include/d/core/internal/array/comparison.d) import core.internal.array.equality (/usr/include/d/core/internal/array/equality.d) import core.internal.array.casting (/usr/include/d/core/internal/array/casting.d) import core.internal.array.concatenation (/usr/include/d/core/internal/array/concatenation.d) import core.internal.array.construction (/usr/include/d/core/internal/array/construction.d) import core.internal.array.arrayassign (/usr/include/d/core/internal/array/arrayassign.d) import core.internal.array.capacity (/usr/include/d/core/internal/array/capacity.d) import core.internal.dassert (/usr/include/d/core/internal/dassert.d) importcore.atomic (/usr/include/d/core/atomic.d) import core.internal.attributes (/usr/include/d/core/internal/attributes.d) import core.internal.atomic (/usr/include/d/core/internal/atomic.d) import gcc.builtins (/usr/lib64/gcc/x86_64-suse-linux/13/include/d/gcc/builtins.d) import gcc.config (/usr/lib64/gcc/x86_64-suse-linux/13/include/d/gcc/config.d) import core.internal.destruction (/usr/include/d/core/internal/destruction.d) import core.internal.moving (/usr/include/d/core/internal/moving.d) import core.internal.postblit (/usr/include/d/core/internal/postblit.d) import core.internal.switch_ (/usr/include/d/core/internal/switch_.d) importcore.lifetime (/usr/include/d/core/lifetime.d) importcore.builtins (/usr/include/d/core/builtins.d) importstd.stdio (/usr/include/d/std/stdio.d) importcore.stdc.stddef (/usr/include/d/core/stdc/stddef.d) import std.algorithm.mutation (/usr/include/d/std/algorithm/mutation.d) importstd.traits(/usr/include/d/std/traits.d) importstd.meta (/usr/include/d/std/meta.d) import std.range.primitives (/usr/include/d/std/range/primitives.d) importstd.typecons (/usr/include/d/std/typecons.d) importstd.format.spec (/usr/include/d/std/format/spec.d) importstd.format.write (/usr/include/d/std/format/write.d) import std.format.internal.write (/usr/include/d/std/format/internal/write.d) import std.internal.attributes (/usr/include/d/std/internal/attributes.d) importstd.range (/usr/include/d/std/range/package.d) importstd.array (/usr/include/d/std/array.d) importstd.functional(/usr/include/d/std/functional.d) importstd.conv