stabilizer icon indicating copy to clipboard operation
stabilizer copied to clipboard

Trying ton run stabilizer in a Docker environment

Open BuonOmo opened this issue 4 years ago • 2 comments

Hi,

I've tried to run stabilizer in a container to be able to use it as-is in a deprecated environment (llvm 3.1) for small files. However, it doesn't build, and my cmake knowledge is very limited. I'll dig more into that later, but if you have any pointer, I'd be thankful!

FROM alpine:3.9

RUN apk add --no-cache git cmake build-base python \
	&& rm -rf /tmp/* /var/cache/apk/*
RUN git clone --depth 1 --branch llvmorg-3.1.0 https://github.com/llvm/llvm-project.git
RUN cd llvm-project \
	&& mkdir build \
	&& cd build \
	&& cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../llvm \
	&& make

RUN git clone git://github.com/ccurtsinger/stabilizer.git stabilizer
RUN cd stabilizer && make

Currently the bug seems to be that I need to specify another std version to CMAKE, yet I've tried many way of doing so without success. The cmake command works, and the make command fails at:

[  5%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp: In static member function 'static void* llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)':
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp:158:42: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
    if (!strcmp(symbolName, #SYM)) return &SYM
                                          ^
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp:165:5: note: in expansion of macro 'EXPLICIT_SYMBOL'
     EXPLICIT_SYMBOL(stderr);
     ^~~~~~~~~~~~~~~
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp:158:42: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
    if (!strcmp(symbolName, #SYM)) return &SYM
                                          ^
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp:166:5: note: in expansion of macro 'EXPLICIT_SYMBOL'
     EXPLICIT_SYMBOL(stdout);
     ^~~~~~~~~~~~~~~
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp:158:42: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
    if (!strcmp(symbolName, #SYM)) return &SYM
                                          ^
/llvm-project/llvm/lib/Support/DynamicLibrary.cpp:167:5: note: in expansion of macro 'EXPLICIT_SYMBOL'
     EXPLICIT_SYMBOL(stdin);
     ^~~~~~~~~~~~~~~
make[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/build.make:830: lib/Support/CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:91: lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Ulysse

BuonOmo avatar Nov 09 '21 13:11 BuonOmo

Hey! I can't help but I would certainly be interested in the resulting docker :)

tbarbette avatar Nov 09 '21 13:11 tbarbette

Hey @tbarbette yeah I guessed this would be linked to #6

BuonOmo avatar Nov 09 '21 13:11 BuonOmo