]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: move SWIFT error_handler out-of-line to fix link failure 69166/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Fri, 29 May 2026 10:39:51 +0000 (18:39 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Fri, 29 May 2026 10:51:31 +0000 (18:51 +0800)
commit868fdd8120790ef453692604fff910e29c56cee1
tree96b003a9fecd80619c1aec899a5ecb2ab0d491c1
parentce220cc902e91fe203513e7beac7982e2c2538d4
rgw: move SWIFT error_handler out-of-line to fix link failure

The two error_handler overrides are defined inline in rgw_rest_swift.h
and delegate to RGWSwiftWebsiteHandler::error_handler, a non-virtual
function defined in rgw_rest_swift.cc (librgw_a.a). Because the header
is included by rgw_rest.cc, the inline bodies are emitted in
librgw_common.a, which then ODR-uses that symbol across archives.

The link line lists librgw_a.a before librgw_common.a, and GNU ld only
pulls archive members on demand: when librgw_a.a is scanned nothing yet
references RGWSwiftWebsiteHandler::error_handler, so rgw_rest_swift.cc.o
is dropped and the symbol is later unresolved. This shows up as a link
failure with gcc 16 -O2.

Move the two bodies into rgw_rest_swift.cc next to the function they
call, so the ODR-use stays within the same object and the build no
longer depends on archive scan order. No functional change.

Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_rest_swift.h