Build fails on Fedora 32 and Ubuntu 20.04 due to gettimeofday

Describe the issue Building Shadow master branch on Fedora 32 fails due to a gettimeofday issue (stack trace below).

To Reproduce Build Shadow the usual way, i.e., ./setup build

Operating System (please complete the following information): - OS and version: Fedora release 32 (Thirty Two) - Kernel version: Linux localhost.localdomain 5.6.11-300.fc32.x86_64 #1 SMP Wed May 6 19:12:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Shadow (please complete the following information): - Version: Shadow v1.13.2-587-g6ee31a4a-dirty 2020-05-04 (built 2020-05-09) running GLib v2.64.2 and IGraph v0.8.2 - Which plug-ins you are using: N/A

Additional context

Relevant part of the build output:


[rjansen shadow]$ ./setup build -c                                                                                                                                                                                          
2020-05-21 13:54:09,958 [INFO] running 'cmake /home/rjansen/dev/shadow -DCMAKE_INSTALL_PREFIX=/home/rjansen/.shadow -DCMAKE_EXTRA_INCLUDES=/home/rjansen/.shadow/include -DCMAKE_EXTRA_LIBRARIES=/home/rjansen/.shadow/lib' from '/hom
e/rjansen/dev/shadow/build'                                                                                                                                                                                                           
-- The C compiler identification is GNU 10.1.1                                                                                                                                                                                        
-- The CXX compiler identification is GNU 10.1.1                                                                                                                                                                                      
-- Check for working C compiler: /usr/bin/cc                                                                                                                                                                                          
-- Check for working C compiler: /usr/bin/cc - works                                                                                                                                                                                  
-- Detecting C compiler ABI info                                                                                                                                                                                                      
-- Detecting C compiler ABI info - done                                                                                                                                                                                               
-- Detecting C compile features                                                                                                                                                                                                       
-- Detecting C compile features - done                                                                                                                                                                                                
-- Check for working CXX compiler: /usr/bin/c++                                                                                                                                                                                       
-- Check for working CXX compiler: /usr/bin/c++ - works                                                                                                                                                                               
-- Detecting CXX compiler ABI info                                                                                                                                                                                                    
-- Detecting CXX compiler ABI info - done                                                                                                                                                                                             
-- Detecting CXX compile features                                                                                                                                                                                                     
-- Detecting CXX compile features - done                                                                                                                                                                                              
-- System name: Linux                                                                                                                                                                                                                 
-- System version: 5.6.11-300.fc32.x86_64                                                                                                                                                                                             
-- System processor: x86_64                                                                                                                                                                                                           
-- CMAKE_MODULE_PATH = /home/rjansen/dev/shadow/cmake/;/home/rjansen/.shadow/include                                                                                                                                                  
-- Check if the system is big endian                                                                                                                                                                                                  
-- Searching 16 bit integer                                                                                                                                                                                                           
-- Looking for sys/types.h                                                                                                                                                                                                            
-- Looking for sys/types.h - found                                                                                                                                                                                                    
-- Looking for stdint.h                                                                                                                                                                                                               
-- Looking for stdint.h - found                                                                                                                                                                                                       
-- Looking for stddef.h                                                                                                                                                                                                               
-- Looking for stddef.h - found                                                                                                                                                                                                       
-- Check size of unsigned short                                                                                                                                                                                                       
-- Check size of unsigned short - done                                                                                                                                                                                                
-- Searching 16 bit integer - Using unsigned short                                                                                                                                                                                    
-- Check if the system is big endian - little endian                                                                                                                                                                                  
-- SHADOW_VERSION_FULL=1.14.0                                                                                                                                                                                                         
-- SHADOW_VERSION_MAJOR=1                                                                                                                                                                                                             
-- SHADOW_VERSION_MINOR=14                                                                                                                                                                                                            
-- SHADOW_VERSION_PATCH=0                                                                                                                                                                                                             
-- Building Shadow v1.13.2-609-ge4cd2c32 2020-05-16                                                                                                                                                                                   
--                                                                                                                                                                                                                                    
-- -------------------------------------------------------------------------------                                                                                                                                                    
-- Current settings: (change with '$ cmake -D<option>=<on>')                                                                                                                                                                      
-- SHADOW_DEBUG=OFF                                                                                                                                                                                                                   
-- SHADOW_PROFILE=OFF                                                                                                                                                                                                                 
-- SHADOW_TEST=OFF                                                                                                                                                                                                                    
-- SHADOW_EXPORT=OFF                                                                                                                                                                                                                  
-- -------------------------------------------------------------------------------                                                                                                                                                    
--                                                                                                                                                                                                                                    
-- CMAKE_BUILD_TYPE Release enabled.                                                                                                                                                                                                  
CMake Deprecation Warning at CMakeLists.txt:151 (cmake_policy):                                                                                                                                                                       
  The OLD behavior for policy CMP0026 will be removed from a future version                                                                                                                                                           
  of CMake.                                                                                                                                                                                                                           

  The cmake-policies(7) manual explains that the OLD behaviors of all                                                                                                                                                                 
  policies are deprecated and that a policy should be set to OLD only under                                                                                                                                                           
  specific short-term circumstances.  Projects should be ported to the NEW                                                                                                                                                            
  behavior and not rely on setting a policy to OLD. 
