Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#462 closed defect (fixed)

commit e6c87a718936b070ce8983f0e95cbead7959629c not BSD-compatible

Reported by: Alan Post Owned by: felix winkelmann
Priority: major Milestone: 4.9.0
Component: build system Version: 4.6.x
Keywords: Cc: alanpost@…
Estimated difficulty:

Description

After updating Chicken past e6c87a718936b070ce8983f0e95cbead7959629c, I get the following error trying to build on OpenBSD 4.8:

gmake -f ./Makefile.bsd CONFIG= all
gmake[1]: Entering directory `/home/a/wa/chicken/core'
gcc -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -c -Os -fomit-frame-pointer  -DC_BUILDING_LIBCHICKEN library.c -o library-static.o -I. -I./
In file included from library.c:11:
chicken.h:157: error: conflicting types for 'alloca'
gmake[1]: *** [library-static.o] Error 1
gmake[1]: Leaving directory `/home/a/wa/chicken/core'
gmake: *** [all] Error 2

The OpenBSD man page indicates that alloca has a different signature than the one declared in chicken.h:

alloca(3)

The macro '#if defined(__OpenBSD__)' can be used to add platform specific code in OpenBSD, though I suspect alloca is stable across the *BSD platforms.

Attachments (1)

patch-chicken_h (276 bytes) - added by Christian Kellermann 14 years ago.
change of the forward declaration signature of alloca from char* to void*

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by Alan Post

Cc: alanpost@… added

comment:2 Changed 14 years ago by Christian Kellermann

I cannot reproduce this with a checkout of experimental that includes this commitgg. Can you retry using a clean build?

Also can you try a gmake PLATFORM=BSD instead of calling the Makefile directly?

This works on 4.6 and 4.7. From CVS I cannot see any change of the alloca signatures, but I will try this next.

comment:3 in reply to:  2 ; Changed 14 years ago by Alan Post

Replying to ckeen:

I cannot reproduce this with a checkout of experimental that includes this commitgg. Can you retry using a clean build?

Also can you try a gmake PLATFORM=BSD instead of calling the Makefile directly?

This works on 4.6 and 4.7. From CVS I cannot see any change of the alloca signatures, but I will try this next.

I was using PLATFORM=BSD, I'm sorry for not including that in my report. What compiler version are you using? OpenBSD 4.8 has:

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.8/4.2.1/specs
Target: i386-unknown-openbsd4.8
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719 

Which might be available from ports on OpenBSD 4.7

I will retry compiling from a clean checkout. Will you try a newer version of gcc if you're on 4.7?

comment:4 in reply to:  3 Changed 14 years ago by Christian Kellermann

Replying to alanpost:

Replying to ckeen:

I cannot reproduce this with a checkout of experimental that includes this commitgg. Can you retry using a clean build?

Also can you try a gmake PLATFORM=BSD instead of calling the Makefile directly?

This works on 4.6 and 4.7. From CVS I cannot see any change of the alloca signatures, but I will try this next.

I was using PLATFORM=BSD, I'm sorry for not including that in my report. What compiler version are you using? OpenBSD 4.8 has:

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.8/4.2.1/specs
Target: i386-unknown-openbsd4.8
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719 

Which might be available from ports on OpenBSD 4.7

I will retry compiling from a clean checkout. Will you try a newer version of gcc if you're on 4.7?

Ah good catch.

$ gcc -v     
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.6/3.3.5/specs
Configured with: 
Thread model: single
gcc version 3.3.5 (propolice)

Is your compiler from ports or the one from base? I will try building on a 4.8 and on a 4.7 with a newer gcc.

comment:5 Changed 14 years ago by Christian Kellermann

Same with 4.7:

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.7/3.3.5/specs
Configured with: 
Thread model: single
gcc version 3.3.5 (propolice)
[22:21:11] ckeen@athene:~/proj/chicken/chicken-core

comment:6 Changed 14 years ago by Christian Kellermann

OK Thanks to IRC, alan and another build host I do run into the same problem on 4.8g.
I will come up with a patch, so it will run on 4.7 systems which are still officially supported until may 2011 and newer 4.8 systems.

Changed 14 years ago by Christian Kellermann

Attachment: patch-chicken_h added

change of the forward declaration signature of alloca from char* to void*

comment:7 Changed 14 years ago by Christian Kellermann

Owner: set to felix winkelmann
Status: newassigned

Actually after looking up man pages for alloca, which system does have the signature of

char *alloca(size_t size);

instead of

void *alloca(size_t size);

I have verified this for:

Linux, *BSD, Mac OS X, Windows (VS2010 docs) will look into it for Solaris (who was the Haiku person again?)

I have attached a patch to remedy the problem. This also builds on OpenBSD 4.7 as the signature has always been this way...

comment:8 Changed 14 years ago by felix winkelmann

Resolution: fixed
Status: assignedclosed

Thanks, folks. Patch applied.

comment:9 Changed 14 years ago by felix winkelmann

Milestone: 4.7.04.8.0

Milestone 4.7.0 deleted

comment:10 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.