Opened 16 years ago

Closed 15 years ago

#854 closed Defect (fixed)

building with gcc 4.4

Reported by: mjakubicek Owned by: davea
Priority: Major Milestone: Undetermined
Component: Client - Build Version: 6.6.37
Keywords: Cc: mjakubicek

Description

Here are two patches to make BOINC build with gcc 4.4 -- the first one is sane, just simple things, while the other one comes from a colleague and...works, but I don't know why. To be more precise: I don't know why it does not build without it.

Attachments (2)

boinc-client-6.4.5-event.patch (741 bytes) - added by mjakubicek 16 years ago.
boinc gcc 4.4 patch #2 -- use wxPanel instead of wxControl -- why?
boinc-gcc44.patch (528 bytes) - added by mjakubicek 15 years ago.
updated gcc44/glibc2.10 patch

Download all attachments as: .zip

Change History (13)

Changed 16 years ago by mjakubicek

boinc gcc 4.4 patch #2 -- use wxPanel instead of wxControl -- why?

comment:1 Changed 16 years ago by mjakubicek

Cc: mjakubicek added

comment:2 Changed 16 years ago by romw

Milestone: 6.6Undetermined
Owner: changed from romw to davea

The main path here applies to the server code.

comment:3 Changed 16 years ago by davea

Resolution: fixed
Status: newclosed

(In [17502]) - client: don't allow coproc apps in app_info.xml.

Otherwise we'll get stuck in a loop where the client asks for CPU work, and the scheduler sends jobs for what it thinks is a CPU app but is actually a coproc app.

Eventually we should add coproc info to the app descriptions send in scheduler request, so that you can use anonymous platform for coproc apps. But let's wait on this.

  • scheduler: compile fix for gcc 4.4. Fixes #854

comment:4 Changed 16 years ago by romw

(In [17527]) - client: don't allow coproc apps in app_info.xml.

Otherwise we'll get stuck in a loop where the client asks for CPU work, and the scheduler sends jobs for what it thinks is a CPU app but is actually a coproc app.

Eventually we should add coproc info to the app descriptions send in scheduler request, so that you can use anonymous platform for coproc apps. But let's wait on this.

  • scheduler: compile fix for gcc 4.4. Fixes #854

client/

cs_statefile.cpp

sched/

sched_driver.cpp sched_util.cpp

comment:5 Changed 15 years ago by mjakubicek

Resolution: fixed
Status: closedreopened
Version: 6.4.56.6.37

Please fix this also in the 6.6 branch, thanks in advance.

comment:6 Changed 15 years ago by Ageless

It is in the 6.6a branch. See [17527]

comment:7 Changed 15 years ago by mjakubicek

Confirm, thanks for pointing to the 6.6a branch, please close this again anyone with appropriate rights.

comment:8 Changed 15 years ago by Ageless

Resolution: fixed
Status: reopenedclosed

comment:9 Changed 15 years ago by mjakubicek

Resolution: fixed
Status: closedreopened

Ops, sorry, I just found out that the patch I attached in February is outdated, there is one more thing that needs to be resolved:

Starting with glibc 2.10, functions that take const arguments return const values too. This was not the case before, now e.g. strcasestr returns "const char*", not "char*" when the supplied arguments are "const char*". This breaks the build on the following place:

>g++ -DHAVE_CONFIG_H -I. -I..  -I../lib -I../api -I../db -I../client -I../tools -I../sched -I../lib/mac -pthread   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -msse2 -march=opteron -mtune=generic -MT boinc_client-cpu_sched.o -MD -MP -MF .deps/boinc_client-cpu_sched.Tpo -c -o boinc_client-cpu_sched.o `test -f 'cpu_sched.cpp' || echo './'`cpu_sched.cpp
In file included from cpu_sched.cpp:46:
../lib/str_util.h:41: error: new declaration ‘char* strcasestr(const char*, const char*)’
/usr/include/string.h:367: error: ambiguates old declaration ‘const char* strcasestr(const char*, const char*)’

There are indeed two issues to be resolved, first, the fallback declaration should be consistent with that one of current glibc, hence it should be in lib/str_util.h:

extern const char *strcasestr(const char *s1, const char *s2);

instead of:

extern char *strcasestr(const char *s1, const char *s2);

Moreover, lib/str_util.h is missing #include "config.h" which means that the "HAVE_*" macros found out by configure are never defined (and therefore the conflicting declaration comes out). I've attached a small patch which resolves both these issues.

Changed 15 years ago by mjakubicek

Attachment: boinc-gcc44.patch added

updated gcc44/glibc2.10 patch

comment:10 Changed 15 years ago by Nicolas

Public headers should not include config.h, and str_util.h is "public" for science apps. Code in trunk defines strcasestr in a new file that includes config.h. Your patch that includes config.h from str_util.h would not be applied.

comment:11 Changed 15 years ago by davea

Resolution: fixed
Status: reopenedclosed

(In [18633]) - lib: gcc 4.4 fix; fixes #854

Note: See TracTickets for help on using tickets.