-- Decompressing /home/rjansen/dev/shadow/resource/topology.graphml.xml.xz
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- System version: 5.6.11-300.fc32.x86_64
-- Architecture: x86_64
-- LDSO = /lib64/ld-linux-x86-64.so.2
-- LIBDL = /lib64/libdl.so.2
-- Found components for RT
-- RT_INCLUDES = /usr/include
-- RT_LIBRARIES = /usr/lib64/librt.so
-- Found components for DL
-- DL_INCLUDES = /usr/include
-- DL_LIBRARIES = /usr/lib64/libdl.so
-- Found components for M
-- M_INCLUDES = /usr/include
-- M_LIBRARIES = /usr/lib64/libm.so
-- Found components for IGRAPH
-- IGRAPH_INCLUDES = /usr/include/igraph
-- IGRAPH_LIBRARIES = /usr/lib64/libigraph.so
-- IGRAPH_VERSION_STRING_LINE = #define IGRAPH_VERSION "0.8.2"
-- IGRAPH_VERSION_MAJOR_GUESS = 0
-- IGRAPH_VERSION_MINOR_GUESS = 8
-- IGRAPH_VERSION_PATCH_GUESS = 2
-- Found components for GLIB
-- GLIB_INCLUDES = /usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- GLIB_LIBRARIES = /usr/lib64/libglib-2.0.so;/usr/lib64/libgthread-2.0.so;/usr/lib64/libgmodule-2.0.so
-- GLIB_MAJOR_VERSION = 2
-- GLIB_MINOR_VERSION = 64
-- GLIB_MICRO_VERSION = 2
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using Threads library: -lpthread
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rjansen/dev/shadow/build
</on></option>

...skip...


Scanning dependencies of target shadow-interpose
[ 98%] Building C object src/preload/CMakeFiles/shadow-interpose.dir/interposer.c.o
/home/rjansen/dev/shadow/src/preload/preload_defs.h:143:25: error: conflicting types for ‘gettimeofday’
  143 | PRELOADDEF(return, int, gettimeofday, (struct timeval* a, struct timezone* b), a, b);
      |                         ^~~~~~~~~~~~
/home/rjansen/dev/shadow/src/preload/interposer.c:208:12: note: in definition of macro ‘PRELOADDEF’
  208 | returntype functionname argumentlist { \
      |            ^~~~~~~~~~~~
In file included from /home/rjansen/dev/shadow/src/preload/interposer.c:29:
/usr/include/sys/time.h:66:12: note: previous declaration of ‘gettimeofday’ was here
   66 | extern int gettimeofday (struct timeval *__restrict __tv,
      |            ^~~~~~~~~~~~
cc1: note: unrecognized command-line option ‘-Wno-static-in-inline’ may have been intended to silence earlier diagnostics
make[2]: *** [src/preload/CMakeFiles/shadow-interpose.dir/build.make:83: src/preload/CMakeFiles/shadow-interpose.dir/interposer.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:708: src/preload/CMakeFiles/shadow-interpose.dir/all] Error 2
make: *** [Makefile:172: all] Error 2
2020-05-21 13:54:35,424 [ERROR] Non-zero return code from make.

该提问来源于开源项目:shadow/shadow

查看全部
weixin_40002238
weixin_40002238
2020/11/20 18:00
  • 点赞
  • 收藏
  • 回答
    私信

6个回复