clzhan / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

can not compile breakpad on centos 4.3 #526

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.compile on centos 4.3
2.using gcc 4.6.0
3.

What is the expected output? What do you see instead?
 expected: It should compile.
 I see this instead:

depbase=`echo src/client/linux/handler/exception_handler.o | sed 
's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I./src  -I./src    -fPIC -g -O2 -MT 
src/client/linux/handler/exception_handler.o -MD -MP -MF $depbase.Tpo -c -o 
src/client/linux/handler/exception_handler.o 
src/client/linux/handler/exception_handler.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/asm/system.h:4:0,
                 from /usr/include/linux/sched.h:16,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/asm-x86_64/system.h:69:25: error: expected ‘,’ or ‘...’ 
before ‘new’
/usr/include/asm-x86_64/system.h: In function ‘long unsigned int 
__cmpxchg(volatile void*, long unsigned int, long unsigned int)’:
/usr/include/asm-x86_64/system.h:72:10: error: ‘size’ was not declared in 
this scope
/usr/include/asm-x86_64/system.h:74:24: error: expected string-literal before 
‘LOCK_PREFIX’
/usr/include/asm-x86_64/system.h:80:24: error: expected string-literal before 
‘LOCK_PREFIX’
/usr/include/asm-x86_64/system.h:86:24: error: expected string-literal before 
‘LOCK_PREFIX’
/usr/include/asm-x86_64/system.h:92:24: error: expected string-literal before 
‘LOCK_PREFIX’
In file included from /usr/include/asm/signal.h:4:0,
                 from /usr/include/linux/signal.h:4,
                 from /usr/include/linux/sched.h:25,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/asm-x86_64/signal.h: At global scope:
/usr/include/asm-x86_64/signal.h:12:23: error: conflicting declaration 
‘typedef long unsigned int sigset_t’
/usr/include/signal.h:50:20: error: ‘sigset_t’ has a previous declaration 
as ‘typedef struct __sigset_t sigset_t’
/usr/include/asm-x86_64/signal.h:107:16: error: redefinition of ‘struct 
sigaltstack’
/usr/include/bits/sigstack.h:50:16: error: previous definition of ‘struct 
sigaltstack’
/usr/include/asm-x86_64/signal.h:111:10: error: invalid type in declaration 
before ‘;’ token
/usr/include/asm-x86_64/signal.h:111:10: error: conflicting declaration 
‘typedef int stack_t’
/usr/include/bits/sigstack.h:55:5: error: ‘stack_t’ has a previous 
declaration as ‘typedef struct sigaltstack stack_t’
In file included from /usr/include/asm/siginfo.h:4:0,
                 from /usr/include/linux/signal.h:5,
                 from /usr/include/linux/sched.h:25,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/asm-x86_64/siginfo.h:6:15: error: redefinition of ‘union 
sigval’
/usr/include/bits/siginfo.h:33:15: error: previous definition of ‘union 
sigval’
/usr/include/asm-x86_64/siginfo.h:9:11: error: invalid type in declaration 
before ‘;’ token
/usr/include/asm-x86_64/siginfo.h:9:11: error: conflicting declaration 
‘typedef int sigval_t’
/usr/include/bits/siginfo.h:37:5: error: ‘sigval_t’ has a previous 
declaration as ‘typedef union sigval sigval_t’
/usr/include/asm-x86_64/siginfo.h:14:16: error: redefinition of ‘struct 
siginfo’
/usr/include/bits/siginfo.h:51:16: error: previous definition of ‘struct 
siginfo’
/usr/include/asm-x86_64/siginfo.h:61:12: error: invalid type in declaration 
before ‘;’ token
/usr/include/asm-x86_64/siginfo.h:61:12: error: conflicting declaration 
‘typedef int siginfo_t’
/usr/include/bits/siginfo.h:108:5: error: ‘siginfo_t’ has a previous 
declaration as ‘typedef struct siginfo siginfo_t’
/usr/include/asm-x86_64/siginfo.h:188:16: error: redefinition of ‘struct 
sigevent’
/usr/include/bits/siginfo.h:273:16: error: previous definition of ‘struct 
sigevent’
/usr/include/asm-x86_64/siginfo.h:200:13: error: invalid type in declaration 
before ‘;’ token
/usr/include/asm-x86_64/siginfo.h:200:13: error: conflicting declaration 
‘typedef int sigevent_t’
/usr/include/bits/siginfo.h:293:5: error: ‘sigevent_t’ has a previous 
declaration as ‘typedef struct sigevent sigevent_t’
In file included from /usr/include/linux/sched.h:65:0,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/linux/time.h:9:8: error: redefinition of ‘struct timespec’
/usr/include/time.h:118:8: error: previous definition of ‘struct timespec’
/usr/include/linux/time.h:17:8: error: redefinition of ‘struct timeval’
/usr/include/bits/time.h:69:8: error: previous definition of ‘struct 
timeval’
/usr/include/linux/time.h:22:8: error: redefinition of ‘struct timezone’
/usr/include/sys/time.h:56:8: error: previous definition of ‘struct 
timezone’
/usr/include/linux/time.h:43:9: error: redefinition of ‘struct itimerspec’
/usr/include/time.h:159:8: error: previous definition of ‘struct itimerspec’
/usr/include/linux/time.h:48:8: error: redefinition of ‘struct itimerval’
/usr/include/sys/time.h:107:8: error: previous definition of ‘struct 
itimerval’
In file included from /usr/include/linux/sched.h:67:0,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/linux/resource.h:21:8: error: redefinition of ‘struct rusage’
/usr/include/bits/resource.h:158:8: error: previous definition of ‘struct 
rusage’
/usr/include/linux/resource.h:40:8: error: redefinition of ‘struct rlimit’
/usr/include/bits/resource.h:124:8: error: previous definition of ‘struct 
rlimit’
In file included from /usr/include/asm/sigcontext.h:4:0,
                 from /usr/include/asm-x86_64/processor.h:13,
                 from /usr/include/asm/processor.h:4,
                 from /usr/include/linux/sched.h:69,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/asm-x86_64/sigcontext.h:9:8: error: redefinition of ‘struct 
_fpstate’
/usr/include/bits/sigcontext.h:101:8: error: previous definition of ‘struct 
_fpstate’
/usr/include/asm-x86_64/sigcontext.h:23:8: error: redefinition of ‘struct 
sigcontext’
/usr/include/bits/sigcontext.h:117:8: error: previous definition of ‘struct 
sigcontext’
In file included from /usr/include/asm/processor.h:4:0,
                 from /usr/include/linux/sched.h:69,
                 from src/client/linux/handler/exception_handler.cc:97:
/usr/include/asm-x86_64/processor.h:75:3: error: conflicting declaration 
‘cpuinfo_x86 ____cacheline_aligned’
/usr/include/asm-x86_64/pda.h:25:3: error: ‘____cacheline_aligned’ has a 
previous declaration as ‘x8664_pda ____cacheline_aligned’
/usr/include/asm-x86_64/processor.h:292:2: error: ‘u16’ does not name a type
/usr/include/asm-x86_64/processor.h:293:2: error: ‘u16’ does not name a type
/usr/include/asm-x86_64/processor.h:294:2: error: ‘u16’ does not name a type
/usr/include/asm-x86_64/processor.h:295:2: error: ‘u16’ does not name a type
/usr/include/asm-x86_64/processor.h:296:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:297:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:298:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:299:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:300:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:301:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:302:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:314:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:315:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:316:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:317:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:318:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:319:2: error: ‘u64’ does not name a type
/usr/include/asm-x86_64/processor.h:320:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:321:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:322:2: error: ‘u16’ does not name a type
/usr/include/asm-x86_64/processor.h:323:2: error: ‘u16’ does not name a type
/usr/include/asm-x86_64/processor.h:324:2: error: ‘u32’ does not name a type
/usr/include/asm-x86_64/processor.h:347:2: error: ‘u32’ does not name a type
In file included from src/client/linux/handler/exception_handler.cc:97:0:
/usr/include/linux/sched.h:91:8: error: redefinition of ‘struct sched_param’
/usr/include/bits/sched.h:62:8: error: previous definition of ‘struct 
sched_param’
src/client/linux/handler/exception_handler.cc: In static member function 
‘static void google_breakpad::ExceptionHandler::SignalHandler(int, 
siginfo_t*, void*)’:
src/client/linux/handler/exception_handler.cc:343:13: error: ‘struct 
siginfo::<anonymous union>::<anonymous>’ has no member named ‘_pid’
src/client/linux/handler/exception_handler.cc: In member function ‘bool 
google_breakpad::ExceptionHandler::HandleSignal(int, siginfo_t*, void*)’:
src/client/linux/handler/exception_handler.cc:392:54: error: ‘struct 
siginfo::<anonymous union>::<anonymous>’ has no member named ‘_pid’
src/client/linux/handler/exception_handler.cc: In member function ‘bool 
google_breakpad::ExceptionHandler::SimulateSignalDelivery(int)’:
src/client/linux/handler/exception_handler.cc:423:11: error: ‘struct 
siginfo::<anonymous union>::<anonymous>’ has no member named ‘_pid’
src/client/linux/handler/exception_handler.cc: In member function ‘bool 
google_breakpad::ExceptionHandler::WriteMinidump()’:
src/client/linux/handler/exception_handler.cc:590:19: error: ‘struct 
siginfo::<anonymous union>::<anonymous>’ has no member named ‘_addr’
make: *** [src/client/linux/handler/exception_handler.o] Error 1

What version of the product are you using? On what operating system?
verion: r1148

Please provide any additional information below.

Original issue reported on code.google.com by issac.xw...@gmail.com on 17 Apr 2013 at 2:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
my patch can fix the compile error.
but I don't think that is a good solution.
any help would be appreciated.
thanks.

Original comment by issac.xw...@gmail.com on 17 Apr 2013 at 2:43

Attachments:

GoogleCodeExporter commented 9 years ago
Does it build if you change it to #include <sched.h> instead?

Original comment by thestig@chromium.org on 17 Apr 2013 at 5:22

GoogleCodeExporter commented 9 years ago
yes, but I don't need to make that change,it is already there. 
line 71 of exception_handler.cc.

Original comment by issac.xw...@gmail.com on 17 Apr 2013 at 7:25

GoogleCodeExporter commented 9 years ago
and I look into file history.
I found that r790 made that include to make it build with Android NDK r5.

please refer to:
https://code.google.com/p/google-breakpad/source/detail?r=790&path=/trunk/src/cl
ient/linux/handler/exception_handler.cc

so I think the include below:
 #include "linux/sched.h" 

should be available only for android build, doesn't it?

Original comment by issac.xw...@gmail.com on 17 Apr 2013 at 7:35

GoogleCodeExporter commented 9 years ago
Ted, can you see if the #include in question is needed?

Original comment by thestig@chromium.org on 17 Apr 2013 at 6:33

GoogleCodeExporter commented 9 years ago
It appears to still be needed with a modern NDK (r8d). I'll just ifdef it for 
Android only. I tested and this builds fine with the NDK and with my x86-64 
toolchain on Ubuntu.

http://code.google.com/p/google-breakpad/source/detail?r=1153

Original comment by ted.mielczarek on 18 Apr 2013 at 1:24