[Vm-dev] problem generating latest unix cog

Igor Stasenko siguctua at gmail.com
Wed Mar 2 10:34:20 UTC 2011


On 2 March 2011 10:35, Esteban Lorenzano <estebanlm at gmail.com> wrote:
>
> Hi,
> can you fast check which gcc version are you using? (maybe it is something with this) we are using gcc 4.4.3.
>

 gcc -v
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.4.4-14ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-objc-gc --enable-targets=all
--disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu
--target=i686-linux-gnu
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)


> El 02/03/2011, a las 6:26a.m., Igor Stasenko escribió:
>
>> This is strange.
>> I don't think that it will change anything, but can you try using my clone:
>>
>> git clone --depth 1 git://gitorious.org/~abrabapupa/cogvm/sig-cog.git
>
> checked... same result :)
>
Okay, i found the issue. It is in Cog sources:

Here the part from pthread.h header:

extern int pthread_create (pthread_t *__restrict __newthread,
			   __const pthread_attr_t *__restrict __attr,
>>>			   void *(*__start_routine) (void *),
			   void *__restrict __arg) __THROW __nonnull ((1, 3));


so, it barks on start_routine formal parameter type, which differs
from what used in sqUnixHeartBeat.c. There are two uses of it:

pthread_create(&tickerThread,
							(const pthread_attr_t *)0,
							tickerSleepCycle,
							0)))

	if ((er= pthread_create(&careLess,
							(const pthread_attr_t *)0,
							beatStateMachine,
							0))) {


static void tickerSleepCycle(void *ignored)
static void * beatStateMachine(void *careLess)

So, as you can see, the fix is extremely simple --- s/void/void*/  in
tickerSleepCycle declaration to match with function type which
pthread_create expects.

It is strange why my compiler don't barks on it :)



>>
>> and to generate stuff you can use just:
>>
>> CogUnixConfig generateWithSources.
>
> not checked, but this is just a cool way to avoid steps :)
>

Yes. The generic way to do things is to invoke:

<Config> generate
or
<Config> generateWithSources

and only if you need to customize a config, like build with different
plugin set, or using different directories layout, you then do:

| config |
config := <Config> new.
config platformsDir: (FileDirectory on:'/mydir/platforms').
config buildDir: (FileDirectory on:'/otherDir/build').

config internalPlugins: (config internalPlugins copyWith: #MyPlugin).
config generateSourceFiles.
CMakeVMMaker new generate: config.

>> I will check if it works with blessed repo. During next week. Right
>> now i busy preparing for school :)
>
> good luck, I want videos! :)
>
> best,
> Esteban
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list