Ticket #462 (closed defect: fixed)

Opened 2 years ago

Last modified 8 months ago

commit e6c87a718936b070ce8983f0e95cbead7959629c not BSD-compatible

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

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

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

Change History

  Changed 2 years ago by alanpost

  • cc alanpost@… added

follow-up: ↓ 3   Changed 2 years ago by 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.

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 2 years ago by 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?

in reply to: ↑ 3   Changed 2 years ago by ckeen

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.

  Changed 2 years ago by ckeen

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

  Changed 2 years ago by ckeen

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 2 years ago by ckeen

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

  Changed 2 years ago by ckeen

  • owner set to felix
  • status changed from new to assigned

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...

  Changed 2 years ago by felix

  • status changed from assigned to closed
  • resolution set to fixed

Thanks, folks. Patch applied.

  Changed 2 years ago by felix

  • milestone changed from 4.7.0 to 4.8.0

Milestone 4.7.0 deleted

  Changed 8 months ago by felix

  • milestone changed from 4.8.0 to 4.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.