nm: some symbols are not related to any source file - elf

In my embedded project I compile amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c in this way:
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc \
-std=gnu11 \
-mcpu=cortex-m7 \
-mthumb \
-mapcs \
-mfloat-abi=hard \
-mfpu=fpv5-d16 \
-fno-common \
-fno-math-errno \
-fsingle-precision-constant \
-fno-trapping-math \
-fno-signaling-nans \
-fno-builtin \
-fstrict-aliasing \
-fstack-usage \
-Wstack-usage=300 \
-DCPU_MIMXRT1051DVL6B \
-D__FREERTOS__=1 \
-DFSL_RTOS_FREE_RTOS \
-DFSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE \
-D__MCUXPRESSO \
-D__USE_CMSIS \
-DARM_MATH_CM7 \
-D__NEWLIB__ \
-DDEBUG=0 \
-IDSP/source/ \
-Iamazon-freertos/lib/FreeRTOS-Plus-TCP/ \
-Iamazon-freertos/lib/FreeRTOS-Plus-TCP/portable/BufferManagement/ \
-Iamazon-freertos/lib/FreeRTOS-Plus-TCP/portable/NetworkInterface/imxrt105x/ \
-Iamazon-freertos/lib/FreeRTOS/ \
-Iamazon-freertos/lib/include/ \
-Iamazon-freertos/lib/FreeRTOS/portable/GCC/ARM_CM4F/ \
-Iamazon-freertos/lib/FreeRTOS/portable/MemMang/ \
-Og \
-g3 \
-Wall \
-ffunction-sections \
-fdata-sections \
-c \
-MMD \
-MP \
-Werror \
-D"ARCPRINTF( ... )=(void)0" \
--specs=nano.specs \
-Wa,-anhlmsd=build/DSP/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.lst \
-o build/DSP/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.o amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c
I have ipconfigUSE_TCP set to 1 in amazon-freertos/lib/FreeRTOS-Plus-TCP/include/FreeRTOSIPConfig.h
FreeRTOS_Sockets.c declares xBoundUDPSocketsList and xBoundTCPSocketsList
/* The list that contains mappings between sockets and port numbers. Accesses
to this list must be protected by critical sections of one kind or another. */
List_t xBoundUDPSocketsList;
#if ipconfigUSE_TCP == 1
List_t xBoundTCPSocketsList;
#endif /* ipconfigUSE_TCP == 1 */
Once I have my elf executable linked, run this command:
$ /opt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-nm -a -l -n -t x --print-size image/DSP.elf | grep -E '^[[:xdigit:]]{8} [[:xdigit:]]{8} B' | grep SocketsList
2001ac7c 00000014 B xBoundTCPSocketsList
2001ac90 00000014 B xBoundUDPSocketsList /home/max/Lavori/4202/src/repos/toremove/FW/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c:162
Both symbols exist in the executable, but one (xBoundTCPSocketsList) does not seem to belong to any .c source.
Both appear on the map file:
$ grep -n -A 1 -E 'xBoundTCPSocketsList|xBoundUDPSocketsList' image/DSP.map
61974: .bss.xBoundTCPSocketsList
61975- 0x000000002001ac7c 0x14 ./build/DSP/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.o
61976: 0x000000002001ac7c xBoundTCPSocketsList
61977: .bss.xBoundUDPSocketsList
61978- 0x000000002001ac90 0x14 ./build/DSP/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.o
61979: 0x000000002001ac90 xBoundUDPSocketsList
Even addr2line fails:
$ arm-none-eabi-addr2line -a -e image/DSP.elf 2001ac7c 2001ac90
0x2001ac7c
??:0
0x2001ac90
/home/max/Lavori/4202/src/repos/toremove/FW/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c:162
even the FreeRTOS_Sockets.lst doesn't tell me anything more:
7337 .global xBoundTCPSocketsList
7338 .global xBoundUDPSocketsList
7339 .section .bss.xBoundTCPSocketsList,"aw",%nobits
7340 .align 2
7341 .set .LANCHOR2,. + 0
7344 xBoundTCPSocketsList:
7345 0000 00000000 .space 20
7345 00000000
7345 00000000
7345 00000000
7345 00000000
7346 .section .bss.xBoundUDPSocketsList,"aw",%nobits
7347 .align 2
7348 .set .LANCHOR1,. + 0
7351 xBoundUDPSocketsList:
7352 0000 00000000 .space 20
7352 00000000
7352 00000000
7352 00000000
7352 00000000
There are many other symbols present in the executable but which do not seem to be associated with any .c source file.
Why this behavior? What changes between the two symbols xBoundTCPSocketsList and xBoundUDPSocketsList? Am I getting it wrong or omitting some debugging parameters when compiling? How do I get either nm or some other way to get the .c source where a symbol is declared?
EDIT:
I don't think the problem is in the linking
In fact I get the same output of arm-none-eabi-nm even if I analyse ./build/DSP/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.o:
$ arm-none-eabi-nm -a -l -n -t x --print-size build/DSP/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.o | grep -E '^[[:xdigit:]]{8} [[:xdigit:]]{8} B' | grep SocketsList
00000000 00000014 B xBoundTCPSocketsList
00000000 00000014 B xBoundUDPSocketsList /home/max/Lavori/4202/src/repos/toremove/FW/amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c:162

