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

Commit24ef127

Browse files
committed
meson: mingw: Add -Wl,--disable-auto-import, enable when linking with readline
I hadn't ported -Wl,--disable-auto-import over from the win32 template as Ihad focused on msvc for windows. The flag is desirable as it makes it easierto find problems one would have with msvc, particularly useful during crosscompilation.This turned out to be a somewhat happy accident, as it allowed me to realizethat readline actually works on windows these days, as long as auto imports toenable. Therefore enable auto-import again as part of linking to readline.We perhaps can come up with a better solution for the readline issue, but thisseems good enough for now.Discussion:http://postgr.es/m/20220928022724.erzuk5v4ai4b53do@awork3.anarazel.de
1 parent2dc2e4e commit24ef127

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎meson.build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ elif host_system == 'windows'
279279
ldflags+='-Wl,--stack,@0@'.format(cdata.get('WIN32_STACK_RLIMIT'))
280280
# Need to allow multiple definitions, we e.g. want to override getopt.
281281
ldflags+='-Wl,--allow-multiple-definition'
282+
# Ensure we get MSVC-like linking behavior.
283+
ldflags+='-Wl,--disable-auto-import'
282284
endif
283285

284286
os_deps+= cc.find_library('ws2_32',required:true)
@@ -1080,6 +1082,13 @@ Use -Dreadline=false to disable readline support.'''.format(readline_dep))
10801082
readline=declare_dependency(dependencies: readline,
10811083
include_directories: postgres_inc)
10821084
endif
1085+
1086+
# On windows with mingw readline requires auto-import to successfully
1087+
# link, as the headers don't use declspec(dllimport)
1088+
if host_system=='windows'and cc.get_id()!='msvc'
1089+
readline=declare_dependency(dependencies: readline,
1090+
link_args:'-Wl,--enable-auto-import')
1091+
endif
10831092
endif
10841093

10851094
# XXX: Figure out whether to implement mingw warning equivalent

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp