semarie / build-rust

Script helper for building rustc and cargo from source on OpenBSD (without rustup)
59 stars 15 forks source link

rust-gdb uses option which /usr/bin/gdb doesn't understand #4

Closed ltratt closed 7 years ago

ltratt commented 7 years ago

If I build nightly and try to run rust-gdb I get:

$ rust-gdb
gdb: unrecognized option `-iex'
Use `gdb --help' for a complete list of options.

If I look at the rust-gdb installed in build-rust/install_dir/nightly/bin I see:

PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \
  -d "$GDB_PYTHON_MODULE_DIRECTORY" \
  -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
  "$@"

Changing gdb to egdb solves the problem. [There may be a way that doesn't rely on egcc, but this worked for me!]

semarie commented 7 years ago

rustc requires a gdb version more recent than what we have in OpenBSD base. using the gdb from ports is the right thing to do (lang/rust port patches the wrapper).

but the purpose of this tool is just to help building without rustup, not to propose a fork of Rust based on local patches.

if you want a suitable script working out-of-box, please open an issue on rust repository. but I think the right way would be to just detect the version and abort if not match minimal requirement.

nbigaouette-eai commented 7 years ago

See https://github.com/rust-lang/rust/pull/41372