I opened a bug on the binutils issue tracking system:
https://sourceware.org/bugzilla/show_bug.cgi?id=25676
I think I can say that it's been fixed.

Related

CPPFLAGS set from configure.ac are ignored in Makefile.am

I am trying to build TerraGear with self-made AutoTools files (configure script). TerraGear is split into several subprojects. For each, I create a different set of configure.ac and Makefile.am files, but they are all almost the same.
Consider the following two files:
configure.ac
AC_PREREQ([2.69])
AC_INIT([TerraGear libterragear], [2.1.0], [])
AC_CONFIG_SRCDIR([airport.cxx])
AC_CONFIG_FILES([Makefile])
AM_INIT_AUTOMAKE([foreign])
AC_PROG_CXX
PKG_CHECK_MODULES([ZLIB], [zlib])
PKG_CHECK_MODULES([GDAL], [gdal])
AC_ARG_WITH([simgear-dir], [AS_HELP_STRING(
[--with-simgear-dir=prefix],
[installation prefix of SimGear])],
[
SIMGEAR_CPPFLAGS="-I${withval}/include"
SIMGEAR_LIBRARY="-L${withval}/lib"
]
)
AC_MSG_NOTICE([simgear cppflags : ${SIMGEAR_CPPFLAGS}])
AC_OUTPUT
Makefile.am
bin_PROGRAMS = genapts850
genapts850_SOURCES = airport.cxx \
apt_math.cxx \
closedpoly.cxx \
debug.cxx \
elevations.cxx \
helipad.cxx \
lights.cxx \
linearfeature.cxx \
linked_objects.cxx \
main.cxx \
object.cxx \
output.cxx \
parser.cxx \
runway.cxx \
rwy_simple.cxx \
rwy_gen.cxx \
scheduler.cxx \
taxiway.cxx
genapts850_LDADD = -L$(top_srcdir)/../../Lib/terragear \
$(SIMGEAR_LIBRARY) \
-lSimGearCore \
-lSimGearScene \
-lterragear \
$(ZLIB_LIBRARY) \
$(GDAL_LIBRARY)
genapts850_CXXFLAGS = -I$(top_srcdir)/../../Lib \
-I$(top_srcdir)/../../Lib/terragear \
$(SIMGEAR_CPPFLAGS) \
$(ZLIB_CFLAGS) \
$(GDAL_CFLAGS)/gdal
I run autoreconf:
autoreconf -vfi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
then run the configure script:
./configure --with-simgear-dir=/path/to/simgear/installation/prefix
[...]
configure: simgear cppflags : -I/path/to/simgear/installation/prefix/include
[...]
then I run make:
make
g++ -DPACKAGE_NAME=\"TerraGear\ libterragear\" -DPACKAGE_TARNAME=\"terragear-libterragear\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"TerraGear\ libterragear\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"terragear-libterragear\" -DVERSION=\"2.1.0\" -I. -I./../../Lib -I./../../Lib/terragear -Ig++ -DPACKAGE_NAME=\"TerraGear\ libterragear\" -DPACKAGE_TARNAME=\"terragear-libterragear\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"TerraGear\ libterragear\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"terragear-libterragear\" -DVERSION=\"2.1.0\" -I. -I./../../Lib -I./../../Lib/terragear -I/path/to/simgear/installation/prefix/include/gdal -g -O2 -MT genapts850-airport.o -MD -MP -MF .deps/genapts850-airport.Tpo -c -o genapts850-airport.o `test -f 'airport.cxx' || echo './'`airport.cxx
airport.cxx:6:10: fatal error: simgear/compiler.h: Datei oder Verzeichnis nicht gefunden
6 | #include <simgear/compiler.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:471: genapts850-airport.o] Fehler 1
(simgear/compiler.h resides inside /path/to/simgear/installation/prefix/include)
What am I doing wrong ? I'm banging my head into the screen for three hours now without being able to figure out the problem. Please help …
Not all shell variables defined in configure are forwarded to output files. Generally speaking, you need to use AC_SUBST() to tell Autoconf that a shell variable should be an output variable:
AC_SUBST([SIMGEAR_CPPFLAGS])
AC_SUBST([SIMGEAR_LIBRARY])

