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

Linking fails if source path contains spaces #25

Closed

Conversation

willglynn
Copy link
Contributor

To reproduce:

$ mkdir -p "/tmp/path with space/build"
$ cp -a zlib /tmp/path\ with\ space/
$ cd /tmp/path\ with\ space/build
$ cmake ../zlib
...
 -- Build files have been written to: /tmp/path with space/build
$ make 
Scanning dependencies of target zlib
[  3%] Building C object CMakeFiles/zlib.dir/adler32.o
[  6%] Building C object CMakeFiles/zlib.dir/compress.o
[  9%] Building C object CMakeFiles/zlib.dir/crc32.o
[ 12%] Building C object CMakeFiles/zlib.dir/deflate.o
[ 15%] Building C object CMakeFiles/zlib.dir/gzclose.o
[ 18%] Building C object CMakeFiles/zlib.dir/gzlib.o
[ 21%] Building C object CMakeFiles/zlib.dir/gzread.o
[ 25%] Building C object CMakeFiles/zlib.dir/gzwrite.o
[ 28%] Building C object CMakeFiles/zlib.dir/inflate.o
[ 31%] Building C object CMakeFiles/zlib.dir/infback.o
[ 34%] Building C object CMakeFiles/zlib.dir/inftrees.o
[ 37%] Building C object CMakeFiles/zlib.dir/inffast.o
[ 40%] Building C object CMakeFiles/zlib.dir/trees.o
[ 43%] Building C object CMakeFiles/zlib.dir/uncompr.o
[ 46%] Building C object CMakeFiles/zlib.dir/zutil.o
    Linking C shared library libz.dylib
i686-apple-darwin11-llvm-gcc-4.2: with: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: space/zlib/zlib.map: No such file or directory
make[2]: *** [libz.1.2.7.dylib] Error 1
make[1]: *** [CMakeFiles/zlib.dir/all] Error 2
make: *** [all] Error 2

This commit explicitly quotes the path in -Wl,--version-script,<path>.

Previously, spaces in ${CMAKE_CURRENT_SOURCE_PATH} would expand into
multiple linker arguments.
@madler
Copy link
Owner

madler commented Feb 24, 2013

Incorporated.

@madler madler closed this Feb 24, 2013
jinfeihan57 pushed a commit to minchai23/zlib that referenced this pull request Sep 15, 2020
simonis pushed a commit to simonis/zlib that referenced this pull request Nov 7, 2022
* Fix architecture macro on MSVC.

Signed-off-by: Ningfei Li <[email protected]>

* Update '.gitignore'.

Also remove 'zconf.h', it will be generated during building.

* Add 'build' subdir to .gitignore

* Fix architecture macro on MSVC.

* Update CMakeLists.txt

Clean up.
Add option to set runtime (useful for MSVC).
Add 'SSE4.2' and 'AVX' option.

Signed-off-by: Ningfei Li <[email protected]>

* Define '_LARGEFILE64_SOURCE' by default in CMakeLists.txt.

Also remove checking fseeko.

Signed-off-by: Ningfei Li <[email protected]>

* Set 'CMAKE_MACOSX_RPATH' to TRUE.

Signed-off-by: Ningfei Li <[email protected]>

* Update SSE4.2 and PCLMUL setting in CMakeLists.txt

Signed-off-by: Ningfei Li <[email protected]>

* Add 'HAVE_HIDDEN' to CMakeLists.txt

Signed-off-by: Ningfei Li <[email protected]>

* Fix building dll on MSVC.

Signed-off-by: Ningfei Li <[email protected]>

* Fix zlib.pc file generation.

Signed-off-by: Ningfei Li <[email protected]>

* Refine cmake settings.

* Change cmake function to lowercase.

* Fix zlib.pc

* Fix crc32_pclmul_le_16 type.

* Set POSITION_INDEPENDENT_CODE flag to ON by default.

* Replace GPL CRC with BSD CRC (zlib-ng/zlib-ng#42), for validation see https://github.com/neurolabusc/simd_crc

* Westmere detection

* Update configure for Westmere (InsightSoftwareConsortium/ITK#416)

* use cpu_has_pclmul() to autodetect CPU hardware (InsightSoftwareConsortium/ITK#416)

* remove gpl code

* Improve support for compiling using Windows (https://github.com/ningfei/zlib)

* Import ucm.cmake from https://github.com/ningfei/zlib

* crc32_simd as separate file (cloudflare#18)

* atomic and SKIP_CPUID_CHECK (cloudflare#18)

* Suppress some MSVC warnings.

* Remove unused code

* Fix ucm_set_runtime when only C is enabled for the project.

* Removed configured header file.

* Unify zconf.h template.

* Only allow compiler to use clmul instructions to crc_simd unit (intel/zlib#25)

* Atomic does not compile on Ubuntu 14.04

* Allow "cmake -DSKIP_CPUID_CHECK=ON .." to not check SIMD CRC support on execution.

* Restore Windows compilation using "nmake -f win32\Makefile.msc"

* Do not set SOVERSION on Cygwin.

* Fix file permission.

* Refine PCLMUL CMake option.

* zconf.h required for Windows nmake

* Do not set visibility flag on Cygwin.

* Fix compiling dll resource.

* Fix compiling using MinGW.

SSE4.2 and PCLMUL are also supported.

* Fix zconf.h for Windows.

* support crc intrinsics for ARM CPUs

* Add gzip -k option to minigzip (to aid benchmarks)

* Support Intel and ARMv8 optimization in CMake.

* Clean up.

* Fix compiling on Apple M1.

check_c_compiler_flag detects SSE2, SSE3, SSE42 and PCLMUL but compiling
fails. Workaround fix, need further investigation.

* Restore MSVC warnings.

Co-authored-by: neurolabusc <[email protected]>
Co-authored-by: Chris Rorden <[email protected]>
@Neustradamus Neustradamus mentioned this pull request Jan 1, 2025
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 this pull request may close these issues.

2 participants