Bug 1219521 - dmd compiler cannot find standard library
Summary: dmd compiler cannot find standard library
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Marc Schütz
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-03 16:25 UTC by Andrea Manzini
Modified: 2024-07-03 06:53 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Manzini 2024-02-03 16:25:59 UTC
To reproduce on a Tumbleweed installation:

# zypper in dmd dub

sudo zypper in dub dmd
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following recommended package was automatically selected:
  phobos-devel

The following 4 NEW packages are going to be installed:
  dmd dub libphobos2-0_105 phobos-devel


# cat > main.d
import std.stdio;
void main()
{
    writeln("Hello, world");
}

# dmd main.d

/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: cannot find -lphobos2: No such file or directory
collect2: error: ld returned 1 exit status
Error: linker exited with status 1

as a workaround, installing 

# zypper in phobos-devel-static 

the main executable gets created
Comment 1 Boehmer 2024-06-29 15:19:47 UTC
I see the same issue on a Tumbleweed installation.

Error: linker exited with status 255
       cc hello.o -o hello -m64 -Xlinker --export-dynamic -L/usr/lib64 -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic -lpthread -lm -lrt -l

Obviously the DMD compiler requests to link the phobos2 library statically.

Thus the package 'phobos-devel-static' should go into the recommended packages for DMD.
Comment 2 Andrea Manzini 2024-07-03 06:53:09 UTC
fixed with latest update to 2.109.1:

https://build.opensuse.org/request/show/1185046