Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite548455

Browse files
committed
aix: when building with gcc, tell gcc we're building a shared library
Not passing -shared to gcc when building a shared library triggers linking tothe wrong libgcc (libgcc.a instead of libgcc_s.a) and prevents emittingcorrect unwind information. It's somewhat surprising that this hasn't causedknown problems so far.Doing so requires adding path to libgcc to libpath, or linking statically tolibgcc - as the latter increases .so size substantially (for not entirelyobvious reasons), shared linking seems preferrable. It likely is worthbuilding executables with -shared-libgcc too, but I've not done that here.Discussion:https://postgr.es/m/20220820174213.d574qde4ptwdzoqz@awork3.anarazel.de
1 parenta1b9b14 commite548455

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎src/makefiles/Makefile.aix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ AROPT = crs
88
# -blibpath must contain ALL directories where we should look for libraries
99
libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
1010

11+
# when building with gcc, need to make sure that libgcc can be found
12+
ifeq ($(GCC), yes)
13+
libpath := $(libpath):$(dir $(shell gcc -print-libgcc-file-name))
14+
endif
15+
1116
rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
1217

1318
LDFLAGS_SL += -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE
1419

20+
# gcc needs to know it's building a shared lib, otherwise it'll not emit
21+
# correct code / link to the right support libraries
22+
ifeq ($(GCC), yes)
23+
LDFLAGS_SL += -shared
24+
endif
25+
1526
# env var name to use in place of LD_LIBRARY_PATH
1627
ld_library_path_var = LIBPATH
1728

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp