Bug 262645

Summary: devel/dub linker error while building dub quarterly.
Product: Ports & Packages Reporter: Alain De Vos <devosalain>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (acm)
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description Alain De Vos 2022-03-18 10:52:56 UTC
I disabled 32bit code in the kernel, maybe? this created the following error while building dub :

[00:02:18] ===========================================================================
[00:02:18] =======================<phase: configure >============================
[00:02:18] ===> Configuring for dub-1.14.0
[00:02:23] ===========================================================================
[00:02:23] =======================<phase: build >============================
[00:02:23] ===> Building for dub-1.14.0
[00:02:41] build.sh: cannot open 2.069.0: No such file or directory
[00:02:41] Using existing version file.
[00:02:41] Running ldmd2...
[00:02:58] Serializing composite type BuildRequirements which has no serializable fields
[00:02:58] Serializing composite type BuildOptions which has no serializable fields
[00:02:59] source/dub/dub.d(1602): Deprecation: function std.typecons.Nullable!(PackageRecipe).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
[00:02:59] source/dub/packagesuppliers/maven.d(81): Deprecation: module std.xml is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
[00:02:59] source/dub/project.d(288): Deprecation: variable c is shadowing variable dub.project.Project.validate.c. Rename the foreach variable.
[00:03:00] source/dub/generators/build.d(338): Deprecation: module std.digest.digest is deprecated - import std.digest instead of std.digest.digest. std.digest.digest will be removed in 2.101
[00:04:19] ld: error: undefined hidden symbol: __start___minfo
[00:04:19] >>> referenced by sdl.d
[00:04:19] >>> bin/dub.o:(ldc.register_dso)
[00:04:19]
[00:04:19] ld: error: undefined hidden symbol: __stop___minfo
[00:04:19] >>> referenced by sdl.d
[00:04:19] >>> bin/dub.o:(ldc.register_dso)
[00:04:19] cc: error: linker command failed with exit code 1 (use -v to see invocation)
[00:04:19] Error: /usr/bin/cc failed with status: 1
[00:04:19] *** Error code 1
[00:04:19]
[00:04:19] Stop.
[00:04:19] make: stopped in /usr/ports/devel/dub
[00:04:20] =>> Cleaning up wrkdir
[00:04:20] ===> Cleaning for dub-1.14.0
[00:04:23] build of devel/dub | dub-1.14.0 ended at Fri Mar 18 03:59:34 CET 2022
[00:04:23] build time: 00:04:23
[00:04:23] !!! build failure encountered !!!

Reference to dlang site,
https://forum.dlang.org/post/wwxvnixnfywujimigwhk@forum.dlang.org
Comment 2 Alain De Vos 2022-09-02 20:57:09 UTC
Currently:
[00:00:01] Host OSVERSION: 1301000
[00:00:01] Jail OSVERSION: 1301000
Yet, same weird problem
Comment 3 Alain De Vos 2022-09-06 17:16:30 UTC
Could it be there is left over 32-bit code in dub.
Or because ldc is still dependent of the old "devel/llvm70" 
With gcc linker i don't get undefined symbol error but i do get this error with clang/llvm.
Comment 4 Alain De Vos 2022-09-07 03:09:33 UTC
Or in my KERNELCONFIG FILE I have,

nooption 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
nooption 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
nooption 	COMPAT_FREEBSD6		# Compatible with FreeBSD6
nooption 	COMPAT_FREEBSD7		# Compatible with FreeBSD7
nooption 	COMPAT_FREEBSD9		# Compatible with FreeBSD9
nooption 	COMPAT_FREEBSD10	# Compatible with FreeBSD10

nooption 	COMPAT_FREEBSD32	# Compatible with i386 binaries

Could this be the reason.
In Gentoo-Linux I do not experience this problem so it is weird.
Comment 5 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2022-09-08 03:20:27 UTC
Hi Alain, I have abandoned this port a bit because lts bootstrap is not working with latest version of clang. We need compile a gdc compiler like bootstrap and with it compiles newest version of ldc. Nowadays gcc include a (gdc) gcc-based d compiler but it must be added to ports tree.

If you need use ldc on FreeBSD you could try binary package from ldc project. It only supports amd64

https://github.com/ldc-developers/ldc/releases

I'll keep open this PR and I'll update when I have news aout ldc on ports tree
Comment 6 Alain De Vos 2022-09-20 07:04:18 UTC
Downloading ldc2 tarball from git is not working.
I receive the following error
```
HOST:x: /home/x/Dirs/Src/languages/dlangtut/a42_treeview >dub
Performing "debug" build using ldc2 for x86_64.
gtk-d:gtkd 3.9.0: target for configuration "library" is up to date.
gtk-d:gstreamer 3.9.0: target for configuration "library" is up to date.
gtk-d:peas 3.9.0: target for configuration "library" is up to date.
gtk-d:sv 3.9.0: target for configuration "library" is up to date.
gtk-d:vte 3.9.0: target for configuration "library" is up to date.
gtkd_treeview ~master: building configuration "application"...
Linking...
/usr/local/bin/ld: /usr/local/bin/../lib/libdruntime-ldc.a(runtime.o): in function `_D4core7runtime19defaultTraceHandlerFPvZC6object9Throwable9TraceInfo':
runtime.d:(.text._D4core7runtime19defaultTraceHandlerFPvZC6object9Throwable9TraceInfo+0x57): undefined reference to `backtrace'
/usr/local/bin/ld: /usr/local/bin/../lib/libdruntime-ldc.a(runtime.o): in function `_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbiPSQCk3sys5posix6signal9siginfo_tPvZv':
runtime.d:(.text._D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbiPSQCk3sys5posix6signal9siginfo_tPvZv+0x23): undefined reference to `backtrace'
/usr/local/bin/ld: runtime.d:(.text._D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbiPSQCk3sys5posix6signal9siginfo_tPvZv+0x33): undefined reference to `backtrace_symbols_fd'
/usr/local/bin/ld: /usr/local/bin/../lib/libdruntime-ldc.a(runtime.o): in function `_D4core7runtime16DefaultTraceInfo6__ctorMFZCQBqQBoQBj':
runtime.d:(.text._D4core7runtime16DefaultTraceInfo6__ctorMFZCQBqQBoQBj+0x13): undefined reference to `backtrace'
/usr/local/bin/ld: /usr/local/bin/../lib/libdruntime-ldc.a(runtime.o): in function `_D4core7runtime16DefaultTraceInfo7opApplyMxFMDFKmKxAaZiZi':
runtime.d:(.text._D4core7runtime16DefaultTraceInfo7opApplyMxFMDFKmKxAaZiZi+0x20): undefined reference to `backtrace_symbols'
/usr/local/bin/ld: /usr/local/bin/../lib/libdruntime-ldc.a(runtime.o): in function `_DThn16_4core7runtime16DefaultTraceInfo7opApplyMxFMDFKmKxAaZiZi':
runtime.d:(.text._DThn16_4core7runtime16DefaultTraceInfo7opApplyMxFMDFKmKxAaZiZi+0x24): undefined reference to `backtrace_symbols'
collect2: error: ld returned 1 exit status
Error: /usr/local/bin/gcc12 failed with status: 1
ldc2 failed with exit code 1.
```
Comment 7 Alain De Vos 2022-09-21 16:49:46 UTC
Update a had performed a misconfiguration. (my bad)
The github tarball seems to work fine as alternative.
Comment 8 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2022-11-15 01:55:26 UTC
I have updated devel/dub to 1.29. Maybe it is fixed in current version. Feel free open this PR if you found same issues with devel/dub