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

cmake: workaound ccache issue with .S assembly files #15142

Merged
merged 1 commit into from May 18, 2017

Conversation

Projects
None yet
3 participants
@bassam
Member

bassam commented May 18, 2017

When building with -DWITH_CCACHE=ON recent versions of ccache
(for example 3.3.3) seem to mangle object files from the cache
for source files that have a .S extension. For example:

[ 20%] Building ASM object src/CMakeFiles/common-objs.dir/common/crc32c_intel_fast_asm.S.o
cd /home/bassam/Projects/src/github.com/bassam/ceph/build/src && ccache /home/bassam/Projects/src/github.com/bassam/ceph/src/yasm-wrapper  -DCEPH_LIBDIR=\"/build/ceph-install/lib\" -DCEPH_PKGLIBDIR=\"/build/ceph-install/lib/ceph\" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D__linux__ -isystem /home/bassam/Projects/src/github.com/bassam/ceph/build/boost/include -I/home/bassam/Projects/src/github.com/bassam/ceph/build/src/include -I/home/bassam/Projects/src/github.com/bassam/ceph/src -isystem /home/bassam/Projects/src/github.com/bassam/ceph/build/include -I/home/bassam/Projects/src/github.com/bassam/ceph/src/xxHash -I/home/bassam/Projects/src/github.com/bassam/ceph/src/dmclock/src -I/home/bassam/Projects/src/github.com/bassam/ceph/src/dmclock/support/src -I/home/bassam/Projects/src/github.com/bassam/ceph/src/googletest/googletest/include  -f elf64 -O3 -DNDEBUG -fPIC   -DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -o CMakeFiles/common-objs.dir/common/crc32c_intel_fast_asm.S.o -c /home/bassam/Projects/src/github.com/bassam/ceph/src/common/crc32c_intel_fast_asm.S
[ 20%] Building ASM object src/CMakeFiles/common-objs.dir/common/crc32c_intel_fast_zero_asm.S.o
cd /home/bassam/Projects/src/github.com/bassam/ceph/build/src && ccache /home/bassam/Projects/src/github.com/bassam/ceph/src/yasm-wrapper  -DCEPH_LIBDIR=\"/build/ceph-install/lib\" -DCEPH_PKGLIBDIR=\"/build/ceph-install/lib/ceph\" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D__linux__ -isystem /home/bassam/Projects/src/github.com/bassam/ceph/build/boost/include -I/home/bassam/Projects/src/github.com/bassam/ceph/build/src/include -I/home/bassam/Projects/src/github.com/bassam/ceph/src -isystem /home/bassam/Projects/src/github.com/bassam/ceph/build/include -I/home/bassam/Projects/src/github.com/bassam/ceph/src/xxHash -I/home/bassam/Projects/src/github.com/bassam/ceph/src/dmclock/src -I/home/bassam/Projects/src/github.com/bassam/ceph/src/dmclock/support/src -I/home/bassam/Projects/src/github.com/bassam/ceph/src/googletest/googletest/include  -f elf64 -O3 -DNDEBUG -fPIC   -DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -o CMakeFiles/common-objs.dir/common/crc32c_intel_fast_zero_asm.S.o -c /home/bassam/Projects/src/github.com/bassam/ceph/src/common/crc32c_intel_fast_zero_asm.S
make[3]: Leaving directory '/home/bassam/Projects/src/github.com/bassam/ceph/build'

results in the same object file for both source files:

> nm -gC src/CMakeFiles/common-objs.dir/common/crc32c_intel_fast_asm.S.o 
0000000000000000 T crc32_iscsi_00
0000000000001400 D crc32_iscsi_00_slver
0000000000001400 D crc32_iscsi_00_slver_00020014

> nm -gC src/CMakeFiles/common-objs.dir/common/crc32c_intel_fast_zero_asm.S.o 
0000000000000000 T crc32_iscsi_00
0000000000001400 D crc32_iscsi_00_slver
0000000000001400 D crc32_iscsi_00_slver_00020014

This seems similar to the weirdness reported in #14633. The workaround here is to rename .S
files to .s (lower case).

cmake: workaound ccache issue with .S assembly files
when building with -DWITH_CCACHE=ON recent versions of ccache
(for example 3.3.3) seem to mangle object files from the cache
for source files that have a .S extension. This seems similar
but unrelated to PR #14633. The workaround here is to rename .S
files to .s (lower case).

Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
@tchaikov

This comment has been minimized.

Contributor

tchaikov commented May 18, 2017

thanks for looking into this! i was running into this problem also couple days ago, my solution then was to cowardly remove the .ccache cache.

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented May 18, 2017

tested locally with -DWITH_CCACHE=ON, my problem solved!

@tchaikov tchaikov merged commit e40a381 into ceph:master May 18, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
@smithfarm

This comment has been minimized.

Contributor

smithfarm commented May 30, 2017

Renaming crc32c_ppc_asm.S (upper-case) to crc32c_ppc_asm.s breaks the POWER8 build because the .s extension causes gcc to not run the preprocessor. See http://tracker.ceph.com/issues/20106

Now testing a fix that uses .sx extension for this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment