Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#42796 closed defect (fixed)

gdb-apple @1824: build failure due to texinfo5

Reported by: cooljeanius (Eric Gallager) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: larryv (Lawrence Velázquez), ntraft@…, bdemsky@…
Port: gdb-apple

Description

The error looks like this:

./elf.texi:1: warning: @section missing argument
bfd.texinfo:335: unknown command `colophon'
bfd.texinfo:346: unknown command `cygnus'
./bfdt.texi:313: raising the section level of @subsubsection which is too low
./init.texi:5: raising the section level of @subsubsection which is too low
./archive.texi:54: raising the section level of @subsubsection which is too low
./format.texi:27: raising the section level of @subsubsection which is too low
./reloc.texi:495: raising the section level of @subsubsection which is too low
./core.texi:8: raising the section level of @subsubsection which is too low
./opncls.texi:5: raising the section level of @subsubsection which is too low
./libbfd.texi:10: raising the section level of @subsubsection which is too low
./cache.texi:14: raising the section level of @subsubsection which is too low
./elf.texi:13: raising the section level of @subsubsection which is too low
make[2]: *** [bfd.info] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gdb-apple/gdb-apple/work/gdb-1824/src-x86_64/bfd/doc'
make[1]: *** [info-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gdb-apple/gdb-apple/work/gdb-1824/src-x86_64/bfd'
make: *** [all-bfd] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gdb-apple/gdb-apple/work/gdb-1824/src-x86_64'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gdb-apple/gdb-apple/work/gdb-1824/src-x86_64" && /usr/bin/make -w all MAKEINFO="/opt/local/bin/makeinfo" LEXLIB="/opt/local/lib/libfl.a" 
Exit code: 2
Error: org.macports.build for port gdb-apple returned: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: command execution failed

Whenever I ran into this error when building my fork of gdb-apple manually, I would always work around it by making sure that a copy of texinfo4 appeared first in my path... I guess the solution here would be to use the system makeinfo (i.e. /usr/bin/makeinfo) here instead of the MacPorts one, as that is still version 4, at least on my machine:

Local-Admins-MacBook-Pro:~ ericgallager$ /usr/bin/makeinfo --version
makeinfo (GNU texinfo) 4.8

Copyright (C) 2004 Free Software Foundation, Inc.
There is NO warranty.  You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING.

Attachments (1)

Portfile-gdb-apple.diff (1.1 KB) - added by rphoover@… 3 years ago.
Patch for Yosemite

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by cooljeanius (Eric Gallager)

Oops, my logfile for the original error got overwritten by the one from when it built successfully after I modified the Portfile...

comment:2 Changed 4 years ago by larryv (Lawrence Velázquez)

  • Cc larryv@… added

Cc Me!

comment:3 follow-up: Changed 4 years ago by ntraft@…

Hey Eric, could you post instructions for what changes are necessary to the Portfile?

The confusing thing here is that even though it output an error, I still have a gdb-apple binary in my bin/ folder, and it seems to work just fine... makeinfo also looks like it's there... are these prebuilt binaries? Why am I seeing this error?

comment:4 Changed 4 years ago by ntraft@…

  • Cc ntraft@… added

Cc Me!

comment:5 in reply to: ↑ 3 Changed 4 years ago by cooljeanius (Eric Gallager)

Replying to ntraft@…:

Hey Eric, could you post instructions for what changes are necessary to the Portfile?

Well I have made a bunch of changes to the portfile in general, so I am not really sure which ones were the necessary ones... I suppose I can try to walk through them though...

The first hunk is mostly just whitespace changes, so we can skip over it (I like my lines wrapped a little tighter than normal):

  • Portfile

     
    66
    77name            gdb-apple
    88version         1824
     9revision        1
    910categories      devel
    1011license         GPL-2+
    1112maintainers     jeremyhu openmaintainer
    12 description     GDB: The GNU Project Debugger with Apple Modifications (based on 6.3.50)
     13description     GDB: The GNU Project Debugger with Apple Modifications \
     14                (based on 6.3.50)
    1315
    1416long_description \
    15 GDB, the GNU Project debugger, allows you to see what is going on 'inside' \
    16 another program while it executes -- or what another program was doing at the \
    17 moment it crashed.  GDB can do four main kinds of things (plus other things \
    18 in support of these) to help you catch bugs in the act: \
    19     a) start your program, specifying anything that might affect its behavior, \
    20     b) make your program stop on specified conditions, \
    21     c) examine what has happened, when your program has stopped, \
    22     d) change things in your program, so you can experiment with correcting \
    23        the effects of one bug and go on to learn about another. \
    24 The program being debugged can be written in Ada, C, C++, Objective-C, \
    25 Pascal (and many other languages). Those programs might be executing on \
    26 the same machine as GDB (native) or on another machine (remote). GDB \
    27 can run on most popular UNIX and Microsoft Windows variants.
     17GDB, the GNU Project debugger, allows you to see what is going on \
     18'inside' another program while it executes -- or what another program was \
     19doing at the moment it crashed. GDB can do four main kinds of things \
     20(plus other things in support of these) to help you catch bugs in action: \
     21\n\
     22    a) start your program, specifying anything that might affect its \
     23       behavior, \n\
     24    b) make your program stop on specified conditions, \n\
     25    c) examine what has happened, when your program has stopped, \n\
     26    d) change things in your program, so you can experiment with \
     27       correcting the effects of 1 bug and go on to learn about another.\n\
     28\n\
     29The program being debugged can be written in Ada, C, C++, Objective-C, or \
     30Pascal, as well as many other languages. Those programs might be \
     31executing on the same machine as GDB (native) or on another machine \
     32(remote). GDB can run on most popular UNIX and Microsoft Windows variants \
     33(this version is primarily for OS X though).
    2834
    2935homepage        http://opensource.apple.com/source/gdb
    3036platforms       darwin

