Closed
Bug 917526
Opened 11 years ago
Closed 11 years ago
[10.9] Various duplicate symbols error building tree with the 10.9 SDK
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox27 fixed, firefox-esr24 fixed, b2g-v1.2 fixed)
RESOLVED
FIXED
mozilla27
People
(Reporter: smichaud, Assigned: smichaud)
References
Details
Attachments
(1 file, 3 obsolete files)
2.70 KB,
patch
|
smichaud
:
review+
|
Details | Diff | Splinter Review |
I get the following error building current trunk with --disable-optimize and the 10.9 SDK specified in my mozconfig file:
...
nsinstall_real
clang -o nsinstall_real -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Wdeclaration-after-statement -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-unused -isysroot /Developer/SDKs/MacOSX10.9.sdk -std=gnu99 -fgnu89-inline -fno-common -fno-math-errno -pthread -pipe -DNDEBUG -DTRIMMED -g -fno-omit-frame-pointer -DXP_UNIX -DXP_MACOSX -DNO_X11 -DUNICODE -D_UNICODE -lobjc -framework ExceptionHandling -Wl,-executable_path,../../../dist/bin host_nsinstall.o host_pathsub.o
duplicate symbol ___sputc in:
host_nsinstall.o
host_pathsub.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
Assignee | ||
Comment 1•11 years ago
|
||
This happens building in the js/src/config directory.
Assignee | ||
Updated•11 years ago
|
Blocks: 10.9-build_issues
Assignee | ||
Comment 2•11 years ago
|
||
This may be a clang bug, but it involves subtleties about the behavior of the "inline" keyword (compiling with and without -fgnu89-inline) that are far beyond my knowledge.
__sputc() is defined as follows in the stdio.h that comes with Apple's current developer preview (DP8) of OS X 10.9:
__header_always_inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
"__header_always_inline" ends up (I think) getting defined as follows in sys/cdefs.h:
inline __attribute__ ((__always_inline__))
This works just fine if we get rid of -fgnu89-inline here:
http://hg.mozilla.org/mozilla-central/annotate/e8bb95435a54/js/src/configure.in#l1064
But I doubt that's feasible in the general case. And it's puzzling that "inline __attribute__ ((__always_inline__))" would fail to work properly (to force inlining in all cases) when we compile with -fgnu89-inline.
Ted, Jeff: Any idea what's going on?
Flags: needinfo?(ted)
Flags: needinfo?(jwalden+bmo)
Comment 3•11 years ago
|
||
(In reply to Steven Michaud from comment #2)
> This works just fine if we get rid of -fgnu89-inline here:
>
> http://hg.mozilla.org/mozilla-central/annotate/e8bb95435a54/js/src/configure.
> in#l1064
>
> But I doubt that's feasible in the general case.
Actually glandium claimed recently that it would be feasible, now that we've updated some tinderboxen, to drop that. (And in the main configure.in.) Maybe tryserver that change and see?
Flags: needinfo?(jwalden+bmo)
Assignee | ||
Comment 4•11 years ago
|
||
Here's the output of "clang --version" on my system:
Apple LLVM version 5.0 (clang-500.1.74) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
Assignee | ||
Comment 5•11 years ago
|
||
> Maybe tryserver that change and see?
Will do.
Assignee | ||
Comment 6•11 years ago
|
||
Assignee | ||
Comment 8•11 years ago
|
||
> https://tbpl.mozilla.org/?tree=Try&rev=adeb8c7d19d6
There were no build failures, and no non-spurious failures of any kind. So it might be worthwhile getting rid of -fgnu89-inline on the trunk, at least temporarily, to see what happens.
Assignee | ||
Comment 9•11 years ago
|
||
Here's the patch I tested (successfully) on the tryservers.
Assignee | ||
Comment 10•11 years ago
|
||
Changed the comments to match the code changes.
Attachment #807284 -
Attachment is obsolete: true
Assignee | ||
Comment 11•11 years ago
|
||
Comment on attachment 807290 [details] [diff] [review]
Possible workaround rev1
Glandium, what do you think of this?
If you think it also needs other reviewers, please add them.
Attachment #807290 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 807290 [details] [diff] [review]
Possible workaround rev1
This patch also works around many more (different) duplicate symbol errors when --disable-optimize is not specified.
Comment 13•11 years ago
|
||
Comment on attachment 807290 [details] [diff] [review]
Possible workaround rev1
Review of attachment 807290 [details] [diff] [review]:
-----------------------------------------------------------------
::: configure.in
@@ +1233,5 @@
> dnl GNU specific defaults
> dnl ========================================================
> if test "$GNU_CC"; then
> + # Use C99 plus GNU extensions. See bug 719659.
> + CFLAGS="$CFLAGS -std=gnu99"
I'd rather keep -fgnu89-inline on non-osx systems.
Attachment #807290 -
Flags: review?(mh+mozilla) → review-
Assignee | ||
Updated•11 years ago
|
Summary: [10.9] Duplicate symbol error building tree with --disable-optimize and the 10.9 SDK → [10.9] Various duplicate symbols error building tree with the 10.9 SDK
Assignee | ||
Comment 14•11 years ago
|
||
> I'd rather keep -fgnu89-inline on non-osx systems.
OK. New patch coming up.
Assignee | ||
Comment 15•11 years ago
|
||
How's this?
Assignee: nobody → smichaud
Attachment #807290 -
Attachment is obsolete: true
Attachment #808042 -
Flags: review?(mh+mozilla)
Comment 16•11 years ago
|
||
Comment on attachment 808042 [details] [diff] [review]
Possible workaround rev2
Review of attachment 808042 [details] [diff] [review]:
-----------------------------------------------------------------
::: configure.in
@@ +1240,5 @@
> + if test "${OS_ARCH}" = Darwin; then
> + CFLAGS="$CFLAGS -std=gnu99"
> + else
> + CFLAGS="$CFLAGS -std=gnu99 -fgnu89-inline"
> + fi
CFLAGS="$CFLAGS -std=gnu99"
if test "${OS_ARCH}" != Darwin; then
CFLAGS="$CFLAGS -fgnu89-inline"
fi
Attachment #808042 -
Flags: review?(mh+mozilla) → review+
Assignee | ||
Comment 17•11 years ago
|
||
Carrying forward glandium's r+.
Attachment #808042 -
Attachment is obsolete: true
Attachment #808090 -
Flags: review+
Assignee | ||
Comment 18•11 years ago
|
||
Comment on attachment 808090 [details] [diff] [review]
Possible workaround rev3
Landed on mozilla-inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e4d9cc03f15
Comment 19•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Comment 20•11 years ago
|
||
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•