Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Fedora 20 #564

Closed
russel opened this issue Dec 30, 2013 · 5 comments
Closed

Build fails on Fedora 20 #564

russel opened this issue Dec 30, 2013 · 5 comments

Comments

@russel
Copy link

russel commented Dec 30, 2013

I am trying to build LDC from Git master/HEAD. I am getting the following error. I am guessing the is some form of user error?

Linking CXX executable bin/ldc2
CMakeFiles/ldc2.dir/driver/main.cpp.o: In function `main':
/home/Checkouts/Git/Git/LDC/driver/main.cpp:885: undefined reference to `Port::stricmp(char const*, char const*)'
/home/Checkouts/Git/Git/LDC/driver/main.cpp:886: undefined reference to `Port::stricmp(char const*, char const*)'
lib/libldc.a(mtype.c.o): In function `TypeBasic::getProperty(Loc, Identifier*, int)':
/home/Checkouts/Git/Git/LDC/dmd2/mtype.c:2942: undefined reference to `Port::infinity'
/home/Checkouts/Git/Git/LDC/dmd2/mtype.c:2924: undefined reference to `Port::nan'
/home/Checkouts/Git/Git/LDC/dmd2/mtype.c:2861: undefined reference to `Port::ldbl_max'
lib/libldc.a(lexer.c.o): In function `Lexer::inreal(Token*)':
/home/Checkouts/Git/Git/LDC/dmd2/lexer.c:2377: undefined reference to `Port::strtold(char const*, char**)'
lib/libldc.a(module.cpp.o): In function `Module::buildTargetFiles(bool)':
/home/Checkouts/Git/Git/LDC/gen/module.cpp:104: undefined reference to `Port::stricmp(char const*, char const*)'
/home/Checkouts/Git/Git/LDC/gen/module.cpp:108: undefined reference to `Port::stricmp(char const*, char const*)'
/home/Checkouts/Git/Git/LDC/gen/module.cpp:112: undefined reference to `Port::stricmp(char const*, char const*)'
lib/libldc.a(expression.c.o): In function `RealEquals(long double, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2818: undefined reference to `Port::isNan(long double)'
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2818: undefined reference to `Port::isNan(long double)'
lib/libldc.a(expression.c.o): In function `floatToBuffer(OutBuffer*, Type*, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2876: undefined reference to `Port::strtold(char const*, char**)'
lib/libldc.a(expression.c.o): In function `realToMangleBuffer(OutBuffer*, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2945: undefined reference to `Port::isNan(long double)'
lib/libldc.a(doc.c.o): In function `isDitto(unsigned char*)':
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1755: undefined reference to `Port::memicmp(char const*, char const*, int)'
lib/libldc.a(doc.c.o): In function `skippastURL(OutBuffer*, unsigned long)':
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1853: undefined reference to `Port::memicmp(char const*, char const*, int)'
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1857: undefined reference to `Port::memicmp(char const*, char const*, int)'
lib/libldc.a(doc.c.o): In function `icmp(char const*, void*, unsigned long)':
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1742: undefined reference to `Port::memicmp(char const*, char const*, int)'
lib/libldc.a(constfold.c.o): In function `Mod(Type*, Expression*, Expression*)':
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:492: undefined reference to `Port::fmodl(long double, long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:492: undefined reference to `Port::fmodl(long double, long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:503: undefined reference to `Port::fmodl(long double, long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:503: undefined reference to `Port::fmodl(long double, long double)'
@dnadlinger
Copy link
Member

[enclosed the output in a code block for readability]

It's not necessarily a pebcak error, but first things first: Are you working from a clean Git clone/build directory?

Also, could you please paste the linking command line (make VERBOSE=1)? It seems like a bunch of functions from dmd2/root/port.c are missing.

@russel
Copy link
Author

russel commented Dec 30, 2013

Just getting more data on Fedora 20. The Git repository is "clean" as far as I am aware. Indeed the build is entirely successful on my Debian Unstable.

@russel
Copy link
Author

russel commented Dec 30, 2013

Linking CXX executable bin/ldc2
/usr/bin/cmake -E cmake_link_script CMakeFiles/ldc2.dir/link.txt --verbose=1
/usr/bin/c++       CMakeFiles/ldc2.dir/driver/cl_options.cpp.o CMakeFiles/ldc2.dir/driver/configfile.cpp.o CMakeFiles/ldc2.dir/driver/targetmachine.cpp.o CMakeFiles/ldc2.dir/driver/toobj.cpp.o CMakeFiles/ldc2.dir/driver/tool.cpp.o CMakeFiles/ldc2.dir/driver/linker.cpp.o CMakeFiles/ldc2.dir/driver/main.cpp.o CMakeFiles/ldc2.dir/driver/ldc-version.cpp.o  -o bin/ldc2 -rdynamic lib/libldc.a -lconfig++ -lpthread -ldl -ltinfo /usr/lib64/llvm/libLLVMAsmParser.a /usr/lib64/llvm/libLLVMTableGen.a /usr/lib64/llvm/libLLVMInstrumentation.a /usr/lib64/llvm/libLLVMipo.a /usr/lib64/llvm/libLLVMVectorize.a /usr/lib64/llvm/libLLVMLinker.a /usr/lib64/llvm/libLLVMBitWriter.a /usr/lib64/llvm/libLLVMX86Disassembler.a /usr/lib64/llvm/libLLVMX86AsmParser.a /usr/lib64/llvm/libLLVMX86CodeGen.a /usr/lib64/llvm/libLLVMX86Desc.a /usr/lib64/llvm/libLLVMX86Info.a /usr/lib64/llvm/libLLVMX86AsmPrinter.a /usr/lib64/llvm/libLLVMX86Utils.a /usr/lib64/llvm/libLLVMPowerPCCodeGen.a /usr/lib64/llvm/libLLVMPowerPCDesc.a /usr/lib64/llvm/libLLVMPowerPCAsmPrinter.a /usr/lib64/llvm/libLLVMPowerPCAsmParser.a /usr/lib64/llvm/libLLVMPowerPCInfo.a /usr/lib64/llvm/libLLVMARMDisassembler.a /usr/lib64/llvm/libLLVMARMCodeGen.a /usr/lib64/llvm/libLLVMARMAsmParser.a /usr/lib64/llvm/libLLVMARMDesc.a /usr/lib64/llvm/libLLVMARMInfo.a /usr/lib64/llvm/libLLVMARMAsmPrinter.a /usr/lib64/llvm/libLLVMAArch64Disassembler.a /usr/lib64/llvm/libLLVMAArch64CodeGen.a /usr/lib64/llvm/libLLVMAArch64AsmParser.a /usr/lib64/llvm/libLLVMAArch64Desc.a /usr/lib64/llvm/libLLVMAArch64Info.a /usr/lib64/llvm/libLLVMAArch64AsmPrinter.a /usr/lib64/llvm/libLLVMAArch64Utils.a /usr/lib64/llvm/libLLVMCppBackendCodeGen.a /usr/lib64/llvm/libLLVMCppBackendInfo.a /usr/lib64/llvm/libLLVMNVPTXCodeGen.a /usr/lib64/llvm/libLLVMNVPTXDesc.a /usr/lib64/llvm/libLLVMNVPTXInfo.a /usr/lib64/llvm/libLLVMNVPTXAsmPrinter.a /usr/lib64/llvm/libLLVMSystemZCodeGen.a /usr/lib64/llvm/libLLVMSystemZAsmParser.a /usr/lib64/llvm/libLLVMSystemZDesc.a /usr/lib64/llvm/libLLVMSystemZInfo.a /usr/lib64/llvm/libLLVMSystemZAsmPrinter.a /usr/lib64/llvm/libLLVMR600CodeGen.a /usr/lib64/llvm/libLLVMSelectionDAG.a /usr/lib64/llvm/libLLVMAsmPrinter.a /usr/lib64/llvm/libLLVMMCParser.a /usr/lib64/llvm/libLLVMCodeGen.a /usr/lib64/llvm/libLLVMObjCARCOpts.a /usr/lib64/llvm/libLLVMScalarOpts.a /usr/lib64/llvm/libLLVMInstCombine.a /usr/lib64/llvm/libLLVMTransformUtils.a /usr/lib64/llvm/libLLVMipa.a /usr/lib64/llvm/libLLVMAnalysis.a /usr/lib64/llvm/libLLVMTarget.a /usr/lib64/llvm/libLLVMCore.a /usr/lib64/llvm/libLLVMR600Desc.a /usr/lib64/llvm/libLLVMR600Info.a /usr/lib64/llvm/libLLVMR600AsmPrinter.a /usr/lib64/llvm/libLLVMMC.a /usr/lib64/llvm/libLLVMObject.a /usr/lib64/llvm/libLLVMSupport.a -L/usr/lib64/llvm  -lz -lpthread -lffi -ldl -lm -lpthread -ldl -ltinfo 
CMakeFiles/ldc2.dir/driver/main.cpp.o: In function `main':
/home/Checkouts/Git/Git/LDC/driver/main.cpp:885: undefined reference to `Port::stricmp(char const*, char const*)'
/home/Checkouts/Git/Git/LDC/driver/main.cpp:886: undefined reference to `Port::stricmp(char const*, char const*)'
lib/libldc.a(lexer.c.o): In function `Lexer::inreal(Token*)':
/home/Checkouts/Git/Git/LDC/dmd2/lexer.c:2377: undefined reference to `Port::strtold(char const*, char**)'
lib/libldc.a(mtype.c.o): In function `TypeBasic::getProperty(Loc, Identifier*, int)':
/home/Checkouts/Git/Git/LDC/dmd2/mtype.c:2942: undefined reference to `Port::infinity'
/home/Checkouts/Git/Git/LDC/dmd2/mtype.c:2924: undefined reference to `Port::nan'
/home/Checkouts/Git/Git/LDC/dmd2/mtype.c:2861: undefined reference to `Port::ldbl_max'
lib/libldc.a(module.cpp.o): In function `Module::buildTargetFiles(bool)':
/home/Checkouts/Git/Git/LDC/gen/module.cpp:104: undefined reference to `Port::stricmp(char const*, char const*)'
/home/Checkouts/Git/Git/LDC/gen/module.cpp:108: undefined reference to `Port::stricmp(char const*, char const*)'
/home/Checkouts/Git/Git/LDC/gen/module.cpp:112: undefined reference to `Port::stricmp(char const*, char const*)'
lib/libldc.a(doc.c.o): In function `isDitto(unsigned char*)':
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1755: undefined reference to `Port::memicmp(char const*, char const*, int)'
lib/libldc.a(doc.c.o): In function `skippastURL(OutBuffer*, unsigned long)':
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1853: undefined reference to `Port::memicmp(char const*, char const*, int)'
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1857: undefined reference to `Port::memicmp(char const*, char const*, int)'
lib/libldc.a(doc.c.o): In function `icmp(char const*, void*, unsigned long)':
/home/Checkouts/Git/Git/LDC/dmd2/doc.c:1742: undefined reference to `Port::memicmp(char const*, char const*, int)'
lib/libldc.a(expression.c.o): In function `RealEquals(long double, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2818: undefined reference to `Port::isNan(long double)'
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2818: undefined reference to `Port::isNan(long double)'
lib/libldc.a(expression.c.o): In function `floatToBuffer(OutBuffer*, Type*, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2876: undefined reference to `Port::strtold(char const*, char**)'
lib/libldc.a(expression.c.o): In function `realToMangleBuffer(OutBuffer*, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/expression.c:2945: undefined reference to `Port::isNan(long double)'
lib/libldc.a(ctfeexpr.c.o): In function `realCmp(TOK, long double, long double)':
/home/Checkouts/Git/Git/LDC/dmd2/ctfeexpr.c:1181: undefined reference to `Port::isNan(long double)'
/home/Checkouts/Git/Git/LDC/dmd2/ctfeexpr.c:1181: undefined reference to `Port::isNan(long double)'
lib/libldc.a(ctfeexpr.c.o): In function `ctfeRawCmp(Loc, Expression*, Expression*)':
/home/Checkouts/Git/Git/LDC/dmd2/ctfeexpr.c:1359: undefined reference to `Port::isNan(long double)'
/home/Checkouts/Git/Git/LDC/dmd2/ctfeexpr.c:1359: undefined reference to `Port::isNan(long double)'
lib/libldc.a(constfold.c.o): In function `Mod(Type*, Expression*, Expression*)':
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:492: undefined reference to `Port::fmodl(long double, long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:492: undefined reference to `Port::fmodl(long double, long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:503: undefined reference to `Port::fmodl(long double, long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:503: undefined reference to `Port::fmodl(long double, long double)'
lib/libldc.a(constfold.c.o): In function `Pow(Type*, Expression*, Expression*)':
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:610: undefined reference to `Port::nan'
lib/libldc.a(constfold.c.o): In function `Equal(TOK, Type*, Expression*, Expression*)':
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:932: undefined reference to `Port::isNan(long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:932: undefined reference to `Port::isNan(long double)'
lib/libldc.a(constfold.c.o): In function `Cmp(TOK, Type*, Expression*, Expression*)':
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:1085: undefined reference to `Port::isNan(long double)'
/home/Checkouts/Git/Git/LDC/dmd2/constfold.c:1085: undefined reference to `Port::isNan(long double)'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/ldc2] Error 1
make[2]: Leaving directory `/home/Checkouts/Git/Git/LDC/Build_Fedora'
make[1]: *** [CMakeFiles/ldc2.dir/all] Error 2
make[1]: Leaving directory `/home/Checkouts/Git/Git/LDC/Build_Fedora'
make: *** [all] Error 2

@redstar
Copy link
Member

redstar commented Jan 12, 2014

Can't confirm. I did a clean install of Fedora 20 Desktop 64bit and installed the following packages:

yum install gcc gcc-c++ llvm llvm-devel llvm-static git cmake libconfig libconfig-devel zlib zlib-devel

Then I cloned the repository git clone --recurse-submodule https://github.com/ldc-developers/ldc.git, changed in my build directory and issued cmake ../ldc and make. No linker error.

From the error message it looks like dmd2/root/port.c is not compiled. I propose you should clean your build folder and re-run cmake.

@russel
Copy link
Author

russel commented Jun 6, 2014

Time has left this report behind, so it seems right to close it.

@russel russel closed this as completed Jun 6, 2014
redstar pushed a commit that referenced this issue Sep 27, 2014
move exception functions to exception.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants