MantisBT - NetSurf
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002679||NetSurf||[All Projects] General||public||2019-06-27 19:55||2019-07-19 09:23|
|Assigned To||John-Mark Bell|
|Target Version||3.9||Fixed in Version||3.9|
|Fixed in CI build #|
|Reported in CI build #|
|URL of problem page|
|Summary||0002679: _ALIGNED used in public header in libdom|
|Description||When building netsurf with `LDFLAGS=-Wl,--warn-common`, I noticed many warnings of duplicate definitions for a global variable named _ALIGNED, for example:|
/usr/bin/ld: build/Linux-gtk/utils_libdom.o and build/Linux-gtk/build_Linux-gtk_duktape_application_cache.o: warning: multiple common of `_ALIGNED'
It looks like _ALIGNED is defined in the netsurf buildsystem as __attribute__((aligned)). However, since it is used in the public header dom/core/string.h, this means that _ALIGNED needs to be defined when building every source file that includes it.
Since _ALIGNED isn't defined when building netsurf itself, every source file that includes dom/core/string.h ends up treating it as a definition of a global variable called _ALIGNED.
I'm not sure how best to resolve this, but I do have some questions and suggestions.
Why is _ALIGNED needed for dom_string? It was added in 98e480e4 without much explanation. Looking through the commit history, I see that originally when dom_string was split up (in 79e6a0be), dom_string was *not* used as the first member of dom_string_internal, and instead aliased with dom_string_internal. 98e480e4 fixes this by making dom_string the first member of dom_string_internal, but also adds _ALIGNED. I'm having trouble coming up with a reason why the increased alignment of dom_string is required.
If _ALIGNED is indeed necessary, maybe it should be added to the pkg-config file for libdom, so that it gets defined properly for software that uses it. Or, if dom_string is only ever allocated through dom_string_internal, maybe it could be moved to the `base` member of dom_string_internal?
|Tags||No tags attached.|
|2019-06-27 19:55||Michael Forney||New Issue|
|2019-06-30 12:52||Vincent Sanders||Assigned To||=> John-Mark Bell|
|2019-06-30 12:52||Vincent Sanders||Reproducibility||N/A => always|
|2019-06-30 12:52||Vincent Sanders||Status||new => resolved|
|2019-06-30 12:52||Vincent Sanders||Resolution||open => fixed|
|2019-06-30 12:52||Vincent Sanders||Product Version||=> 3.9|
|2019-06-30 12:52||Vincent Sanders||Fixed in Version||=> 3.9|
|2019-06-30 12:52||Vincent Sanders||Target Version||=> 3.9|
|2019-06-30 12:52||Vincent Sanders||Note Added: 0001975|
|2019-07-19 09:23||Vincent Sanders||Status||resolved => closed|
|2019-07-19 09:23||Vincent Sanders||Note Added: 0001995|