santoshn / softboundcets-3.8.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LightFTP build failure

pekd opened this issue · comments

LightFTP fails to build using SoftBoundCETS. Error:

build@host ..FTP-softboundcets/Source/Other/Release (git)-[master] % make
Building file: ../cfgparse.c
Invoking: GCC C Compiler
/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang -fsoftboundcets -O0 -g -std=c99 -O3 -Wall -Wextra -c -fmessage-length=0 -Wno-unused-parameter -Wno-unused-result -fno-ident -MMD -MP -MF"cfgparse.d" -MT"cfgparse.o" -o "cfgparse.o" "../cfgparse.c"
Finished building: ../cfgparse.c

Building file: ../ftpserv.c
Invoking: GCC C Compiler
/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang -fsoftboundcets -O0 -g -std=c99 -O3 -Wall -Wextra -c -fmessage-length=0 -Wno-unused-parameter -Wno-unused-result -fno-ident -MMD -MP -MF"ftpserv.d" -MT"ftpserv.o" -o "ftpserv.o" "../ftpserv.c"
clang-3.8: /home/build/git/softboundcets-3.8.0/llvm-38/lib/Transforms/Instrumentation/SoftBoundCETS.cpp:3831: void SoftBoundCETS::addDereferenceChecks(llvm::Function*): Assertion `0 && "Atomic Instructions not handled"' failed.
#0 0x000055899622eeef llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x2b8eeef)
#1 0x000055899622f241 PrintStackTraceSignalHandler(void*) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x2b8f241)
#2 0x000055899622d676 llvm::sys::RunSignalHandlers() (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x2b8d676)
#3 0x000055899622e82a SignalHandler(int) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x2b8e82a)
#4 0x00007fdb511dddb0 __restore_rt (/usr/lib/libpthread.so.0+0x11db0)
#5 0x00007fdb50348860 __GI_raise (/usr/lib/libc.so.6+0x34860)
#6 0x00007fdb50349ec9 __GI_abort (/usr/lib/libc.so.6+0x35ec9)
#7 0x00007fdb503410bc __assert_fail_base (/usr/lib/libc.so.6+0x2d0bc)
#8 0x00007fdb50341133 (/usr/lib/libc.so.6+0x2d133)
#9 0x0000558996d3a2f4 SoftBoundCETS::addDereferenceChecks(llvm::Function*) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x369a2f4)
#10 0x0000558996d40b25 SoftBoundCETS::runOnModule(llvm::Module&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x36a0b25)
#11 0x0000558995d4bae3 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x26abae3)
#12 0x0000558995d4c229 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x26ac229)
#13 0x0000558995d4c421 llvm::legacy::PassManager::run(llvm::Module&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x26ac421)
#14 0x000055899642fcff (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, llvm::raw_pwrite_stream*) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x2d8fcff)
#15 0x000055899642fe72 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x2d8fe72)
#16 0x0000558996ca8b1a clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x3608b1a)
#17 0x000055899757206a clang::ParseAST(clang::Sema&, bool, bool) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x3ed206a)
#18 0x00005589968f888d clang::ASTFrontendAction::ExecuteAction() (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x325888d)
#19 0x0000558996cab98c clang::CodeGenAction::ExecuteAction() (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x360b98c)
#20 0x00005589968f8324 clang::FrontendAction::Execute() (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x3258324)
#21 0x00005589968aef0a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x320ef0a)
#22 0x00005589969fcf99 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x335cf99)
#23 0x0000558994972ff3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x12d2ff3)
#24 0x0000558994969862 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x12c9862)
#25 0x000055899496a345 main (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x12ca345)
#26 0x00007fdb50334f4a __libc_start_main (/usr/lib/libc.so.6+0x20f4a)
#27 0x00005589949659ba _start (/home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8+0x12c59ba)
Stack dump:
0.      Program arguments: /home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang-3.8 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name ftpserv.c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-file /home/build/git/LightFTP-softboundcets/Source/Other/Release/ftpserv.o -resource-dir /home/build/git/softboundcets-3.8.0/llvm-38/build/bin/../lib/clang/3.8.0 -dependency-file ftpserv.d -MP -MT ftpserv.o -internal-isystem /usr/local/include -internal-isystem /home/build/git/softboundcets-3.8.0/llvm-38/build/bin/../lib/clang/3.8.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wall -Wextra -Wno-unused-parameter -Wno-unused-result -std=c99 -fdebug-compilation-dir /home/build/git/LightFTP-softboundcets/Source/Other/Release -ferror-limit 19 -fmessage-length 0 -fsoftboundcets -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o ftpserv.o -x c ../ftpserv.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass ' SoftBoundCETS' on module '../ftpserv.c'.
clang-3.8: error: unable to execute command: Aborted (core dumped)
clang-3.8: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.8.0 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/build/git/softboundcets-3.8.0/llvm-38/build/bin
clang-3.8: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-3.8: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.8: note: diagnostic msg: /tmp/ftpserv-2d4203.c
clang-3.8: note: diagnostic msg: /tmp/ftpserv-2d4203.sh
clang-3.8: note: diagnostic msg:

********************
make: *** [subdir.mk:26: ftpserv.o] Error 254

The files /tmp/ftpserv-2d4203.c and /tmp/ftpserv-2d4203.sh are attached here: ftpserv.tar.gz

Changes to the Makefile of LightFTP:

diff --git a/Source/Other/Release/makefile b/Source/Other/Release/makefile
index 5108401..fc082de 100644
--- a/Source/Other/Release/makefile
+++ b/Source/Other/Release/makefile
@@ -2,6 +2,10 @@
 # Automatically-generated file. Do not edit!
 ################################################################################

+CC := /home/build/git/softboundcets-3.8.0/llvm-38/build/bin/clang
+CFLAGS := -fsoftboundcets -O0 -g
+LDFLAGS := -fsoftboundcets -O0 -g -L/home/build/git/softboundcets-3.8.0/runtime
+
 -include ../makefile.init

 RM := rm -rf
@@ -19,6 +23,8 @@ endif

 -include ../makefile.defs

+LIBS += -lm -lrt -lsoftboundcets_rt
+
 # Add inputs and outputs from these tool invocations to the build variables

 # All Target
@@ -28,7 +34,7 @@ all: fftp
 fftp: $(OBJS) $(USER_OBJS)
        @echo 'Building target: $@'
        @echo 'Invoking: GCC C Linker'
-       gcc  -o "fftp" $(OBJS) $(USER_OBJS) $(LIBS)
+       $(CC) $(LDLAGS) -o "fftp" $(OBJS) $(USER_OBJS) $(LIBS)
        @echo 'Finished building target: $@'
        @echo ' '

diff --git a/Source/Other/Release/subdir.mk b/Source/Other/Release/subdir.mk
index 98e413f..e131be9 100644
--- a/Source/Other/Release/subdir.mk
+++ b/Source/Other/Release/subdir.mk
@@ -23,7 +23,7 @@ C_DEPS += \
 %.o: ../%.c
        @echo 'Building file: $<'
        @echo 'Invoking: GCC C Compiler'
-       gcc -std=c99 -O3 -Wall -Wextra -c -fmessage-length=0 -Wno-unused-parameter -Wno-unused-result -fno-ident -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+       $(CC) $(CFLAGS) -std=c99 -O3 -Wall -Wextra -c -fmessage-length=0 -Wno-unused-parameter -Wno-unused-result -fno-ident -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
        @echo 'Finished building: $<'
        @echo ' '