Bug 253506 - [PATCH] textproc/refdb: ld: error: duplicate symbol: thecommandlist
Summary: [PATCH] textproc/refdb: ld: error: duplicate symbol: thecommandlist
Status: Closed Overcome By Events
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)
URL:
Keywords:
Depends on: 265105
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-14 14:00 UTC by O. Hartmann
Modified: 2022-09-03 11:44 UTC (History)
0 users

See Also:


Attachments
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 with llvm > 10 (767 bytes, patch)
2021-03-28 11:53 UTC, O. Hartmann
no flags Details | Diff
Solving the -fno-common issue with llvm > 10 (1.61 KB, patch)
2022-09-03 11:44 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 freebsd_triage 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 with llvm > 10

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.
Comment 4 O. Hartmann 2022-07-09 05:48:55 UTC
The patch proposed here has been introduced, in the same way, upstream on a new version of code (the core remains the same).

Can this patch please be commited, so that the port is building again?
Comment 5 O. Hartmann 2022-07-18 08:00:36 UTC
See PR 265105 , issue solved in a larger context of an update.
Comment 6 O. Hartmann 2022-09-03 11:44:22 UTC
Created attachment 236330 [details]
Solving the -fno-common issue with llvm > 10

Shifting PORTREVISION=11 to PORTREVISION=12 by solving an issue introduced with LLVM/CKANG > 10 (setting -fno-common by default, which results in an error while compiling as described).

The problem occured in src/readln.h, the problem has been solved by upstream by erasing the useless COMMON *thecommandlist declaration.

The issue with the "patch" offered prior to this correction was: I forgot to send the patch for src/readln.h due to being new to git that time. The Makefile itself was useless.

Since 1.0.3 is out and waiting for commitment, this patch for the patch is for the sake of correctnes.