主要问题
我正试图在Ubuntu14.04.3LTS上构建linuxbrew独立安装,但是原始链接中的脚本目前已经中断。我的理想答案是一次正确地设置它的脚本。我改进了脚本的打嗝次数要少一些。
当前在修复脚本方面的进展
作为独立设置的一部分,我无法通过linuxbrew构建gcc时克服crti.o错误。然而,我发现一些资源解释了这个问题:
我搜索了文件就在那里!
find -name crti.o
./.linuxbrew/lib/crti.o
./.linuxbrew/Cellar/glibc/2.19/lib/crti.o我目前正处于下面的crtn.o编译器错误中
/home/hbr/.linuxbrew/Cellar/binutils/2.25.1/x86_64-unknown-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/home/hbr/.linuxbrew/Cellar/binutils/2.25.1/x86_64-unknown-linux-gnu/bin/ld: cannot find -lc
/home/hbr/.linuxbrew/Cellar/binutils/2.25.1/x86_64-unknown-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/tmp/gcc20150929-3726-hif3of/gcc-5.2.0/build/x86_64-unknown-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/tmp/gcc20150929-3726-hif3of/gcc-5.2.0/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc20150929-3726-hif3of/gcc-5.2.0/build'
make: *** [bootstrap] Error 2本质上,在这一步中,我需要弄清楚如何确保brew/linuxbrew/ gcc编译命令知道在哪里找到它。我尝试将它添加到PATH、LIBRARY_PATH和剧本中的LD_LIBRARY_PATH中,但都没有成功。因此,必须有其他方法来确保正确设置路径并找到对象文件。有什么想法吗?
注意:我最初在这个github问题中寻找帮助,但他们目前还无法解决这个问题。
更新
我认为在这个linuxbrew公式中可能需要一个linuxbrew来实现在缺少stackoverflow crti.o文件中找到的解决方案之一。
这是原始的自制gcc配方供参考。
发布于 2015-10-06 23:52:17
我已经用解决方案更新了linuxbrew独立安装指令。我还创建了一个经过测试并在14.04中工作的更新的linuxbrew-standalone.sh,并在TODO注释中列出了以下几个小的注意事项。
# /bin/bash
set -e
set -u
set -x
cd $HOME
# TODO: The next ln -s line breaks cross compiling with multiarch, need an alternative!
# source: https://stackoverflow.com/a/9004026/99379
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
sudo apt-get update -y
sudo apt-get update --fix-missing -y
sudo apt-get install build-essential curl g++ git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev gawk make patch tcl -y
unset LD_LIBRARY_PATH PKG_CONFIG_PATH HOMEBREW_CC
PATH=$HOME/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
yes | ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/linuxbrew/go/install)"
# hang on here. you will have to press return
# note that even if brew doctor is a little unhappy we want to keep going
brew doctor || true
mkdir $HOME/.linuxbrew/lib
ln -s lib $HOME/.linuxbrew/lib64
ln -s $HOME/.linuxbrew/lib $HOME/.linuxbrew/lib64
ln -s /usr/lib64/libstdc++.so.6 /lib64/libgcc_s.so.1 $HOME/.linuxbrew/lib/
PATH=$HOME/.linuxbrew/lib:$PATH
export PATH
LIBRARY_PATH=$HOME/.linuxbrew/lib
export LIBRARY_PATH
LD_LIBRARY_PATH=$HOME/.linuxbrew/lib
export LD_LIBRARY_PATH
# before this, you may want to `brew edit glibc` to produce compatibility for your particular kernel, for example:
# "--enable-version=2.6.18"
#brew unlink gawk
brew install glibc
brew unlink glibc
brew install https://raw.githubusercontent.com/Homebrew/homebrew-dupes/master/zlib.rb
brew reinstall binutils
brew link glibc
brew install patchelf
brew install gcc --with-glibc --only-dependencies -v
# When tested gcc was working except for the linking step, that's why it is force-accepted with ||true
# TODO: make it so force accepting isn't necessary and errors are shown correctly
brew install gcc --with-glibc -v || true
rm -f $HOME/.linuxbrew/lib/{libstdc++.so.6,libgcc_s.so.1}
brew link gcc --overwrite
export HOMEBREW_CC=gcc
brew install bzip2 curl expat
brew install git --with-brewed-curl --with-brewed-openssl --without-tcl-tk
brew tap homebrew/dupes
brew install coreutils findutils gawk gnu-sed gnu-which grep libpng libxml2 libxslt make ncurses readline
#ln -s ncursesw/curses.h ncursesw/form.h ncursesw/ncurses.h ncursesw/term.h ncursesw/termcap.h $HOME/.linuxbrew/include/
#ln -s libncurses.a $HOME/.linuxbrew/lib/libcurses.a
#ln -s libncurses.so $HOME/.linuxbrew/lib/libcurses.so
brew install ruby
PATH=$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin
brew install hello && brew test hello; brew remove hello修复事物的主要行是sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64,但这附带了一个警告,我对修复很感兴趣,因为它是用多拱中断交叉编译。
https://stackoverflow.com/questions/32855096
复制相似问题