[LLVMbugs] [Bug 11600] New: LLVM cross-compilation fail when build=mingw

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 16 13:50:07 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11600

             Bug #: 11600
           Summary: LLVM cross-compilation fail when build=mingw
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-config
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: dmalyshev at accesssoftek.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I use mingw32 and cross tools based on gcc-4.5.1

LLVM configured with following parameters:

../llvm/configure
 --prefix=/g/llvm-armv7 \
 --build=i686-pc-mingw32 \
 --host=armv7-none-linux-gnueabi \
 --target=armv7-none-linux-gnueabi \
 --disable-shared --disable-multilib --disable-nls --disable-bootstrap \
 --with-cpu=cortex-a8 --with-fpu=neon --with-abi=aapcs --with-float=hard

and make stopped with following messages:

make[2]: *** No rule to make target
`g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMipo.a',
needed by `/g/mytries/build/obj-cross-llvm/Debug+Asserts/bin/opt'.  Stop.
make[2]: Leaving directory `/g/mytries/build/obj-cross-llvm/tools/opt'
make[1]: *** [opt/.makeall] Error 2

And the same result if I try make any other tool.
I found that the command:

/g/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/bin/llvm-config
--libfiles ipo

returns:

g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMipo.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMScalarOpts.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMInstCombine.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMTransformUtils.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMipa.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMAnalysis.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMTarget.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMMC.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMObject.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMCore.a
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib/libLLVMSupport.a

but this libraries stored in
g:/mytries/build/obj-cross-llvm/Debug+Asserts/lib
instread of
g:/mytries/build/obj-cross-llvm/BuildTools/Debug+Asserts/lib



From: Daniel Dunbar
> My guess at the moment is that the comparison at llvm-config.cpp:186 
> (if (CurrentExecPrefix) ...) is failing perhaps due to non-normalized 
> paths on Win32.
>
> In your case, that branch definitely is supposed to be entered. If you 
> have a chance, could you run in a debugger and tell me what the values 
> of CurrentExecPrefix are in that case (as well as LLVM_OBJ_ROOT and 
> LLVM_BUILDMODE)?

Yes, you are right, CurrentExecPrefix:
g:/mytries/build/obj-cross-llvm/BuildTools/Release+Asserts

std::string(LLVM_OBJ_ROOT) + "/" + LLVM_BUILDMODE:
/g/mytries/build/obj-cross-llvm/BuildTools/Release+Asserts 

So, the comparison at llvm-config.cpp:186 is failing.

The fast solving is adds something like:

#ifdef LLVM_ON_WIN32
  CurrentExecPrefix.erase(1,1);
  CurrentExecPrefix = "/" + CurrentExecPrefix;
#endif

But maybe the best way is adds compare() function to llvm/Support/PathV2.h and
use it.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list