nextflow: change part of the script basing on a parameter

I have a Nextflow workflow that's like this (reduced):
params.filter_pass = true
// ... more stuff
process concatenate_vcf {
cpus 6
input:
file(vcf_files) from source_vcf.collect()
file(tabix_files) from source_vcf_tbi.collect()
output:
file("assembled.vcf.gz") into decompose_ch
script:
"""
echo ${vcf_files} | tr " " "\n" > vcflist
bcftools merge \
-l vcflist \
-m none \
-f PASS,. \
--threads ${task.cpus} \
-O z \
-o assembled.vcf.gz
rm -f vcflist
"""
}
Now, I want to add the -f PASS,. part of the command in the script in the bcftools merge call only if params.filter_pass is true.
In other words, the script would be executed like this, if params.filter_pass is true (other lines removed for clarity):
bcftools merge \
-l vcflist \
-m none \
-f PASS,. \
--threads ${task.cpus} \
-O z \
-o assembled.vcf.gz
and if it instead params.filter_pass is false:
bcftools merge \
-l vcflist \
-m none \
--threads ${task.cpus} \
-O z \
-o assembled.vcf.gz
I know I can use conditional scripts but that would mean replicating the whole script stanza just to change one parameter.
Is this use case possible with Nextflow?
The general pattern is to use a local variable in the 'script' block and a ternary operator to add the -f PASS,. filter option when params.filter_pass is true:
process concatenate_vcf {
...
script:
def filter_pass = params.filter_pass ? '-f PASS,.' : ''
"""
echo "${vcf_files.join('\n')}" > vcf.list
bcftools merge \\
-l vcf.list \\
-m none \\
${filter_pass} \\
--threads ${task.cpus} \\
-O z \\
-o assembled.vcf.gz
"""
}
An if/else statement could also be used in place of the ternary operator if preferred.

(Cmake, Trilinos)clang: error: unsupported option '-fopenmp'

platform:macOS 11.1
when I tried to configure Trilinos, I met a problem and I can not handle it.
The following command is used to compile Trilinos:
#!/bin/bash
rm -rf CMakeCache.txt
rm -rf CMakeFiles
rm -rf CMakeCache.txt
cmake \
-D CMAKE_INSTALL_PREFIX:PATH=/Users/weiqiangguo/Downloads/Trilinos/build \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS:BOOL=ON \
\
-D TPL_ENABLE_MPI:BOOL=ON \
-D TPL_ENABLE_BLAS:BOOL=ON \
-D TPL_ENABLE_LAPACK:BOOL=ON \
-D TPL_ENABLE_Pthread:BOOL=ON \
-D TPL_ENABLE_HWLOC:BOOL=ON \
-D TPL_ENABLE_HDF5:BOOL=ON \
-D TPL_ENABLE_SCALAPACK:BOOL=ON \
-D TPL_ENABLE_SuperLU:BOOL=ON \
-D TPL_ENABLE_SuperLUDist:BOOL=ON \
-D TPL_ENABLE_METIS:BOOL=ON \
-D TPL_ENABLE_ParMETIS:BOOL=ON \
\
-D ML_ENABLE_SuperLU:BOOL=OFF \
\
-D CMAKE_C_COMPILER:STRING="mpicc" \
-D CMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/mpicxx \
-D CMAKE_Fortran_COMPILER:STRING="mpif90" \
-D CMAKE_CXX_FLAGS:STRING="-O3 -g -fopenmp" \
\
-D TPL_SCALAPACK_LIBRARIES='/usr/local/lib/libscalapack.dylib' \
\
-D Teuchos_ENABLE_COMPLEX=ON \
\
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_NOX:BOOL=ON \
-D Trilinos_ENABLE_Teko:BOOL=ON \
-D Trilinos_ENABLE_Galeri:BOOL=ON \
-D Trilinos_ENABLE_OpenMP:BOOL=OFF \
-D Trilinos_ENABLE_PyTrilinos:BOOL=ON \
\
-D MPI_BASE_DIR:FILEPATH="/usr/local/Cellar/open-mpi" \
-D PYTHON_EXECUTABLE:FILEPATH="/usr/bin/python3" \
-D SuperLU_LIBRARY_DIRS:FILEPATH="/usr/local/lib" \
-D SuperLU_INCLUDE_DIRS:FILEPATH="/usr/local/include" \
-D SuperLUDist_LIBRARY_DIRS:FILEPATH="/usr/local/lib" \
-D SuperLUDist_INCLUDE_DIRS:FILEPATH="/usr/local/include" \
../
The error information is shown below:
Probing the environment ...
-- USE_XSDK_DEFAULTS='FALSE'
-- BUILD_SHARED_LIBS='ON'
-- CMAKE_BUILD_TYPE='Release'
-- MPI_BASE_DIR='/usr/local/Cellar/open-mpi'
-- MPI_BIN_DIR='/usr/local/Cellar/open-mpi/bin'
-- MPI_USE_COMPILER_WRAPPERS='ON'
-- Leaving current CMAKE_C_COMPILER=mpicc since it is already set!
-- Leaving current CMAKE_CXX_COMPILER=/usr/local/bin/mpicxx since it is already set!
-- Leaving current CMAKE_Fortran_COMPILER=mpif90 since it is already set!
-- MPI_EXEC='/usr/local/bin/mpiexec'
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_C_COMPILER_ID='AppleClang'
-- CMAKE_C_COMPILER_VERSION='12.0.0.12000032'
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/local/bin/mpicxx
-- Check for working CXX compiler: /usr/local/bin/mpicxx - broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.20/Modules/CMakeTestCXXCompiler.cmake:59 (message):
The C++ compiler
"/usr/local/bin/mpicxx"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/weiqiangguo/Downloads/Trilinos/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_690b0/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_690b0.dir/build.make CMakeFiles/cmTC_690b0.dir/build
Building CXX object CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o
/usr/local/bin/mpicxx -O3 -g -fopenmp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -std=gnu++14 -MD -MT CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o -c /Users/weiqiangguo/Downloads/Trilinos/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
clang: error: unsupported option '-fopenmp'
make[1]: *** [CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o] Error 1
make: *** [cmTC_690b0/fast] Error 2
CMake will not be able to correctly generate this project.
I really don't know how to fix it. I also tried to set gcc complier as homebrew gcc instead of clang.
Could anyone help me with this?
Xcode toolchains have no support for OpenMP.
There is no technical reason other than that they want you to use the Apple specific APIs instead (which are obviously not equivalent).
To use OpenMP, you can use LLVM Clang/libc++/libopenmp which you should be able to install through Homebrew:
brew install --with-toolchain llvm
or build from source yourself.

Having hdf5.cc causes errors in Gem5 build?

I moved my Gem5 simulations from my system to a server. My system does not have HDF5 libraries, but the server has, and I am met with this error:
/usr/local/lib/python2.7/config/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/space/src/Python-2.7/./Modules/posixmodule.c:7275: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/python2.7/config/libpython2.7.a(posixmodule.o): In function `posix_tempnam':
/space/src/Python-2.7/./Modules/posixmodule.c:7230: warning: the use of `tempnam' is dangerous, better use `mkstemp'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, double)':
/net/nasstore/students/GRAD/ECE/febinps/home/Paper3/gem5/build/X86/base/stats/hdf5.cc:312: undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::vector<char const*, std::allocator<char const*> > const&)':
/net/nasstore/students/GRAD/ECE/febinps/home/Paper3/gem5/build/X86/base/stats/hdf5.cc:280: undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::string const&)':
/net/nasstore/students/GRAD/ECE/febinps/home/Paper3/gem5/build/X86/base/stats/hdf5.cc:302: undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
collect2: error: ld returned 1 exit status
scons: *** [build/X86/gem5.opt] Error 1
scons: building terminated because of errors.
How can I fix this? Is there an yway I can avoid the build from using HDF5? I cannot do much at the server as I do not have admin access.
After the resolution of: https://askubuntu.com/questions/1187343/installation-of-gem5-on-ubuntu-19-10-on-my-laptop-i5-cpu-m520-64bit in gem5 b383997d4a9c642dd4356bfc4554ac7ae183ae62 (March 2020) the Ubuntu 19.10 (GCC 9) build is working for me:
scons -j `nproc` build/ARM/gem5.opt
If you find any further build bugs, do open an issue on the Jira issue tracker.
After https://gem5-review.googlesource.com/c/public/gem5/+/34777 gem5 should be building every time with HDF5 on the upstream testing system see also https://askubuntu.com/questions/350475/how-can-i-install-gem5/1275773#1275773 so I don't think it will break again easily.
I don't know the root cause of this issue, some one who is working on Gem5 could possibly answer that.
But as a workaround, since I have no admin access to the server ,and even then removing a library just for the sake of one build doesn't feel right, I edited the SConstruct file in gem5/, where the environment variables are gathered and passed:
have_hdf5 = 0 #check_hdf5() #line number 951 in the SConstruct file
This seems to work for the build.
In case you run on older system like Debian 10 or Ubuntu 16.04, the errors are due to the fact that the hdf5 library path is not in default system library path. I solved it by manually (brutally) linking gem5 ...
The link flags added are:
-L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5_cpp -lhdf5
g++ -o /gem5/default/build/X86/gem5.opt \
-Wl,--as-needed -fuse-ld=gold -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib \
-Xlinker -export-dynamic \
-Wl,-O1 -Wl,-Bsymbolic-functions -z origin -O3 \
/gem5/default/build/X86/sim/main.o \
/gem5/default/build/X86/dev/net/lib.o.partial \
/gem5/default/build/X86/base/lib.o.partial \
/gem5/default/build/X86/dev/i2c/lib.o.partial \
/gem5/default/build/X86/cpu/testers/traffic_gen/lib.o.partial \
/gem5/default/build/X86/mem/cache/tags/indexing_policies/lib.o.partial \
/gem5/default/build/X86/mem/ruby/slicc_interface/lib.o.partial \
/gem5/default/build/X86/mem/probes/lib.o.partial \
/gem5/default/build/X86/mem/ruby/network/simple/lib.o.partial \
/gem5/default/build/X86/dev/x86/lib.o.partial \
/gem5/default/build/X86/mem/ruby/network/fault_model/lib.o.partial \
/gem5/default/build/X86/systemc/utils/lib.o.partial \
/gem5/default/build/X86/systemc/dt/int/lib.o.partial \
/gem5/default/build/X86/cpu/kvm/lib.o.partial \
/gem5/default/build/X86/cpu/simple/probes/lib.o.partial \
/gem5/default/build/X86/base/filters/lib.o.partial \
/gem5/default/build/X86/dev/serial/lib.o.partial \
/gem5/default/build/X86/sim/power/lib.o.partial \
/gem5/default/build/X86/mem/cache/tags/lib.o.partial \
/gem5/default/build/X86/arch/x86/bios/lib.o.partial \
/gem5/default/build/X86/systemc/dt/fx/lib.o.partial \
/gem5/default/build/X86/mem/ruby/common/lib.o.partial \
/gem5/default/build/X86/mem/ruby/network/garnet2.0/lib.o.partial \
/gem5/default/build/X86/mem/ruby/structures/lib.o.partial \
/gem5/default/build/X86/cpu/testers/garnet_synthetic_traffic/lib.o.partial \
/gem5/default/build/X86/mem/cache/prefetch/lib.o.partial \
/gem5/default/build/X86/cpu/trace/lib.o.partial \
/gem5/default/build/X86/sim/probe/lib.o.partial \
/gem5/default/build/X86/sim/lib.o.partial \
/gem5/default/build/X86/mem/ruby/protocol/lib.o.partial \
/gem5/default/build/X86/systemc/tlm_core/2/quantum/lib.o.partial \
/gem5/default/build/X86/cpu/simple/lib.o.partial \
/gem5/default/build/X86/base/vnc/lib.o.partial \
/gem5/default/build/X86/mem/ruby/system/lib.o.partial \
/gem5/default/build/X86/mem/cache/lib.o.partial \
/gem5/default/build/X86/arch/x86/lib.o.partial \
/gem5/default/build/X86/dev/storage/lib.o.partial \
/gem5/default/build/X86/mem/protocol/lib.o.partial \
/gem5/default/build/X86/systemc/core/lib.o.partial \
/gem5/default/build/X86/systemc/tlm_core/2/generic_payload/lib.o.partial \
/gem5/default/build/X86/cpu/testers/directedtest/lib.o.partial \
/gem5/default/build/X86/mem/ruby/profiler/lib.o.partial \
/gem5/default/build/X86/arch/x86/regs/lib.o.partial \
/gem5/default/build/X86/dev/pci/lib.o.partial \
/gem5/default/build/X86/cpu/o3/probe/lib.o.partial \
/gem5/default/build/X86/mem/cache/compressors/lib.o.partial \
/gem5/default/build/X86/cpu/lib.o.partial \
/gem5/default/build/X86/learning_gem5/part2/lib.o.partial \
/gem5/default/build/X86/mem/cache/replacement_policies/lib.o.partial \
/gem5/default/build/X86/dev/virtio/lib.o.partial \
/gem5/default/build/X86/proto/lib.o.partial \
/gem5/default/build/X86/cpu/testers/rubytest/lib.o.partial \
/gem5/default/build/X86/mem/qos/lib.o.partial \
/gem5/default/build/X86/cpu/pred/lib.o.partial \
/gem5/default/build/X86/python/lib.o.partial \
/gem5/default/build/X86/arch/generic/lib.o.partial \
/gem5/default/build/X86/systemc/tlm_bridge/lib.o.partial \
/gem5/default/build/X86/dev/lib.o.partial \
/gem5/default/build/X86/kern/lib.o.partial \
/gem5/default/build/X86/mem/lib.o.partial \
/gem5/default/build/X86/cpu/testers/memtest/lib.o.partial \
/gem5/default/build/X86/systemc/dt/misc/lib.o.partial \
/gem5/default/build/X86/systemc/tlm_utils/lib.o.partial \
/gem5/default/build/X86/cpu/o3/lib.o.partial \
/gem5/default/build/X86/mem/ruby/network/lib.o.partial \
/gem5/default/build/X86/systemc/dt/bit/lib.o.partial \
/gem5/default/build/X86/dev/ps2/lib.o.partial \
/gem5/default/build/X86/unittest/lib.o.partial \
/gem5/default/build/X86/systemc/channel/lib.o.partial \
/gem5/default/build/X86/systemc/dt/lib.o.partial \
/gem5/default/build/X86/base/date.o \
-L/gem5/default/build/libelf -L/gem5/default/build/fputils -L/gem5/default/build/libfdt -L/gem5/default/build/drampower -L/gem5/default/build/iostream3 -L/gem5/default/build/nomali -L/gem5/default/build/googletest -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ \
-lpython2.7 -lpthread -ldl -lutil -lm -lz -lprotobuf -lrt -ltcmalloc -lnomali -liostream3 \
-ldrampower -lfdt -lfputils -lelf -lhdf5_cpp -lhdf5

Compiling tensorflow: undefined reference to `clSetUserEventStatus#OPENCL_1.1'

PS: Question is at the end, the following is just background information that might help.
I'm trying to compile tensorflow, but getting this error:
bazel-out/host/bin/_solib_local/_U#local_Uconfig_Usycl_S_Ssycl_Csyclrt___Uexternal_Slocal_Uconfig_Usycl_Ssycl_Slib/libComputeCpp.so:
undefined reference to `clSetUserEventStatus#OPENCL_1.1'
By using "strace" tool, i've isolated the exact statement that's failing to be:
(
cd /home/rh/.cache/bazel/_bazel_rh/81919f16ea125cb9f08993f06569f022/execroot/tensorflow && \
exec env - PATH=/home/rh/.nvm/versions/node/v6.9.5/bin:/home/rh/perl5/bin:/home/rh/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rh/bin:/usr/local/java/jdk1.8.0_74/bin:/home/rh/.local/bin:/home/rh/myscripts \
/usr/bin/clang++-3.6 \
-o \
bazel-out/host/bin/tensorflow/python/gen_functional_ops_py_wrappers_cc \
-Lbazel-out/host/bin/_solib_local/_U#local_Uconfig_Usycl_S_Ssycl_Csyclrt___Uexternal_Slocal_Uconfig_Usycl_Ssycl_Slib \
-Wl,-rpath,$ORIGIN/../../_solib_local/_U#local_Uconfig_Usycl_S_Ssycl_Csyclrt___Uexternal_Slocal_Uconfig_Usycl_Ssycl_Slib \
-pthread \
-Wl,-no-as-needed \
-B/usr/bin/ \
-Wl,-no-as-needed \
-Wl,--build-id=md5 \
-Wl,--hash-style=gnu \
-Wl,-S \
-Wl,#bazel-out/host/bin/tensorflow/python/gen_functional_ops_py_wrappers_cc-2.params \
-Wl,--no-undefined
)
strace also confirms that this command IS reading /usr/local/computecpp/lib/libComputeCpp.so, which contains the aforementioned clSetUserEventStatus symbol.
I verified that libComputeCpp.so contains clSetUserEventStatus by checking the output of the nm command:
nm /usr/local/computecpp/lib/libComputeCpp.so | grep clSetUserEventStatus
>> U clSetUserEventStatus##OPENCL_1.1
So here is my question: clang (and/or its linker) is reading the file that contains the symbol that it's complaining about... why is it "missing something" and complaining that it's undefined?
How can I get this compile to work?