Bug 253506 - [PATCH] textproc/refdb: ld: error: duplicate symbol: thecommandlist
Summary: [PATCH] textproc/refdb: ld: error: duplicate symbol: thecommandlist
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2021-02-14 14:00 UTC by O. Hartmann
Modified: 2021-03-28 11:53 UTC (History)
0 users

See Also:

Add -fcommon to CFLAGS (778 bytes, patch)
2021-02-14 14:00 UTC, O. Hartmann
no flags Details | Diff
mitigate linker error (367 bytes, patch)
2021-03-28 11:42 UTC, O. Hartmann
no flags Details | Diff
Solving the -fno-common issue on LLVM10+ (767 bytes, patch)
2021-03-28 11:53 UTC, O. Hartmann
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2021-02-14 14:00:10 UTC
Created attachment 222435 [details]
Add -fcommon to CFLAGS

CLANG has changed its default behaviour by setting -fno-common as the default option, to meet GCC10 behaviour:

"[...] With this change, C code that uses tentative definitions as definitions of a variable in multiple translation units will trigger multiple-definition linker errors. Generally, this occurs when the use of the extern keyword is neglected in the declaration of a variable in a header file. In some cases, no specific translation unit provides a definition of the variable. The previous behavior can be restored by specifying -fcommon. [...]

(see: https://reviews.llvm.org/D75056)

As a "quick and dirty" workaround I added -fcommon to CFALGS to restore the previous behaviour. A more sophisticated solution (which implies a deeper insight into the codebase of refdb) would be desireable.

Additionaly, I allowed to change the E-Mail address.
Comment 1 Bugzilla Automation freebsd_committer 2021-02-14 14:00:10 UTC
Maintainer informed via mail
Comment 2 O. Hartmann 2021-03-28 11:42:29 UTC
Created attachment 223661 [details]
mitigate linker error

The applied patchfile (residing in refdb/files) mutually solves the problem occuring on FreeBSD-13 and -14 as well as CURRENT due to changes to linker behaviour of used LLVM11 compiler suite as described above.
Comment 3 O. Hartmann 2021-03-28 11:53:02 UTC
Created attachment 223663 [details]
Solving the -fno-common issue on LLVM10+

Given the attached patch, the -fno-common problematic with the reported issue on newer LLVM10+ compiler suites seems to be solved. Not tested thoroughly on FreeBSD < 13.