In the next hunk I removed the dependency on texinfo and replaced it with a dependency on gsed, because there is some tricky sed usage that I was trying to silence a warning from... gsed is not strictly necessary though.
I also added some library dependencies that otool -L said were linked against, and that nm -m confirmed that symbols were used from; but those are not relevant to the makeinfo parts though.
I also added a comment explaining why worksrcdir has to be changed.
Also all the "-append"s are because I always use "-append" by default, just in case, unless I specifically need to override something. Those additions can be ignored though:

  • Portfile

     
    3945checksums       rmd160  90290c3950dd06c1691a477b9ee302c00b681ed1 \
    4046                sha256  d25b056a826015e1e0ea338b9b8f03e40dce3ff4696faf95df259ae1a42698da
    4147
    42 depends_build   port:gettext port:zlib port:flex port:texinfo
    43 
    44 worksrcdir      ${worksrcdir}/src
     48depends_build-append \
     49                port:gettext \
     50                port:zlib \
     51                port:flex \
     52                port:gsed
     53# Removed texinfo because we now force the use of the system makeinfo
     54
     55# port-depcheck.sh reports these linkages:
     56depends_lib-append \
     57                port:libiconv \
     58                port:ncurses \
     59                port:sqlite3
     60
     61# The configure script is one level deeper; the top-level Makefile is
     62# hand-written and full of Apple-internal-specific things:
     63worksrcdir      ${worksrcdir}/src
    4564
    4665post-patch {
    4766    # https://trac.macports.org/ticket/37790

In this next hunk I tried some additional configure arguments. None of them led to any actual changes though, so they can probably be ignored:

  • Portfile

     
    5170        ${worksrcpath}/bfd/configure.host
    5271}
    5372
    54 configure.args \
     73configure.args-append \
    5574    --infodir=${prefix}/share/info \
    5675    --mandir=${prefix}/share/man \
    5776    --with-docdir=${prefix}/share/doc \
    5877    --program-suffix=-apple \
    59     --disable-werror
     78    --disable-werror \
     79    --with-mpfr=${prefix} \
     80    --with-gmp=${prefix} \
     81    --enable-libada \
     82    --enable-libssp
     83

