mirror of
https://github.com/curl/curl.git
synced 2026-08-03 07:10:29 +03:00
cmake: build stubgss library for libtests to match autotools
Used by test 2056 and 2057, in a way that's Linux- & autotools-specific.
This patch builds it for all Unix, syncing cmake with autotools.
Adapt the two tests to find the library in CMake builds as well.
Tested OK on Linux. (CI does not test this. The corresponding jobs build
in debug mode, while the `LD_PRELOAD` feature is locked to non-debug.)
On macOS it didn't load without building everything for aarch64e arch:
"../bld/tests/libtest/libstubgss.dylib' (mach-o file, but is
an incompatible architecture (have 'arm64', need 'arm64e'))"
With that fixed it still did not load correctly and/or the tests did not
pass. So, for macOS these tests remain disabled.
Also:
- GHA/macos: build for aarch64e. (recognized by Apple clang as of this
patch. llvm and gcc fall back to aarch64.)
Follow-up to 56d949d31a #1687
Closes #17653
This commit is contained in:
parent
879b6075a1
commit
171b623759
7 changed files with 18 additions and 8 deletions
4
.github/workflows/macos.yml
vendored
4
.github/workflows/macos.yml
vendored
|
|
@ -238,7 +238,7 @@ jobs:
|
|||
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
|
||||
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
|
||||
-DCMAKE_OSX_SYSROOT="${sysroot}" \
|
||||
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
|
||||
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
|
||||
${MATRIX_GENERATE} ${options}
|
||||
done
|
||||
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
|
||||
|
|
@ -460,7 +460,7 @@ jobs:
|
|||
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
|
||||
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
|
||||
-DCMAKE_OSX_SYSROOT="${sysroot}" \
|
||||
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
|
||||
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
|
||||
-DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF \
|
||||
-DCURL_USE_OPENSSL=ON \
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ ld_preload
|
|||
!Debug
|
||||
</features>
|
||||
<setenv>
|
||||
LD_PRELOAD=%PWD/libtest/.libs/libstubgss.so
|
||||
LD_PRELOAD=libstubgss.so
|
||||
LD_LIBRARY_PATH=%PWD/libtest/.libs:%PWD/libtest
|
||||
CURL_STUB_GSS_CREDS="KRB5_Alice"
|
||||
</setenv>
|
||||
<command>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ ld_preload
|
|||
!Debug
|
||||
</features>
|
||||
<setenv>
|
||||
LD_PRELOAD=%PWD/libtest/.libs/libstubgss.so
|
||||
LD_PRELOAD=libstubgss.so
|
||||
LD_LIBRARY_PATH=%PWD/libtest/.libs:%PWD/libtest
|
||||
CURL_STUB_GSS_CREDS="NTLM_Alice"
|
||||
</setenv>
|
||||
<command>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES, STUB_GSS variables
|
||||
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
|
||||
|
|
@ -60,3 +60,9 @@ target_include_directories(${BUNDLE} PRIVATE
|
|||
set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
|
||||
set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION")
|
||||
set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF)
|
||||
|
||||
if(HAVE_GSSAPI AND UNIX)
|
||||
add_library(stubgss SHARED EXCLUDE_FROM_ALL ${STUB_GSS})
|
||||
set_target_properties(stubgss PROPERTIES UNITY_BUILD OFF)
|
||||
add_dependencies(testdeps stubgss)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(srcdir) \
|
||||
-I$(top_srcdir)/tests/unit
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES, STUB_GSS variables
|
||||
include Makefile.inc
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(TESTFILES) \
|
||||
|
|
@ -79,7 +79,7 @@ if CURL_LT_SHLIB_USE_NO_UNDEFINED
|
|||
libstubgss_la_LDFLAGS += -no-undefined
|
||||
endif
|
||||
libstubgss_la_CFLAGS = $(AM_CFLAGS) -g
|
||||
libstubgss_la_SOURCES = stub_gssapi.c stub_gssapi.h
|
||||
libstubgss_la_SOURCES = $(STUB_GSS)
|
||||
libstubgss_la_LIBADD =
|
||||
libstubgss_la_DEPENDENCIES =
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -86,3 +86,5 @@ TESTFILES = \
|
|||
lib2700.c \
|
||||
lib3010.c lib3025.c lib3026.c lib3027.c \
|
||||
lib3100.c lib3101.c lib3102.c lib3103.c lib3104.c lib3105.c lib3207.c lib3208.c
|
||||
|
||||
STUB_GSS = stub_gssapi.c stub_gssapi.h
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ sub checksystemfeatures {
|
|||
|
||||
$libcurl = $2;
|
||||
if($curl =~ /linux|bsd|solaris/) {
|
||||
# system support LD_PRELOAD; may be disabled later
|
||||
# system supports LD_PRELOAD/LD_LIBRARY_PATH; may be disabled later
|
||||
$feature{"ld_preload"} = 1;
|
||||
}
|
||||
if($curl =~ /win32|Windows|windows|mingw(32|64)/) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue