Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't build zstd 1.5.0 with cmake after deletion of "lib/common/zstd_trace.c" #2658

Closed
openmax opened this issue May 15, 2021 · 5 comments · Fixed by #2674
Closed

can't build zstd 1.5.0 with cmake after deletion of "lib/common/zstd_trace.c" #2658

openmax opened this issue May 15, 2021 · 5 comments · Fixed by #2674
Assignees

Comments

@openmax
Copy link

openmax commented May 15, 2021

This commit :
6cee3c2
prevent build with cmake , missing symbol from deleted ->" lib/common/zstd_trace.c "
ld: 0711-317 ERROR: Undefined symbol: ZSTD_trace_compress_begin
ld: 0711-317 ERROR: Undefined symbol: .ZSTD_trace_compress_begin
ld: 0711-317 ERROR: Undefined symbol: ZSTD_trace_compress_end
ld: 0711-317 ERROR: Undefined symbol: .ZSTD_trace_compress_end
ld: 0711-317 ERROR: Undefined symbol: ZSTD_trace_decompress_end
ld: 0711-317 ERROR: Undefined symbol: .ZSTD_trace_decompress_end
ld: 0711-317 ERROR: Undefined symbol: ZSTD_trace_decompress_begin
ld: 0711-317 ERROR: Undefined symbol: .ZSTD_trace_decompress_begin

To Reproduce
Build with cmake

Expected behavior
correct include o missing symbol.

@openmax openmax changed the title can't duild zstd 1.5.0 with cmake after deletion of "lib/common/zstd_trace.c" can't build zstd 1.5.0 with cmake after deletion of "lib/common/zstd_trace.c" May 15, 2021
@gvollant
Copy link

To compile with GCC-8 on IBM AIX (powerpc processor), I added this compiler option:

-DZSTD_HAVE_WEAK_SYMBOLS=0

@openmax
Copy link
Author

openmax commented May 16, 2021

i'm on OS400 7.3 Pase Environment ( is like aix 7.2 ) with gcc6.3 e cmake 3.16 , i got :

CMake Warning:
Manually-specified variables were not used by the project:

ZSTD_HAVE_WEAK_SYMBOLS

so no luck ...

@openmax
Copy link
Author

openmax commented May 16, 2021

i suggest to modify lib/common/zstd_trace.h adding AIX exclude :

`/* weak symbol support */
#if !defined(ZSTD_HAVE_WEAK_SYMBOLS) && defined(GNUC) &&
!defined(APPLE) && !defined(_WIN32) && !defined(MINGW32) &&
!defined(CYGWIN) && !defined(_AIX)

define ZSTD_HAVE_WEAK_SYMBOLS 1

#else

define ZSTD_HAVE_WEAK_SYMBOLS 0

`#endif``

@gvollant
Copy link

I suggest don't define automatically ZSTD_HAVE_WEAK_SYMBOLS on any platform

@terrelln terrelln self-assigned this May 17, 2021
terrelln added a commit to terrelln/zstd that referenced this issue May 19, 2021
* Only enable for ELF on x86-64 or i386.
* Also explicitly disable for AIX.

Fixes facebook#2658.
@terrelln
Copy link
Contributor

@gvollant and @openmax please let me know if PR #2674 fixes your issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants