[binutils-gdb] [gdb/build] Fix Solaris build

Tom de Vries vries@sourceware.org
Tue Dec 1 09:45:05 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8b4b1bdc274a51e22e2a93838d09ebe9b20224bb

commit 8b4b1bdc274a51e22e2a93838d09ebe9b20224bb
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Dec 1 10:45:01 2026 +0100

    [gdb/build] Fix Solaris build
    
    Currently, the Solaris build fails like this:
    ...
    $ gmake
      GEN    init.c
    gmake: *** [Makefile:2356: stamp-init] Error 1
    ...
    
    The problem is that gdb/make-init-c uses the GNU extension '\b' [1] (spreading
    the command over three lines for readability):
    ...
    grep -h \
        '^[         ]*INIT_GDB_FILE\b' \
        "$@"
    ...
    
    Fix this by instead matching optional whitespace followed by a left
    parenthesis:
    ...
    grep -h \
        '^[         ]*INIT_GDB_FILE[        ]*(' \
        "$@"
    ...
    
    Tested by building on x86_64-solaris, sparc-solaris and x86_64-linux.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33936
    
    [1] https://www.gnu.org/software/gnulib/manual/html_node/grep-regular-expression-syntax.html

Diff:
---
 gdb/make-init-c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/make-init-c b/gdb/make-init-c
index bb8cc6db1f1..caed475ab0c 100755
--- a/gdb/make-init-c
+++ b/gdb/make-init-c
@@ -46,7 +46,7 @@ echo "#include <algorithm>"
 echo ""
 echo "#undef INIT_GDB_FILE"
 echo "#define INIT_GDB_FILE(NAME) extern void _initialize_ ## NAME ();"
-grep -h '^[ 	]*INIT_GDB_FILE\b' "$@"
+grep -h '^[ 	]*INIT_GDB_FILE[ 	]*(' "$@"
 echo ""
 echo "void initialize_all_files ();"
 echo "void"
@@ -58,7 +58,7 @@ echo "  std::vector<initialize_file_ftype *> functions ="
 echo "    {"
 echo "#undef INIT_GDB_FILE"
 echo "#define INIT_GDB_FILE(NAME) _initialize_ ## NAME,"
-grep -h '^[ 	]*INIT_GDB_FILE\b' "$@"
+grep -h '^[ 	]*INIT_GDB_FILE[ 	]*(' "$@"
 echo "    };"
 echo ""
 echo "  /* If GDB_REVERSE_INIT_FUNCTIONS is set (any value), reverse the"


More information about the Gdb-cvs mailing list