Bug 224861

Summary: Gigacage and DebugHeap compilation unit names clash with corresponding WTF names
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: bmallocAssignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: annulen, ap, ews-watchlist, ggaren, gyuyoung.kim, mmaxfield, ryuan.choi, sergio, ysuzuki
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=224860
Attachments:
Description Flags
Patch ysuzuki: review+

Description Kimmo Kinnunen 2021-04-21 02:27:58 PDT
Gigacage and DebugHeap compilation unit names clash with corresponding WTF names

Causes link-time warnings

CompileC WTFAssertions.o
CompileC WTFConfig.o
CompileC WTFString.o
Libtool libWTF
/Volumes/.../usr/bin/libtool: warning same member name (DebugHeap.o) in output file used for input files: /Users/kkinnunen/Build/WTF.build/Debug/WTF.build/Objects-normal/x86_64/DebugHeap.o and: /Users/kkinnunen/Build/Debug/libbmalloc.a(DebugHeap.o) due to use of basename, truncation and blank padding
/Volumes/.../usr/bin/libtool: warning same member name (Gigacage.o) in output file used for input files: /Users/kkinnunen/Build/Debug/libbmalloc.a(Gigacage.o) and: /Users/kkinnunen/Build/WTF.build/Debug/WTF.build/Objects-normal/x86_64/Gigacage.o (due to use of basename, truncation, blank padding or duplicate input files)
Build Succeeded
Current settings: Configuration:Debug Arch:x86_64


=== BUILD TARGET TestWTF OF PROJECT TestWebKitAPI WITH CONFIGURATION Debug ===
Check dependencies
CompileC mainMac.o
Ld TestWTF
...
GenerateDSYMFile TestWTF.dSYM

warning: (x86_64)  could not find object file symbol for symbol __ZN7bmalloc9DebugHeapC2ERKNSt3__111scoped_lockIJNS_5MutexEEEE
warning: (x86_64)  could not find object file symbol for symbol __ZNSt3__113unordered_mapIPvmNS_4hashIS1_EENS_8equal_toIS1_EENS_9allocatorINS_4pairIKS1_mEEEEEC1Ev
warning: (x86_64)  could not find object file symbol for symbol __ZN7bmalloc9DebugHeapC1ERKNSt3__111scoped_lockIJNS_5MutexEEEE
warning: (x86_64)  could not find object file symbol for symbol __ZN7bmalloc9DebugHeap6mallocEmNS_13FailureActionE
warning: (x86_64)  could not find object file symbol for symbol __ZN7bmalloc9DebugHeap8memalignEmmNS_13FailureActionE
warning: (x86_64)  could not find object file symbol for symbol __ZN7bmalloc9DebugHeap7reallocEPvmNS_13FailureActionE
Comment 1 Kimmo Kinnunen 2021-04-21 02:30:43 PDT
Created attachment 426663 [details]
Patch
Comment 2 Alexey Proskuryakov 2021-04-21 16:49:14 PDT
Comment on attachment 426663 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426663&action=review

> Source/bmalloc/ChangeLog:8
> +        Rename DebugHeap.cpp, Gigacage.cpp with B prefix to avoid clashing with WTF compilation units.

Is there no way to fix this without renaming? It seems impractical to change bmalloc whenever any client uses the same file name.
Comment 3 Kimmo Kinnunen 2021-04-21 23:58:13 PDT
I think one alternative is to encode the project name in the .o file, but I couldn't find Xcode options for that.
E.g Compiling DebugHeap.cpp would produce libbmalloc-DebugHeap.o.
As in:
https://bugs.chromium.org/p/webrtc/issues/detail?id=6418
Comment 4 Yusuke Suzuki 2021-04-22 00:14:35 PDT
Comment on attachment 426663 [details]
Patch

r=me
Comment 5 Kimmo Kinnunen 2021-04-22 23:42:46 PDT

*** This bug has been marked as a duplicate of bug 175997 ***