Giter Club home page Giter Club logo

Comments (9)

mstorsjo avatar mstorsjo commented on July 20, 2024

These errors come from install-wrappers.sh, not from the llvm install itself, when trying to create a symlink e.g. x86_64-w64-mingw32-nm.exe pointing to llvm-nm.exe. On msys, symlinks get created as normal copies of the files. Do you have llvm-nm.exe in the bin dir that you are trying to install into?

from llvm-mingw.

jcelerier avatar jcelerier commented on July 20, 2024

I have the following :

jcelerier@MSI MINGW64 /c/dev/llvm/llvm-mingw
$ find . -name llvm-nm.exe
./llvm/build/bin/llvm-nm.exe
./llvm/build/llvm/bin/llvm-nm.exe

(I ran ./build-all.sh llvm from this folder)

from llvm-mingw.

jcelerier avatar jcelerier commented on July 20, 2024

Here is what install-wrappers.sh does when putting bash in verbose mode:

$ ./install-wrappers.sh llvm
+ set -e
+ '[' 1 -lt 1 ']'
+ PREFIX=llvm
+ : i686 x86_64 armv7 aarch64
+ '[' -n '' ']'
+ : cc
+ case $(uname) in
++ uname
+ EXEEXT=.exe
+ '[' -n .exe ']'
++ cut -f 1 -d .
+++ echo 'llvm/lib/clang/*'
+++ awk '{print $NF}'
++ basename 'llvm/lib/clang/*'
+ CLANG_MAJOR='*'
+ WRAPPER_FLAGS=' -municode -DCLANG="clang-*"'
+ mkdir -p llvm/bin
+ cp wrappers/clang-target-wrapper.sh wrappers/dlltool-wrapper.sh wrappers/ld-wrapper.sh wrappers/objcopy-wrapper.sh wrappers/objdump-wrapper.sh llvm/bin
+ '[' -n '' ']'
+ cc wrappers/change-pe-arch.c -o llvm/bin/change-pe-arch.exe
+ cc wrappers/clang-target-wrapper.c -o llvm/bin/clang-target-wrapper.exe -O2 -Wl,-s -municode '-DCLANG="clang-*"'
+ cc wrappers/windres-wrapper.c -o llvm/bin/windres-wrapper.exe -O2 -Wl,-s -municode '-DCLANG="clang-*"'
+ '[' -n .exe ']'
+ CTW_SUFFIX=.exe
+ CTW_LINK_SUFFIX=.exe
+ cd llvm/bin
+ for arch in $ARCHS
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-clang.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-clang++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-gcc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-g++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-cc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-c99.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-c11.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe i686-w64-mingw32-c++.exe
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ar.exe i686-w64-mingw32-ar.exe
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-ar.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ranlib.exe i686-w64-mingw32-ranlib.exe
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-ranlib.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-nm.exe i686-w64-mingw32-nm.exe
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-nm.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-strings.exe i686-w64-mingw32-strings.exe
ln: impossible de créer le lien symbolique 'i686-w64-mingw32-strings.exe': No such file or directory
+ true
+ for exec in windres
+ ln -sf windres-wrapper.exe i686-w64-mingw32-windres.exe
+ for exec in ld objdump dlltool
+ ln -sf ld-wrapper.sh i686-w64-mingw32-ld
+ for exec in ld objdump dlltool
+ ln -sf objdump-wrapper.sh i686-w64-mingw32-objdump
+ for exec in ld objdump dlltool
+ ln -sf dlltool-wrapper.sh i686-w64-mingw32-dlltool
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh i686-w64-mingw32-objcopy
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh i686-w64-mingw32-strip
+ for arch in $ARCHS
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-clang.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-clang++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-gcc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-g++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-cc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-c99.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-c11.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe x86_64-w64-mingw32-c++.exe
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ar.exe x86_64-w64-mingw32-ar.exe
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-ar.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ranlib.exe x86_64-w64-mingw32-ranlib.exe
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-ranlib.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-nm.exe x86_64-w64-mingw32-nm.exe
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-nm.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-strings.exe x86_64-w64-mingw32-strings.exe
ln: impossible de créer le lien symbolique 'x86_64-w64-mingw32-strings.exe': No such file or directory
+ true
+ for exec in windres
+ ln -sf windres-wrapper.exe x86_64-w64-mingw32-windres.exe
+ for exec in ld objdump dlltool
+ ln -sf ld-wrapper.sh x86_64-w64-mingw32-ld
+ for exec in ld objdump dlltool
+ ln -sf objdump-wrapper.sh x86_64-w64-mingw32-objdump
+ for exec in ld objdump dlltool
+ ln -sf dlltool-wrapper.sh x86_64-w64-mingw32-dlltool
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh x86_64-w64-mingw32-objcopy
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh x86_64-w64-mingw32-strip
+ for arch in $ARCHS
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-clang.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-clang++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-gcc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-g++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-cc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-c99.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-c11.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe armv7-w64-mingw32-c++.exe
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ar.exe armv7-w64-mingw32-ar.exe
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-ar.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ranlib.exe armv7-w64-mingw32-ranlib.exe
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-ranlib.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-nm.exe armv7-w64-mingw32-nm.exe
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-nm.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-strings.exe armv7-w64-mingw32-strings.exe
ln: impossible de créer le lien symbolique 'armv7-w64-mingw32-strings.exe': No such file or directory
+ true
+ for exec in windres
+ ln -sf windres-wrapper.exe armv7-w64-mingw32-windres.exe
+ for exec in ld objdump dlltool
+ ln -sf ld-wrapper.sh armv7-w64-mingw32-ld
+ for exec in ld objdump dlltool
+ ln -sf objdump-wrapper.sh armv7-w64-mingw32-objdump
+ for exec in ld objdump dlltool
+ ln -sf dlltool-wrapper.sh armv7-w64-mingw32-dlltool
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh armv7-w64-mingw32-objcopy
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh armv7-w64-mingw32-strip
+ for arch in $ARCHS
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-clang.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-clang++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-gcc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-g++.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-cc.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-c99.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-c11.exe
+ for exec in clang clang++ gcc g++ cc c99 c11 c++
+ ln -sf clang-target-wrapper.exe aarch64-w64-mingw32-c++.exe
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ar.exe aarch64-w64-mingw32-ar.exe
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-ar.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-ranlib.exe aarch64-w64-mingw32-ranlib.exe
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-ranlib.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-nm.exe aarch64-w64-mingw32-nm.exe
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-nm.exe': No such file or directory
+ true
+ for exec in ar ranlib nm strings
+ ln -sf llvm-strings.exe aarch64-w64-mingw32-strings.exe
ln: impossible de créer le lien symbolique 'aarch64-w64-mingw32-strings.exe': No such file or directory
+ true
+ for exec in windres
+ ln -sf windres-wrapper.exe aarch64-w64-mingw32-windres.exe
+ for exec in ld objdump dlltool
+ ln -sf ld-wrapper.sh aarch64-w64-mingw32-ld
+ for exec in ld objdump dlltool
+ ln -sf objdump-wrapper.sh aarch64-w64-mingw32-objdump
+ for exec in ld objdump dlltool
+ ln -sf dlltool-wrapper.sh aarch64-w64-mingw32-dlltool
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh aarch64-w64-mingw32-objcopy
+ for exec in objcopy strip
+ ln -sf objcopy-wrapper.sh aarch64-w64-mingw32-strip
+ '[' -n .exe ']'
+ '[' '!' -L clang.exe ']'
+ mv clang.exe clang-target-wrapper.exe
mv: impossible d'évaluer 'clang.exe': No such file or directory

