ROCm / ROCm-OpenCL-Runtime

ROCm OpenOpenCL Runtime
168 stars 55 forks source link

Compilation fails due to multiple definitions #124

Open rigtorp opened 4 years ago

rigtorp commented 4 years ago
Scanning dependencies of target icd_loader_test
[ 25%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_kernel.c.o
[ 28%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/main.c.o
[ 28%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_platforms.c.o
[ 31%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/icd_test_match.c.o
[ 31%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_program_objects.c.o
[ 34%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_sampler_objects.c.o
[ 34%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_buffer_object.c.o
[ 37%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_cl_runtime.c.o
[ 37%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/callbacks.c.o
[ 40%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_create_calls.c.o
[ 40%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_clgl.c.o
[ 43%] Building C object khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/test_image_objects.c.o
[ 43%] Linking C executable icd_loader_test
/usr/bin/ld: CMakeFiles/icd_loader_test.dir/test_platforms.c.o:(.bss+0x0): multiple definition of `ret_val'; CMakeFiles/icd_loader_test.dir/test_kernel.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/icd_loader_test.dir/test_program_objects.c.o:(.bss+0x0): multiple definition of `ret_val'; CMakeFiles/icd_loader_test.dir/test_kernel.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/icd_loader_test.dir/test_sampler_objects.c.o:(.bss+0x0): multiple definition of `ret_val'; CMakeFiles/icd_loader_test.dir/test_kernel.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/icd_loader_test.dir/test_cl_runtime.c.o:(.bss+0x0): multiple definition of `ret_val'; CMakeFiles/icd_loader_test.dir/test_kernel.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/icd_loader_test.dir/test_clgl.c.o:(.bss+0x0): multiple definition of `ret_val'; CMakeFiles/icd_loader_test.dir/test_kernel.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/icd_loader_test.dir/test_image_objects.c.o:(.bss+0x0): multiple definition of `ret_val'; CMakeFiles/icd_loader_test.dir/test_kernel.c.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/build.make:271: khronos/icd/test/loader_test/icd_loader_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:1335: khronos/icd/test/loader_test/CMakeFiles/icd_loader_test.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
gcc --version
gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
git branch -v
  master-next 9c84f7c Adding an initial Readme file
* roc-3.6.x   089bf86 Don't add -std flag to CMAKE_CXX_FLAGS