Bug 224599 - ld: warning: static initializer found in '...Objects-normal/x86_64/UnifiedSource85.o'. Use -no_inits to make this an error. Use -no_warn_inits to suppress warning
Summary: ld: warning: static initializer found in '...Objects-normal/x86_64/UnifiedSou...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-15 05:15 PDT by Kimmo Kinnunen
Modified: 2021-04-22 05:16 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2021-04-15 05:15:46 PDT
ld: warning: static initializer found in '...Objects-normal/x86_64/UnifiedSource85.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning

These warnings here have hidden a real problem:

ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource85.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource133.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource136.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource156.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource217.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource220.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource229.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource231.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource309.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource319.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in '/Users/kkinnunen/Build/WebCore.build/Debug-maccatalyst/WebCore.build/Objects-normal/x86_64/UnifiedSource374.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: invalid -install_name (@loader_path/../../../libANGLE-shared.dylib) in dependent dylib (/Users/kkinnunen/Build/Debug-maccatalyst/libANGLE-shared.dylib). Dylibs/frameworks which might go in dyld shared cache cannot link with dylib that uses @rpath, @loader_path, etc.
ld: warning: linking with (/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio) but not using any symbols from it
ld: warning: linking with (/System/Library/PrivateFrameworks/URLFormatting.framework/Versions/A/URLFormatting) but not using any symbols from it
ld: warning: linking with (/usr/lib/libAccessibility.dylib) but not using any symbols from it

Note: the part about libANGLE-shared.dylib is a real bug, but it's hidden in the the no inits warning.

Maybe the warning should be removed if it has no other purpose than being ignored?

Most of these probably are RefCountedLeakCounter. Should I change that to not warn?
Comment 1 Alexey Proskuryakov 2021-04-15 15:30:32 PDT
Static initializers are not allowed in WebKit for performance reasons. So this is a real bug too.
Comment 2 Kimmo Kinnunen 2021-04-15 22:18:47 PDT
(In reply to Alexey Proskuryakov from comment #1)
> Static initializers are not allowed in WebKit for performance reasons. So
> this is a real bug too.

There's an exception of "Debug build in these specific files defined by check-global-initializers"
Comment 3 Radar WebKit Bug Importer 2021-04-22 05:16:14 PDT
<rdar://problem/77013991>