2024-03-19 05:55 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002679NetSurf[All Projects] Generalpublic2019-07-19 08:23
ReporterMichael Forney 
Assigned ToJohn-Mark Bell 
SeverityminorReproducibilityalways 
StatusclosedResolutionfixed 
Product Version3.9 
Target Version3.9Fixed in Version3.9 
Summary0002679: _ALIGNED used in public header in libdom
DescriptionWhen 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[0] without much explanation. Looking through the commit history, I see that originally when dom_string was split up (in 79e6a0be[1]), dom_string was *not* used as the first member of dom_string_internal, and instead aliased with dom_string_internal. 98e480e4[0] 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?

[0] http://git.netsurf-browser.org/libdom.git/commit/?id=98e480e454b9604a714558bdb7d6a355f2eb1f60
[1] http://git.netsurf-browser.org/libdom.git/commit/?id=79e6a0beb0fa7f8a7d3096947413846a3e9ca546
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
URL of problem page
Attached Files

-Relationships
+Relationships

-Notes
Vincent Sanders

~0001975

Vincent Sanders (administrator)

removed usage of unnecessary _ALIGNED macro in libdom public headers

http://source.netsurf-browser.org/libdom.git/commit/?id=e2b00b3f3cb8bd29607cd08265312d2bb79b2d9d
Vincent Sanders

~0001995

Vincent Sanders (administrator)

we believe this issue has been resolved in NetSurf 3.9
+Notes

-Issue History
Date Modified Username Field Change
2019-06-27 18:55 Michael Forney New Issue
2019-06-30 11:52 Vincent Sanders Assigned To => John-Mark Bell
2019-06-30 11:52 Vincent Sanders Reproducibility N/A => always
2019-06-30 11:52 Vincent Sanders Status new => resolved
2019-06-30 11:52 Vincent Sanders Resolution open => fixed
2019-06-30 11:52 Vincent Sanders Product Version => 3.9
2019-06-30 11:52 Vincent Sanders Fixed in Version => 3.9
2019-06-30 11:52 Vincent Sanders Target Version => 3.9
2019-06-30 11:52 Vincent Sanders Note Added: 0001975
2019-07-19 08:23 Vincent Sanders Status resolved => closed
2019-07-19 08:23 Vincent Sanders Note Added: 0001995
+Issue History