xen0n / loongson-overlay

Support overlay for Gentoo/Loongson users
21 stars 11 forks source link

Gdb failed to build due to missing doc file #8

Open darkgeek opened 2 years ago

darkgeek commented 2 years ago

Hi,

I bump into the following errors when I try to build sys-devel/gdb on my 3A5000:

...skip...
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gdb-9999/work/gdb-9999'
Traceback (most recent call last):
  File "/usr/lib/portage/python3.9/doins.py", line 607, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/lib/portage/python3.9/doins.py", line 596, in main
    if _doins(
  File "/usr/lib/portage/python3.9/doins.py", line 439, in _doins
    return install_runner.install_file(source, os.path.dirname(dest))
  File "/usr/lib/portage/python3.9/doins.py", line 373, in install_file
    return self._ins_runner.run(source, dest_dir)
  File "/usr/lib/portage/python3.9/doins.py", line 181, in run
    sstat = os.stat(source)
FileNotFoundError: [Errno 2] No such file or directory: b'gdb/ChangeLog'
 * ERROR: sys-devel/gdb-9999::loongson failed (install phase):
 *   dodoc failed
 * 
...skip...

It seems that gdb/ChangeLog, sim/ChangeLog, gdbserver/{ChangeLog,README} are missing while doing dodoc. In order to make it pass build phrase, I have to do the following dirty workaround:

--- /var/gentoo/repos/local/sys-devel/gdb/gdb-9999.ebuild   2021-12-22 22:20:25.560250629 +0800
+++ gdb-9999.ebuild 2022-01-20 22:29:05.949400491 +0800
@@ -224,12 +224,11 @@

    docinto gdb
    dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
-       gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+       gdb/NEWS gdb/PROBLEMS
    docinto sim
-   dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+   dodoc sim/{MAINTAINERS,README-HACKING}
    if use server ; then
        docinto gdbserver
-       dodoc gdbserver/{ChangeLog,README}
    fi

    if [[ -n ${PATCH_VER} ]] ; then

Seems it works now, but still not sure what contributes to the missing of those doc files.

xen0n commented 2 years ago

Hi,

It's a bit unfortunate, but currently the gdb is not working even if you hacked around the doc installation -- it will internal error when tracing executables and hit SIGSEGV, for example.

I'll have to hack the binutils further to get something working, the sources Loongson provided is nowhere near usable (i.e. directly applies to Gentoo sources). Don't expect anything before the Chinese New Year.