Bug 1781685 - gdc: Cannot compile D source if ldc-druntime-devel is installed
Summary: gdc: Cannot compile D source if ldc-druntime-devel is installed
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: ldc
Version: 31
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-10 11:46 UTC by Borax Man
Modified: 2020-08-21 14:17 UTC (History)
15 users (show)

Fixed In Version: ldc-1.23.0-1.fc33
Clone Of:
Environment:
Last Closed: 2020-08-21 14:17:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Borax Man 2019-12-10 11:46:09 UTC
Description of problem:
GDC fails to compile any D source file if LDC is installed.  GDC reports multiple compilation errors.  GDC works as expected if LDC is not installed.

Version-Release number of selected component (if applicable): 9.2.1-1


How reproducible:
Reproducible all the time.

Steps to Reproduce:
1.  Ensure gcc-gdc and ldc-druntime-devel both installed.  ldc-druntime-devel is a dependency of ldc
2.  Invoke gdc to compile a D source file.


Actual results:
GDC fails with multiple compilation errors concerning source files in /usr/include/d/core/internal


Expected results:
GDC to compile and link successfully.

Additional info:
Removing ldc (or more specifically ldc-druntime-devel) fixes the problem.  The issue seems to be that with ldc-druntime-devel, gdc uses the .d source files located at /usr/include/d/core/internal, which belong to ldc-druntime-devel, instead of the source files at /usr/lib/gcc/x86_64-redhat-linux/9/include/d, which are owned by gcc-gdc.

By removing LDC, GDC then uses its own .d source files.

This is a bug because the precense of ldc shouldn't break gdc, and that it may be required for users to have both packages installed to run D programs.

Also see https://forum.dlang.org/thread/esijvgxtcyoxivrtpmgx@forum.dlang.org

Comment 1 Jakub Jelinek 2020-03-31 14:04:52 UTC
If you read the forum, you'll see that it is a ldc bug, not gcc.

Comment 2 Iain Buclaw 2020-04-21 05:01:16 UTC
More specifically, the environment variable required to set up a proper location to install modules.

https://salsa.debian.org/d-team/ldc/-/blob/debian/master/debian/rules#L11

An extra patch is required to re-add /usr/include/d back into the search paths.

https://salsa.debian.org/d-team/ldc/-/blob/d3a8be556a8a5fcabc8bd98e5ff561b2185c4057/debian/patches/02_ldc_include_path.diff

Comment 3 Kalev Lember 2020-08-21 14:17:22 UTC
I just spent some time looking into this and I think I got this issue resolved in ldc-1.23.0-1.fc33

The idea is that gdc installs its internal D runtime headers into a private directory under /usr/lib/gdc, and ldc installs its private headers into /usr/lib/ldc, and then /usr/include/d contains only shared library headers that both compilers can use. Does this sounds about right?

https://src.fedoraproject.org/rpms/ldc/c/4150b474999ba50f6708603f4c0d8602d5bd9808


Note You need to log in before you can comment on or make changes to this bug.