trailofbits/deepstate

Build fails with GCC compiler on macOS

laurynas-biveinis opened this issue · 5 comments

With brew-installed GCC 10:

deepstate/build$ cmake .. -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
...
-- Build files have been written to: /Users/laurynas/unodb/deepstate/build
deepstate/build$ make
...
[ 14%] Building C object CMakeFiles/deepstate32.dir/src/lib/DeepState.c.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:194,
                 from /Users/laurynas/unodb/deepstate/src/include/deepstate/DeepState.h:30,
                 from /Users/laurynas/unodb/deepstate/src/lib/DeepState.c:17:
/Users/laurynas/unodb/deepstate/src/lib/DeepState.c: In function 'DeepState_NewSwarmConfig':
/Users/laurynas/unodb/deepstate/src/lib/DeepState.c:411:3: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
  411 |   strncpy(new_config->file, file, strlen(file));
      |   ^~~~~~~
/Users/laurynas/unodb/deepstate/src/lib/DeepState.c:411:3: note: length computed here
/var/folders/t2/k0br2w_j78zdnf6gnz5b4xgr0000gn/T//ccSqlfhx.s:76:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
... thousands of similar errors omitted ...
/var/folders/t2/k0br2w_j78zdnf6gnz5b4xgr0000gn/T//ccSqlfhx.s:17535:2: error: instruction requires: Not 64-bit mode
        pushl   %eax
        ^
make[2]: *** [CMakeFiles/deepstate32.dir/src/lib/DeepState.c.o] Error 1
make[1]: *** [CMakeFiles/deepstate32.dir/all] Error 2
make: *** [all] Error 2

Not just a warning, it's actually a real bug as @kosak pointed out in another channel to me.

@agroce the rest of the build errors past the fixed issue remain:

/var/folders/t2/k0br2w_j78zdnf6gnz5b4xgr0000gn/T//cchmmGsC.s:76:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/t2/k0br2w_j78zdnf6gnz5b4xgr0000gn/T//cchmmGsC.s:78:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/t2/k0br2w_j78zdnf6gnz5b4xgr0000gn/T//cchmmGsC.s:87:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
...

Should I open a new issue for this one?

Yes, and maybe you can attach a file with the full failing compile?

Wait a sec, the build log for #387 and this issue is exactly the same (except for the line numbers) - including the warning which was supposed to be fixed in f0450d6