musl-cross-make
musl-cross-make copied to clipboard
Is it possible to support gdb
Is it possible to support gdb?
GDB is very useful.
Like: https://github.com/riscv-collab/riscv-binutils-gdb
I have compiled gdb this way:
git clone https://github.com/richfelker/musl-cross-make.git
cat >musl-cross-make/config.mak <<EOF
TARGET=i686-linux-musl
MUSL_VER=git-v1.2.2
GCC_VER=10.3.0
# Not needed libs
COMMON_CONFIG += --disable-nls
EOF
make --directory musl-cross-make -j$(nproc)
make --directory musl-cross-make install
mkdir gdb
wget https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz --output-document - \
| tar -xz --strip-components 1 --directory gdb
(cd gdb && \
PATH=$PATH:$PWD/../musl-cross-make/output/bin \
./configure \
--prefix=$PWD/output \
--host=i686-linux-musl \
--disable-nls \
--with-curses)
PATH=$PATH:$PWD/musl-cross-make/output/bin make --directory gdb -j$(nproc)
PATH=$PATH:$PWD/musl-cross-make/output/bin make --directory gdb install
Don't know if this answers your question.
I have compiled gdb this way:
git clone https://github.com/richfelker/musl-cross-make.git cat >musl-cross-make/config.mak <<EOF TARGET=i686-linux-musl MUSL_VER=git-v1.2.2 GCC_VER=10.3.0 # Not needed libs COMMON_CONFIG += --disable-nls EOF make --directory musl-cross-make -j$(nproc) make --directory musl-cross-make install mkdir gdb wget https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz --output-document - \ | tar -xz --strip-components 1 --directory gdb (cd gdb && \ PATH=$PATH:$PWD/../musl-cross-make/output/bin \ ./configure \ --prefix=$PWD/output \ --host=i686-linux-musl \ --disable-nls \ --with-curses) PATH=$PATH:$PWD/musl-cross-make/output/bin make --directory gdb -j$(nproc) PATH=$PATH:$PWD/musl-cross-make/output/bin make --directory gdb installDon't know if this answers your question.
Thank you ! It is very useful.
And I tried like this:
- Firstly, Building out a specific arch(eg. riscv64) cross-compilation tool chain by richfelker/musl-cross-make
- Secondly, Download gdb source file, and unzip the ziped file.
- And then, Configure the gdb and build:
cd gdb-source-code
./configure --target=riscv64-linux-musl --prefix=$PWD/install
make
make install
The snippet in my answer is from a longer article. If you are still unable to get gdb working, perhaps the section on "Debugging" could be of interest to you: https://ja.nsommer.dk/articles/linux-and-tiny-c-compiler-in-the-browser-part-one.html
The snippet in my answer is from a longer article. If you are still unable to get gdb working, perhaps the section on "Debugging" could be of interest to you: https://ja.nsommer.dk/articles/linux-and-tiny-c-compiler-in-the-browser-part-one.html
My homebrew cross-compiled gdb works well. Thank you for your article, nerfpops! Running Tiny C Compiler in browser is absolutely cool :)