from llvm-mingw.

jcelerier avatar jcelerier commented on July 20, 2024

my bad, when looking more closely, in my /mingw64/bin I have x86_64-w64-mingw32-gcc-ar.exe, not x86_64-w64-mingw32-ar.exe ; where could I get them ? aren't those supposed to be just symlinks maybe ?

from llvm-mingw.

mstorsjo avatar mstorsjo commented on July 20, 2024

The problem clearly is that you used a relative path for the installation target; I hadn't thought about that before.

That means that llvm installed its output into the relative path llvm, when it was in the llvm/build directory, effectively installing it into llvm/build/llvm. Then install-wrappers.sh tries to work on top of this, enters the installation target path llvm/bin, but doesn't find the output llvm-nm.exe there.

To install to a relative path, do ./build-all.sh $(pwd)/llvm. I'm not sure if cmake manages to apply the change in the existing build dir, or if you need to wipe llvm/build inbetween.

But ./llvm within the llvm-mingw directory is definitely not a good target path, as that's where the llvm sources and build dir are kept. Perhaps ./build-all.sh $(cur)/toolchain, or any other path outside of the llvm-mingw dir.

Also, msys doesn't support symlinks. If you create a symlink, msys effectively makes a copy instead. (This has some implications regarding reinstalling/upgrading llvm-mingw on top of an existing build.)

from llvm-mingw.

jcelerier avatar jcelerier commented on July 20, 2024

that was this indeed ! if you want I can do a PR that calls realpath on the path passed to build-all.sh so that it's guaranteed to be an absolute path

from llvm-mingw.

mstorsjo avatar mstorsjo commented on July 20, 2024

that was this indeed ! if you want I can do a PR that calls realpath on the path passed to build-all.sh so that it's guaranteed to be an absolute path

Thanks, but I can try to fix it myself. I'll probably do something like PREFIX=$(cd $PREFIX && pwd) since realpath doens't seem to be universally available (it's not available on macOS).

from llvm-mingw.

jcelerier avatar jcelerier commented on July 20, 2024

nice, thanks. funny that something that fundamental isn't there on the 🍎

from llvm-mingw.

mstorsjo avatar mstorsjo commented on July 20, 2024

I pushed a fix for this on master now, in 53db1c3.

from llvm-mingw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.