Skip to content

Commit 129d8ee

Browse files
fix(win32): export all symbols to fix 32 bit pseudo relocation out of range
> Mingw-w64 runtime failure: > 32 bit pseudo relocation at 00007FF6DD041527 out of range, targeting 00007FFBA8B94B26, yielding the value 00000004CBB535FB. Mark all interface functions for all driver is a bit complex, since all internal functions should be marked as static, just follow *nix behavior to export all symbols is the simplest way. resolve estkme-group#424
1 parent c0f585f commit 129d8ee

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ else()
8383
set(DL_LIBRARY dl)
8484
endif()
8585

86+
# Only useful on Windows, and will lead to invalid arguments on ld.gold.
87+
if(WIN32)
88+
add_link_options("LINKER:--export-all-symbols")
89+
endif()
90+
8691
if (USE_SYSTEM_DEPS)
8792
find_package(cJSON REQUIRED)
8893
elseif (NOT NO_NETWORK)

driver/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ target_sources(
3838
euicc-driver-loader.h
3939
)
4040

41-
# Only useful on Windows, and will lead to invalid arguments on ld.gold.
42-
if(WIN32)
43-
target_link_options(euicc-driver-loader PRIVATE "LINKER:--export-all-symbols")
44-
endif()
45-
4641
add_library(driver_apdu_stdio SHARED apdu/stdio.c)
4742
target_link_libraries(driver_apdu_stdio PRIVATE euicc euicc-drivers lpac-utils)
4843
set_target_properties(driver_apdu_stdio PROPERTIES PREFIX "")

driver/driver.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,4 @@ struct euicc_driver {
1717
void (*fini)(void *interface);
1818
};
1919

20-
#if defined(_WIN32)
21-
# define DRIVER_INTERFACE __declspec(dllexport) const struct euicc_driver driver_if
22-
#else
23-
# define DRIVER_INTERFACE const struct euicc_driver driver_if
24-
#endif
20+
#define DRIVER_INTERFACE const struct euicc_driver driver_if

utils/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ target_link_libraries(lpac-utils PRIVATE ${CJSON_LIBRARY} euicc)
44
target_compile_options(lpac-utils PRIVATE -Wall -Wextra)
55

66
if(WIN32)
7-
# Only useful on Windows, and will lead to invalid arguments on ld.gold.
8-
target_link_options(lpac-utils PRIVATE "LINKER:--export-all-symbols")
97
# FIXME: Glibc since 2.17 have move clock_* from librt to libc so
108
# single-thread program can use these functions without the
119
# overheads associated with multi-thread support.

0 commit comments

Comments
 (0)