public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/26848] New: Build failure due to missing previous declaration
@ 2020-11-05 23:17 markus.boeck02 at gmail dot com
  2020-11-06  1:04 ` [Bug build/26848] " simark at simark dot ca
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: markus.boeck02 at gmail dot com @ 2020-11-05 23:17 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26848

            Bug ID: 26848
           Summary: Build failure due to missing previous declaration
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: markus.boeck02 at gmail dot com
  Target Milestone: ---

Current trunk of gdb (712b8a0f68f2b24d554a83a1740fa06f7aec8952) fails to build
in my environment. Following error message appears:

make[2]: Leaving directory
'/mnt/c/GCC-Build-Array/binutils-gdb/build-gdb/opcodes'
../../gdbsupport/pathstuff.cc:324:1: error: no previous declaration for
'std::string find_gdb_home_config_file(const char*, _stat64*)'
[-Werror=missing-declarations]
  324 | find_gdb_home_config_file (const char *name, struct stat *buf)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [pathstuff.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-gdbsupport] Error 2
make: *** [all] Error 2
Makefile:505: recipe for target 'pathstuff.o' failed
make[3]: Leaving directory
'/mnt/c/GCC-Build-Array/binutils-gdb/build-gdb/gdbsupport'

The configure command used was:

configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32                
                                                 
--with-auto-load-dir=$debugdir:$datadir/auto-load                              
                                       
--with-auto-load-safe-path=$debugdir:$datadir/auto-load                        
                                        --with-expat                           
                                                                               
--with-gdb-datadir=/mnt/c/GDB/share/gdb (relocatable)                          
                                       
--with-jit-reader-dir=/mnt/c/GDB/lib/gdb (relocatable)                         
                                        --without-libunwind-ia64               
                                                                               
--with-lzma                                                                    
                                        --without-babeltrace                   
                                                                               
--without-intel-pt                                                             
                                        --with-mpfr                            
                                                                               
--without-xxhash                                                               
                                       
--with-python=/mnt/c/GCC-Build/NewestLinux/Libraries                           
                                       
--with-python-libdir=/mnt/c/GCC-Build/NewestLinux/Libraries/lib                
                                        --without-debuginfod                   
                                                                               
--without-guile                                                                
                                        --disable-source-highlight             
                                                                               
--with-separate-debug-dir=/mnt/c/GDB/lib/debug (relocatable)                   
                                       
--with-system-gdbinit=/mnt/c/GDB/etc/gdbinit.py (relocatable)

GCC is version 10.2.1 targetting x86_64-w64-mingw32

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug build/26848] Build failure due to missing previous declaration
  2020-11-05 23:17 [Bug build/26848] New: Build failure due to missing previous declaration markus.boeck02 at gmail dot com
@ 2020-11-06  1:04 ` simark at simark dot ca
  2020-11-10 20:12 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2020-11-06  1:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26848

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |andrew.burgess at embecosm dot com
                   |                            |, simark at simark dot ca
   Last reconfirmed|                            |2020-11-06
     Ever confirmed|0                           |1

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
I see the same failure.

What's strange is that the declaration is there in gdbuspport/pathstuff.h.  The
fact that it only happens on mingw makes me think it's another issue related to
the redefinition of the struct stat type by gnulib.

Including <sys/stat.h> in pathstuff.h fixes it for me, I presume it makes it so
that the declaration and definition of the function "see" the same struct stat:

diff --git a/gdbsupport/pathstuff.h b/gdbsupport/pathstuff.h
index 996c8f2bbf6a..f671b87f5a8f 100644
--- a/gdbsupport/pathstuff.h
+++ b/gdbsupport/pathstuff.h
@@ -21,6 +21,7 @@
 #define COMMON_PATHSTUFF_H

 #include "gdbsupport/byte-vector.h"
+#include <sys/stat.h>

 /* Path utilities.  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug build/26848] Build failure due to missing previous declaration
  2020-11-05 23:17 [Bug build/26848] New: Build failure due to missing previous declaration markus.boeck02 at gmail dot com
  2020-11-06  1:04 ` [Bug build/26848] " simark at simark dot ca
@ 2020-11-10 20:12 ` tromey at sourceware dot org
  2020-11-10 20:13 ` cvs-commit at gcc dot gnu.org
  2020-11-10 20:14 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2020-11-10 20:12 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26848

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug build/26848] Build failure due to missing previous declaration
  2020-11-05 23:17 [Bug build/26848] New: Build failure due to missing previous declaration markus.boeck02 at gmail dot com
  2020-11-06  1:04 ` [Bug build/26848] " simark at simark dot ca
  2020-11-10 20:12 ` tromey at sourceware dot org
@ 2020-11-10 20:13 ` cvs-commit at gcc dot gnu.org
  2020-11-10 20:14 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-10 20:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26848

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

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

commit 6c51cf513d98adcf34a342c7e9d885a6c788cda8
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Nov 9 06:55:39 2020 -0700

    Move include block to pathstuff.h

    A recent commit caused pathstuff.cc to fail to compile on mingw, like:

    ../../binutils-gdb/gdbsupport/pathstuff.cc:324:1: error: no previous
declaration for 'std::string find_gdb_home_config_file(const char*, _stati64*)'
[-Werror=missing-declarations]

    Some newly-added #includes were changing which "stat" was being seen
    by the compiler.  This patch moves the includes to the header, so that
    the declaration and definition now agree.

    2020-11-10  Tom Tromey  <tromey@adacore.com>

            PR build/26848:
            * pathstuff.h: Move include block here...
            * pathstuff.cc: ... from here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug build/26848] Build failure due to missing previous declaration
  2020-11-05 23:17 [Bug build/26848] New: Build failure due to missing previous declaration markus.boeck02 at gmail dot com
                   ` (2 preceding siblings ...)
  2020-11-10 20:13 ` cvs-commit at gcc dot gnu.org
@ 2020-11-10 20:14 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2020-11-10 20:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26848

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.  Thank you for the report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-10 20:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 23:17 [Bug build/26848] New: Build failure due to missing previous declaration markus.boeck02 at gmail dot com
2020-11-06  1:04 ` [Bug build/26848] " simark at simark dot ca
2020-11-10 20:12 ` tromey at sourceware dot org
2020-11-10 20:13 ` cvs-commit at gcc dot gnu.org
2020-11-10 20:14 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).