This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug build/20712] New: gdb 7.12+ doesn't build as C++ on Solaris
- From: "ro at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 18 Oct 2016 13:04:42 +0000
- Subject: [Bug build/20712] New: gdb 7.12+ doesn't build as C++ on Solaris
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=20712
Bug ID: 20712
Summary: gdb 7.12+ doesn't build as C++ on Solaris
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: ro at gcc dot gnu.org
Target Milestone: 7.12.1
Host: *-*-solaris2.*
Target: *-*-solaris2.*
Build: *-*-solaris2.*
When trying to compile gdb 7.12 on Solaris (tried 10 and 12), it fails in a
couple of ways as initially reported at
https://sourceware.org/ml/gdb-patches/2016-10/msg00448.html:
In file included from /vol/src/gnu/gdb/gdb-7.12/gdb/gdb.c:19:0:
/vol/src/gnu/gdb/gdb-7.12/gdb/defs.h:630:33: error: 'double atof(const char*)'
conflicts with a previous declaration
extern double atof (const char *); /* X3.159-1989 4.10.1.1 */
^
In file included from /usr/include/stdlib.h:17:0,
from build-gnulib/import/stdlib.h:36,
from /vol/src/gnu/gdb/gdb-7.12/gdb/common/common-defs.h:32,
from /vol/src/gnu/gdb/gdb-7.12/gdb/defs.h:28,
from /vol/src/gnu/gdb/gdb-7.12/gdb/gdb.c:19:
/vol/gcc-4.9/lib/gcc/i386-pc-solaris2.10/4.9.0/include-fixed/iso/stdlib_iso.h:119:15:
note: previous declaration 'double std::atof(const char*)'
extern double atof(const char *);
^
due to this gem in gdb/defs.h:
#ifndef atof
extern double atof (const char *); /* X3.159-1989 4.10.1.1 */
#endif
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'ptid_t
procfs_wait(target_ops*, ptid_t, target_waitstatus*, int)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:3839:25: error: invalid conversion from
'int' to 'gdb_signal' [-fpermissive]
status->value.sig = 0;
^
In file included from /vol/src/gnu/gdb/gdb-7.12/gdb/common/common-defs.h:64:0,
from /vol/src/gnu/gdb/gdb-7.12/gdb/defs.h:28,
from /vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:23:
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'void
procfs_create_inferior(target_ops*, char*, char*, char**, int)':
/vol/src/gnu/gdb/gdb-7.12/gdb/../include/libiberty.h:722:38: error: invalid
conversion from 'void*' to 'char*' [-fpermissive]
# define alloca(x) __builtin_alloca(x)
^
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:4570:17: note: in expansion of macro
'alloca'
tryname = alloca (strlen (path) + strlen (shell_file) + 2);
^
add char * cast
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'int
procfs_corefile_thread_callback(procinfo*, procinfo*, void*)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:5370:46: error: invalid conversion from
'void*' to 'procfs_corefile_thread_data*' [-fpermissive]
struct procfs_corefile_thread_data *args = data;
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'void
do_destroy_procinfo_cleanup(void*)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:794:23: error: invalid conversion from
'void*' to 'procinfo*' [-fpermissive]
destroy_procinfo (pi);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:772:1: note: initializing argument 1 of
'void destroy_procinfo(procinfo*)'
destroy_procinfo (procinfo *pi)
^
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'sysset_t*
sysset_t_alloc(procinfo*)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:848:22: error: invalid conversion from
'void*' to 'sysset_t*' [-fpermissive]
ret = xmalloc (size);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'int
proc_set_traced_sysentry(procinfo*, sysset_t*)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:1678:30: error: invalid conversion from
'void*' to 'proc_set_traced_sysentry(procinfo*,
sysset_t*)::gdb_proc_ctl_pcsentry*' [-fpermissive]
argp = xmalloc (argp_size);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'int
proc_set_traced_sysexit(procinfo*, sysset_t*)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:1723:30: error: invalid conversion from
'void*' to 'proc_set_traced_sysexit(procinfo*,
sysset_t*)::gdb_proc_ctl_pcsexit*' [-fpermissive]
argp = xmalloc (argp_size);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c: In function 'void
do_closedir_cleanup(void*)':
/vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:2759:16: error: invalid conversion from
'void*' to 'DIR*' [-fpermissive]
closedir (dir);
^
In file included from build-gnulib/import/dirent.h:27:0,
from /vol/src/gnu/gdb/gdb-7.12/gdb/procfs.c:91:
/usr/include/dirent.h:103:13: note: initializing argument 1 of 'int
closedir(DIR*)'
extern int closedir(DIR *);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c: In function 'ps_err_e
ps_pdread(gdb_ps_prochandle_t, gdb_ps_addr_t, gdb_ps_read_buf_t,
gdb_ps_size_t)':
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:821:43: error: invalid conversion
from 'gdb_ps_read_buf_t {aka void*}' to 'gdb_byte* {aka unsigned char*}'
[-fpermissive]
return rw_common (0, ph, addr, buf, size);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:780:1: note: initializing argument 4
of 'ps_err_e rw_common(int, const ps_prochandle*, gdb_ps_addr_t, gdb_byte*,
int)'
rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c: In function 'ps_err_e
ps_ptread(gdb_ps_prochandle_t, gdb_ps_addr_t, gdb_ps_read_buf_t,
gdb_ps_size_t)':
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:839:43: error: invalid conversion
from 'gdb_ps_read_buf_t {aka void*}' to 'gdb_byte* {aka unsigned char*}'
[-fpermissive]
return rw_common (0, ph, addr, buf, size);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:780:1: note: initializing argument 4
of 'ps_err_e rw_common(int, const ps_prochandle*, gdb_ps_addr_t, gdb_byte*,
int)'
rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c: In function 'void
_initialize_sol_thread()':
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'void (*)(int)' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1255:3: note: in expansion of macro
'resolve'
resolve (td_log);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const ps_prochandle*, td_thragent_t**) {aka
td_err_e (*)(const ps_prochandle*, td_thragent**)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1256:3: note: in expansion of macro
'resolve'
resolve (td_ta_new);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(td_thragent_t*) {aka td_err_e (*)(td_thragent*)}'
[-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1257:3: note: in expansion of macro
'resolve'
resolve (td_ta_delete);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)()' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1258:3: note: in expansion of macro
'resolve'
resolve (td_init);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thragent_t*, ps_prochandle**) {aka
td_err_e (*)(const td_thragent*, ps_prochandle**)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1259:3: note: in expansion of macro
'resolve'
resolve (td_ta_get_ph);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thragent_t*, int*) {aka td_err_e
(*)(const td_thragent*, int*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1260:3: note: in expansion of macro
'resolve'
resolve (td_ta_get_nthreads);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thragent_t*, int (*)(thread_key_t, void
(*)(), void*), void*) {aka td_err_e (*)(const td_thragent*, int (*)(unsigned
int, void (*)(), void*), void*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1261:3: note: in expansion of macro
'resolve'
resolve (td_ta_tsd_iter);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thragent_t*, int (*)(const
td_thrhandle_t*, void*), void*, td_thr_state_e, int, sigset_t*, unsigned int)
{aka td_err_e (*)(const td_thragent*, int (*)(const td_thrhandle*, void*),
void*, td_thr_state_e, int, sigset_t*, unsigned int)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1262:3: note: in expansion of macro
'resolve'
resolve (td_ta_thr_iter);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*) {aka td_err_e (*)(const
td_thrhandle*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1263:3: note: in expansion of macro
'resolve'
resolve (td_thr_validate);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, thread_key_t, void**) {aka
td_err_e (*)(const td_thrhandle*, unsigned int, void**)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1264:3: note: in expansion of macro
'resolve'
resolve (td_thr_tsd);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, td_thrinfo_t*) {aka
td_err_e (*)(const td_thrhandle*, td_thrinfo*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1265:3: note: in expansion of macro
'resolve'
resolve (td_thr_get_info);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, fpregset_t*) {aka td_err_e
(*)(const td_thrhandle*, fpu*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1266:3: note: in expansion of macro
'resolve'
resolve (td_thr_getfpregs);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, int*) {aka td_err_e
(*)(const td_thrhandle*, int*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1267:3: note: in expansion of macro
'resolve'
resolve (td_thr_getxregsize);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, caddr_t) {aka td_err_e
(*)(const td_thrhandle*, char*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1268:3: note: in expansion of macro
'resolve'
resolve (td_thr_getxregs);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, sigset_t) {aka td_err_e
(*)(const td_thrhandle*, sigset_t)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1269:3: note: in expansion of macro
'resolve'
resolve (td_thr_sigsetmask);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, int) {aka td_err_e
(*)(const td_thrhandle*, int)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1270:3: note: in expansion of macro
'resolve'
resolve (td_thr_setprio);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, uchar_t, sigset_t) {aka
td_err_e (*)(const td_thrhandle*, unsigned char, sigset_t)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1271:3: note: in expansion of macro
'resolve'
resolve (td_thr_setsigpending);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, const fpregset_t*) {aka
td_err_e (*)(const td_thrhandle*, const fpu*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1272:3: note: in expansion of macro
'resolve'
resolve (td_thr_setfpregs);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, caddr_t) {aka td_err_e
(*)(const td_thrhandle*, char*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1273:3: note: in expansion of macro
'resolve'
resolve (td_thr_setxregs);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thragent_t*, thread_t, td_thrhandle_t*)
{aka td_err_e (*)(const td_thragent*, unsigned int, td_thrhandle*)}'
[-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1274:3: note: in expansion of macro
'resolve'
resolve (td_ta_map_id2thr);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thragent_t*, lwpid_t, td_thrhandle_t*)
{aka td_err_e (*)(const td_thragent*, unsigned int, td_thrhandle*)}'
[-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1275:3: note: in expansion of macro
'resolve'
resolve (td_ta_map_lwp2thr);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, greg_t*) {aka td_err_e
(*)(const td_thrhandle*, int*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1276:3: note: in expansion of macro
'resolve'
resolve (td_thr_getgregs);
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion
from 'void*' to 'td_err_e (*)(const td_thrhandle_t*, const greg_t*) {aka
td_err_e (*)(const td_thrhandle*, const int*)}' [-fpermissive]
if (!(p_##X = dlsym (dlhandle, #X))) \
^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1277:3: note: in expansion of macro
'resolve'
resolve (td_thr_setgregs);
^
When -Werror is enabled, there's also
/vol/src/gnu/gdb/gdb/local/gdb/procfs.c: In function 'ssd*
proc_get_LDT_entry(procinfo*, int)':
/vol/src/gnu/gdb/gdb/local/gdb/procfs.c:2487:19: error: variable 'old_chain'
set but not used [-Werror=unused-but-set-variable]
struct cleanup *old_chain = NULL;
^
and for a 32-bit compilation (which requires --disable-largefile to avoid
In file included from /usr/include/sys/procfs.h:28:0,
from /vol/src/gnu/gdb/gdb/local/gdb/i386-sol2-nat.c:23:
/usr/include/sys/old_procfs.h:39:2: error: #error "Cannot use procfs in the
large file compilation environment"
#error "Cannot use procfs in the large file compilation environment"
^
) we also get
/vol/src/gnu/gdb/gdb/local/gdb/top.c: In function 'void
gdb_safe_append_history()':
/vol/src/gnu/gdb/gdb/local/gdb/top.c:1170:59: error: format '%d' expects
argument of type 'int', but argument 3 has type 'pid_t {aka long int}'
[-Werror=format=]
= xstrprintf ("%s-gdb%d~", history_filename, getpid ());
^
The posted patch and its follow-up fix all those.
Rainer
--
You are receiving this mail because:
You are on the CC list for the bug.