In this next hunk I tried setting a bunch of environment variables.
The GSED one forces the use of the gsed port that I added a build dependency on above.
I just realized that the values to MAKEINFO are different in the configure and build environments, but that is okay, because either one works, at least on my machine. If we want to be consistent, though, it might make more sense to stick with the one with missing in it, as that would be safer.
All the variables with "MSG" somewhere in them, and the other variables around there, are to try to force the usage of the gettext port from MacPorts. They are not strictly necessary though.
A lot of the variables with "RC_" in them, and the other variables around there, are to try to simulate being inside a darwinbuild environment, which was part of my attempts to get the project to build from the top-level Makefile instead of from the one that we currently use in src/. I never managed to get that to work though, so those variables can probably be ignored as well.
Clearing the value of READELF_PROG was because I had been experiencing a build failure with it, and this was an attempt to try to fix that. Although that might have just been copied from my work on the Portfile for the FSF version of gdb, so I am not sure if it is strictly necessary here as well...
(Note that this hunk of the diff is not actually a separate hunk; I just split it off from the previous one so that I could fit these comments in here)

  • Portfile

     
     83
     84configure.env-append \
     85    SED=${prefix}/bin/gsed \
     86    MSGFMT=${prefix}/bin/msgfmt \
     87    GMSGFMT=${prefix}/bin/msgfmt \
     88    XGETTEXT=${prefix}/bin/xgettext \
     89    MSGMERGE=${prefix}/bin/msgmerge \
     90    MAKEINFO="${worksrcpath}/missing makeinfo" \
     91    INSTALLED_PRODUCT_ASIDES=YES \
     92    RC_JASPER=YES \
     93    RC_NONARCH_CFLAGS="${configure.optflags}" \
     94    RC_XBS=YES \
     95    SEPARATE_STRIP=YES \
     96    UNAME_RELEASE="${os.version}" \
     97    HOST_ARCHITECTURE="${configure.build_arch}"
     98
     99platform macosx {
     100    configure.args-append \
     101        --enable-carbon-framework \
     102        --enable-debug-symbols-framework
     103    configure.env-append \
     104        RC_OS=macos \
     105        RC_TARGET_CONFIG=MacOSX
     106    build.env-append \
     107        RC_OS=macos \
     108        RC_TARGET_CONFIG=MacOSX
     109}
     110
     111platform darwin {
     112    configure.env-append \
     113        RC_PRIVATE=/private \
     114        UNAME_SYSNAME=Darwin \
     115        NEXT_ROOT=""
     116    build.env-append \
     117        RC_PRIVATE=/private \
     118        UNAME_SYSNAME=Darwin \
     119        NEXT_ROOT=""
     120}
     121
     122build.args-append \
     123    MAKEINFO="/usr/bin/makeinfo" \
     124    LEXLIB="${prefix}/lib/libfl.a" \
     125    READELF_PROG=""
     126
     127build.env-append \
     128    MAKEINFO="/usr/bin/makeinfo" \
     129    LEXLIB="${prefix}/lib/libfl.a" \
     130    SED=${prefix}/bin/gsed \
     131    MSGFMT=${prefix}/bin/msgfmt \
     132    GMSGFMT=${prefix}/bin/msgfmt \
     133    XGETTEXT=${prefix}/bin/xgettext \
     134    MSGMERGE=${prefix}/bin/msgmerge \
     135    INSTALLED_PRODUCT_ASIDES=YES \
     136    RC_JASPER=YES \
     137    RC_XBS=YES \
     138    SEPARATE_STRIP=YES \
     139    UNAME_RELEASE="${os.version}" \
     140    HOST_ARCHITECTURE="${build_arch}" \
     141    READELF_PROG=""
    60142
    61 build.args \
    62     MAKEINFO="${prefix}/bin/makeinfo" \
     143destroot.args-append \
     144    MAKEINFO="/usr/bin/makeinfo" \
    63145    LEXLIB="${prefix}/lib/libfl.a"
    64146
    65 destroot.args \
    66     MAKEINFO="${prefix}/bin/makeinfo" \
     147destroot.env-append \
     148    MAKEINFO="/usr/bin/makeinfo" \
    67149   LEXLIB="${prefix}/lib/libfl.a"
    68150
    69151post-destroot {

Finally, in this last hunk, instead of deleting stuff, I solved some conflicts with other ports by renaming the files instead of deleting them. I also had destroot install some additional files that I considered to be useful. This part is all taking place after the place where the makeinfo failure had occurred though, so these next changes are not actually strictly relevant to this issue:

  • Portfile

     
    74156        move ${destroot}${prefix}/share/info/${info} ${destroot}${prefix}/share/info/apple-${info}
    75157    }
    76158
    77     eval delete [glob ${destroot}${prefix}/lib/*.{,l}a]
    78     eval delete [glob ${destroot}${prefix}/bin/{addr2line,ar,c*filt,nm,objcopy,objdump,ranlib,readelf,size,strings,strip}-apple]
     159    # avoid conflicts with other gdb/binutils installations from MacPorts:
     160    xinstall -d ${destroot}${prefix}/lib/${name}
     161    eval move [glob ${destroot}${prefix}/lib/*.{,l}a] ${destroot}${prefix}/lib/${name}
     162    eval reinplace "s|${prefix}/lib|${prefix}/lib/${name}|g" [glob ${destroot}${prefix}/lib/${name}/*.la]
     163    xinstall -d ${destroot}${prefix}/include/${name}
     164    eval move [glob ${destroot}${prefix}/include/*.h] ${destroot}${prefix}/include/${name}
     165    xinstall -d ${destroot}${prefix}/share/info/${name}
     166    eval move [glob ${destroot}${prefix}/share/info/{annotate,bfd,stabs}.info] ${destroot}${prefix}/share/info/${name}
     167    foreach msgs [glob ${destroot}${prefix}/share/locale/*/LC_MESSAGES/*.mo] {
     168        if [file isfile ${msgs}] {
     169            move ${msgs} [file dirname ${msgs}]/${name}-[file tail ${msgs}]
     170        }
     171    }
     172    xinstall -d ${destroot}${prefix}/share/${name}
     173    eval xinstall -m 644 [glob ${worksrcpath}/../conf/*.gdb] ${destroot}${prefix}/share/${name}
     174    xinstall -d ${destroot}${prefix}/etc/${name}
     175    xinstall ${worksrcpath}/../gdb.conf ${destroot}${prefix}/etc/${name}
     176    xinstall -d ${destroot}${prefix}/share/doc/${name}
     177    xinstall ${worksrcpath}/../doc/refcard.pdf ${destroot}${prefix}/share/doc/${name}
    79178    eval delete [glob ${destroot}${prefix}/*darwin*]
    80     eval delete [glob ${destroot}${prefix}/include/*.h]
    81     eval delete [glob ${destroot}${prefix}/share/info/{annotate,bfd,stabs}.info]
    82     eval delete [glob ${destroot}${prefix}/share/locale/*/LC_MESSAGES/{bfd,binutils,opcodes}.mo]
    83179}
    84180
    85181if {${os.platform} eq "darwin" && ${os.major} >= 12} {

So, to summarize, the changes that fixed the texinfo issue for me here were to append MAKEINFO="${worksrcpath}/missing makeinfo" to the configure environment, and to change the MAKEINFO="${prefix}/bin/makeinfo" entry in the build and destroot environment to be MAKEINFO="/usr/bin/makeinfo" instead, and to remove the dependency on texinfo. Those ones are the relevant ones here; the rest can be ignored.

Replying to ntraft@…:

The confusing thing here is that even though it output an error, I still have a gdb-apple binary in my bin/ folder, and it seems to work just fine... makeinfo also looks like it's there... are these prebuilt binaries? Why am I seeing this error?

Which bin/ folder? The one in your prefix? It could just be a previous version. And makeinfo already being in the bin/ folder in your prefix is what was causing this issue in the first place. If you meant that a new gdb-apple binary still gets built, though, it could just be parallelism in make causing the libraries that gdb-apple needs to get built before the documentation...

comment:6 Changed 4 years ago by jeremyhu (Jeremy Huddleston Sequoia)

can you please just attach the patch?

comment:7 follow-up: Changed 3 years ago by ryandesign (Ryan Schmidt)

  • Cc bdemsky@… added; jeremyhu@… removed
  • Owner changed from macports-tickets@… to jeremyhu@…

Has duplicate #45515.

Changed 3 years ago by rphoover@…

Patch for Yosemite

comment:8 in reply to: ↑ 7 Changed 3 years ago by rphoover@…

Replying to ryandesign@…:

Has duplicate #45515.

The file Portfile-gdb-apple.diff is a proposed patch for gdb-apple to work with Yosemite. This patch allows the program to build and initial testing with Lazarus (Free Pascal) indicates gdb-apple works.

comment:9 follow-ups: Changed 3 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Why do you need gdb? I'd rather just remove the project instead as it is not nearly as helpful as lldb these days.

comment:10 Changed 3 years ago by jeremyhu (Jeremy Huddleston Sequoia)

  • Resolution set to fixed
  • Status changed from new to closed

Submitted in r127586, but I still want to know what your use case is.

comment:11 in reply to: ↑ 9 Changed 3 years ago by rphoover@…

Replying to jeremyhu@…:

Why do you need gdb? I'd rather just remove the project instead as it is not nearly as helpful as lldb these days.

Lazarus does not support lldb yet. When it does, then there will be no need for this project.

comment:12 in reply to: ↑ 9 Changed 3 years ago by cooljeanius (Eric Gallager)

Replying to jeremyhu@…:

Why do you need gdb? I'd rather just remove the project instead as it is not nearly as helpful as lldb these days.

For me at least I prefer gdb for political reasons (it's "free-er" than lldb is), and because I'm more familiar with it, and because it's not written in C++ like lldb is. Plus also lldb doesn't have a port for it yet (as seen in #45251 for example). Now I can see maybe removing the gdb-apple port if the upstream FSF gdb project merged all of Apple's changes into their trunk, but given that I've been working for over a year on that (in my own fork) with little progress, I doubt it will happen any time soon...

Note: See TracTickets for help on using tickets.