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

[gollvm] inproper configuration of system lib. path, under Ubuntu 20 x86_64 #41365

Open
advancedwebdeveloper opened this issue Sep 13, 2020 · 4 comments
Milestone

Comments

@advancedwebdeveloper
Copy link

@advancedwebdeveloper advancedwebdeveloper commented Sep 13, 2020

What version of Go are you using (go version)?

$ go version

go version go1.15rc2 gollvm LLVM 12.0.0git linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/oceanfish81/.cache/go-build" GOENV="/home/oceanfish81/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/oceanfish81/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/oceanfish81/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/tools" GCCGO="/usr/local/bin/llvm-goc" AR="ar" CC="/usr/bin/clang" CXX="/usr/bin/clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build510812938=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

What did you do?

$sudo ninja install-gollvm

What did you expect to see?

Installation into /usr/lib/

What did you see instead?

Installation into /usr/local/lib64

Ivan

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Sep 13, 2020

CC @thanm @cherrymui

(though this doesn't seem wrong to me)

@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Sep 13, 2020
@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Sep 13, 2020

It looks like all libraries (libgo*) should be installed in /usr/lib/ - but pre-compiled Go standard library was correctly installed in /usr/local/lib64/go/12/x86_64-unknown-linux-gnu/...

@ianlancetaylor ianlancetaylor modified the milestones: Gccgo, gollvm Sep 13, 2020
@thanm
Copy link
Member

@thanm thanm commented Sep 14, 2020

/usr/local is coming from CMake itself, not from gollvm:

https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html

Regarding "lib" vs "lib64" -- lib64 is currently cooked into a number of places in the driver and cmake scripting:

thanm@cetina:/ssd2/llvm-project/llvm-project/llvm/tools/gollvm$ git grep lib64
README.md:% export LD_LIBRARY_PATH=/tmp/gollvm-install/lib64
cmake/modules/AddGollvm.cmake:#       under 'lib64' as well, further fix required
cmake/modules/AddGollvm.cmake:set(libsubdir "lib64")
cmake/modules/GoVars.cmake:# Driver::installedLibDir honors ./lib64 only
driver/Driver.cpp:    // NOTE: set aarch64's lib dir to "lib64" temporarily, until necessary
driver/Driver.cpp:      llvm::sys::path::append(ldir, "../lib64");
driver/Driver.cpp:      llvm::sys::path::append(ldir, "../lib64");
driver/Driver.h:  // Installed lib dir (binary dir above plus ../lib64)
driver/GccUtils.cpp:      s.libdirs.push_back("lib64");
driver/LinuxToolChain.cpp:  return triple.isArch32Bit() ? "lib" : "lib64";
driver/LinuxToolChain.cpp:      LibDir = "lib64";

This could certainly be reworked, but it would require some doing. Happy to review if you would like to send a patch.

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Sep 14, 2020

/usr/local is coming from CMake itself, not from gollvm:

https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html

Regarding "lib" vs "lib64" -- lib64 is currently cooked into a number of places in the driver and cmake scripting:

thanm@cetina:/ssd2/llvm-project/llvm-project/llvm/tools/gollvm$ git grep lib64
README.md:% export LD_LIBRARY_PATH=/tmp/gollvm-install/lib64
cmake/modules/AddGollvm.cmake:#       under 'lib64' as well, further fix required
cmake/modules/AddGollvm.cmake:set(libsubdir "lib64")
cmake/modules/GoVars.cmake:# Driver::installedLibDir honors ./lib64 only
driver/Driver.cpp:    // NOTE: set aarch64's lib dir to "lib64" temporarily, until necessary
driver/Driver.cpp:      llvm::sys::path::append(ldir, "../lib64");
driver/Driver.cpp:      llvm::sys::path::append(ldir, "../lib64");
driver/Driver.h:  // Installed lib dir (binary dir above plus ../lib64)
driver/GccUtils.cpp:      s.libdirs.push_back("lib64");
driver/LinuxToolChain.cpp:  return triple.isArch32Bit() ? "lib" : "lib64";
driver/LinuxToolChain.cpp:      LibDir = "lib64";

This could certainly be reworked, but it would require some doing. Happy to review if you would like to send a patch.

Could you rebuild the config, so it would auto-substitute proper locations, according to distro's expectations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.