facebook / facebook/zstd

make / cmake inconsistencies

Aperta
#2,261 6 commenti 2 reazioni 0 assegnatari Vedi su GitHub
build
Lingua principale
C
Stelle
27.9k
Fork
2.6k
Merge medio
1g 3h
PR unite (30g)
8

Descrizione

**Describe the bug**
The compiler and link commands used depend on the build system used, e.g. make vs cmake (maybe same for the other build systems). This is unexpected and undesired.

For example, for libzstd, the makefile specifies -fvisibility=hidden, whereas the cmake version does not.
Similarly, the compilation of the 'programs' have many compiler warning flags which are absent for cmake.
On the other hand, the cmake system now allows to link the 'zstd' program dynamically to libzstd via -DZSTD_PROGRAMS_LINK_SHARED=ON, but this feature is not supported in the 'make' system. There does exist a 'zstd-dll' target, which does not work because the visibility of symbols in libzstd is set to hidden.

**To Reproduce**
Steps to reproduce the behavior:
- compare output from a clean directory for following steps:
- cmake build/cmake/ -j1 V=1 VERBOSE=1
- make -j1 V=1 VERBOSE=1

**Expected behavior**
I expect the same output files regardless of the build system

**Additional context**
With the upgrade from zstd 1.4.3 to 1.4.5, I notice yet another big increase in size, +500KB on libzstd. I thus wanted to benefit from ZSTD_PROGRAMS_LINK_SHARED=ON, but zstd as packaged in Buildroot is using 'make', hence I stumbled upon these inconsistencies.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.