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: improper configuration of system lib. path, under Ubuntu 20 x86_64 #41365

Open
advancedwebdeveloper opened this issue Sep 13, 2020 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@advancedwebdeveloper
Copy link

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
Member

CC @thanm @cherrymui

(though this doesn't seem wrong to me)

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 13, 2020
@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Sep 13, 2020
@advancedwebdeveloper
Copy link
Author

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
Contributor

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

/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?

@seankhliao seankhliao changed the title [gollvm] inproper configuration of system lib. path, under Ubuntu 20 x86_64 gollvm: improper configuration of system lib. path, under Ubuntu 20 x86_64 Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants