Hello
I try to build StackVM on my phone nokiaN9 by mariano blog http://marianopeck.wordpress.com/2011/04/10/building-the-vm-from-scratch-usi...
It is specific linux meego-hartmann on ARM. So I just perform all instructions on my phone terminal app. (generated sources from StackUnixConfig I copied to phone prepared dir). CMake command executed successfully. But "make" failed on processing LocalePlugin. I have in console:
Building C object LocalePlugin/../...Plugin.c o cc1 error: incorrect key "-m32" cc1 error: incorrect key "-msse2"
And I found any plugin cmakelists includes such statement:
add_definitions( -DLSB_FIRST=1 -DUSE_GLOBAL_STRUCT=0 -DCOGMTVM=0 -m32 -g0 -O2 -msse2 -D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DDEBUGVM=0)
What do you think? What I can do to fix it?
P.S. I'am very beginner on C stuff.
Best regards, Denis
Hi Denis,
On Tue, Oct 2, 2012 at 2:10 PM, Denis Kudriashov dionisiydk@gmail.comwrote:
Hello
I try to build StackVM on my phone nokiaN9 by mariano blog http://marianopeck.wordpress.com/2011/04/10/building-the-vm-from-scratch-usi...
It is specific linux meego-hartmann on ARM. So I just perform all instructions on my phone terminal app. (generated sources from StackUnixConfig I copied to phone prepared dir). CMake command executed successfully. But "make" failed on processing LocalePlugin. I have in console:
Building C object LocalePlugin/../...Plugin.c o cc1 error: incorrect key "-m32" cc1 error: incorrect key "-msse2"
-msse2 is specific to x86 processors ad says "generate SSE2 instructions". -m32 is more general but means "generate 32-bit code".
So both of these options can be omitted.
HTH
And I found any plugin cmakelists includes such statement:
add_definitions( -DLSB_FIRST=1 -DUSE_GLOBAL_STRUCT=0 -DCOGMTVM=0 -m32 -g0 -O2 -msse2 -D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DDEBUGVM=0)
What do you think? What I can do to fix it?
Everything except -m32 -msse2 should be fine.
P.S. I'am very beginner on C stuff.
Best regards, Denis
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o] Ошибка 1 make[1]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/all] Ошибка 2
2012/10/3, Eliot Miranda eliot.miranda@gmail.com:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o] Ошибка 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
make[1]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/all] Ошибка 2
2012/10/3, Eliot Miranda eliot.miranda@gmail.com:
On Wed, Oct 3, 2012 at 10:31 AM, Igor Stasenko siguctua@gmail.com wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: ***
[IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o]
Ошибка 1
so remove that plugin from a build.
something like this:
It is not a fix, but maybe you can jus workaround by excluding the Sound plugin?
| conf | conf := XXXConfig new. conf internalPlugins: (conf internalPlugins copyWithout: #LocalePlugin). conf generateSources; generate.
(or just remove it from #defaultInternalPlugins)
You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
make[1]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/all] Ошибка 2
2012/10/3, Eliot Miranda eliot.miranda@gmail.com:
-- Best regards, Igor Stasenko.
On 3 October 2012 10:35, Mariano Martinez Peck marianopeck@gmail.com wrote:
On Wed, Oct 3, 2012 at 10:31 AM, Igor Stasenko siguctua@gmail.com wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o] Ошибка 1
so remove that plugin from a build.
something like this:
It is not a fix, but maybe you can jus workaround by excluding the Sound plugin?
| conf | conf := XXXConfig new. conf internalPlugins: (conf internalPlugins copyWithout: #LocalePlugin). conf generateSources; generate.
(or just remove it from #defaultInternalPlugins)
Normally, what you should do is to create own subclass of existing config class (XXXConfig), or create new one.
You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
make[1]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/all] Ошибка 2
2012/10/3, Eliot Miranda eliot.miranda@gmail.com:
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
Thank's. I will try.
Another question. I generate sources on my windows machine then I copy it to phone build dir. So by default I have absolute path to my pharo dir inside generated files. Can I somehow specify custom path? Now I replace it manually in generated files (by some tool)
2012/10/3 Igor Stasenko siguctua@gmail.com
On 3 October 2012 10:35, Mariano Martinez Peck marianopeck@gmail.com wrote:
On Wed, Oct 3, 2012 at 10:31 AM, Igor Stasenko siguctua@gmail.com
wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov
[sp,#844],%edx'
/tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: ***
[IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o]
Ошибка 1
so remove that plugin from a build.
something like this:
It is not a fix, but maybe you can jus workaround by excluding the Sound
plugin?
| conf | conf := XXXConfig new. conf internalPlugins: (conf internalPlugins copyWithout: #LocalePlugin). conf generateSources; generate.
(or just remove it from #defaultInternalPlugins)
Normally, what you should do is to create own subclass of existing config class (XXXConfig), or create new one.
You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
make[1]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/all] Ошибка 2
2012/10/3, Eliot Miranda eliot.miranda@gmail.com:
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
On 3 October 2012 13:39, Denis Kudriashov dionisiydk@gmail.com wrote:
Thank's. I will try.
Another question. I generate sources on my windows machine then I copy it to phone build dir. So by default I have absolute path to my pharo dir inside generated files. Can I somehow specify custom path? Now I replace it manually in generated files (by some tool)
Check #setupDirectories: method , you can override it to suit your needs (like use relative dirs all the way), if you want.
2012/10/3 Igor Stasenko siguctua@gmail.com
On 3 October 2012 10:35, Mariano Martinez Peck marianopeck@gmail.com wrote:
On Wed, Oct 3, 2012 at 10:31 AM, Igor Stasenko siguctua@gmail.com wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o] Ошибка 1
so remove that plugin from a build.
something like this:
It is not a fix, but maybe you can jus workaround by excluding the Sound plugin?
| conf | conf := XXXConfig new. conf internalPlugins: (conf internalPlugins copyWithout: #LocalePlugin). conf generateSources; generate.
(or just remove it from #defaultInternalPlugins)
Normally, what you should do is to create own subclass of existing config class (XXXConfig), or create new one.
You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
make[1]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/all] Ошибка 2
2012/10/3, Eliot Miranda eliot.miranda@gmail.com:
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
On Wed, Oct 03, 2012 at 10:31:55AM +0200, Igor Stasenko wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o] ???????????? 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
FYI, the smallest useable VM requires these plugins:
BitBltSimulation BalloonEnginePlugin FilePlugin
But usually you will also want networking, so a good starting point for a minimal VM is:
BitBltSimulation BalloonEnginePlugin FilePlugin SocketPlugin
Dave
Ok. I exclude IA32ABIPlugin. It's help. And now I have next problem:
[ 87%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o In file included from /cogVM/blessed/platforms/Cross/vm/sqTicker.c:56: /cogVM/blessed/platforms/Cross/vm/sqAtomicOps.h:140: ошибка: #error atomic access of 64-bit variables not yet defined for this platform make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What I can do now?
2012/10/3 David T. Lewis lewis@mail.msen.com
On Wed, Oct 03, 2012 at 10:31:55AM +0200, Igor Stasenko wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov
[sp,#844],%edx'
/tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: ***
[IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o]
???????????? 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
FYI, the smallest useable VM requires these plugins:
BitBltSimulation BalloonEnginePlugin FilePlugin
But usually you will also want networking, so a good starting point for a minimal VM is:
BitBltSimulation BalloonEnginePlugin FilePlugin SocketPlugin
Dave
I found comment:
/* Atomic increment of 32-bit values allows a lock-free implementation of the * request side of signalSemaphoreWithIndex: */
/* Currently we provide definitions for x86 and GCC only. */ #if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_)) #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #else # define sqAtomicAddConst(var,n) \ asm volatile ("lock addl %1, %0" : "=m" (var) : "i" (n), "m" (var)) #endif #else #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #endif /* Dear implementor, you have choices. Google atomic increment and you will * find a number of implementations for other architectures. */ #endif
I now try to google it. Maybe you already know how to fix it?
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
Ok. I exclude IA32ABIPlugin. It's help. And now I have next problem:
[ 87%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o In file included from /cogVM/blessed/platforms/Cross/vm/sqTicker.c:56: /cogVM/blessed/platforms/Cross/vm/sqAtomicOps.h:140: ошибка: #error atomic access of 64-bit variables not yet defined for this platform make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What I can do now?
2012/10/3 David T. Lewis lewis@mail.msen.com
On Wed, Oct 03, 2012 at 10:31:55AM +0200, Igor Stasenko wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov
[sp,#844],%edx'
/tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: ***
[IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o]
???????????? 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
FYI, the smallest useable VM requires these plugins:
BitBltSimulation BalloonEnginePlugin FilePlugin
But usually you will also want networking, so a good starting point for a minimal VM is:
BitBltSimulation BalloonEnginePlugin FilePlugin SocketPlugin
Dave
I was incorrect. Problem happens early on defining atomic access of 64-bit variables. So I just uncomment something like this:
/* Dear implementor, you have choices. For example consider defining get64 & * set64 thusly * #define get64(var) read64(&(var)) * #define set64(var,val) write64(&(var),val) * and get the JIT to generate read64 & write64 above atomic 64-bit read/write. */ *# define get64(var) read64(&(var)) # define set64(var,val) write64(&(var),val) * //error atomic access of 64-bit variables not yet defined for this platform # endif -------------------------------------
Now I have another problem:
[ 90%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/unix/vm/sqUnixHeartbeat.c.o cc1: error: incorrect key "-mno-rtd" cc1: error: incorrect key "-mno-accumulate-outgoing-args" make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/unix/vm/sqUnixHeartbeat.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What this keys mean? And what I can do?
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
I found comment:
/* Atomic increment of 32-bit values allows a lock-free implementation of the
- request side of signalSemaphoreWithIndex:
*/
/* Currently we provide definitions for x86 and GCC only. */
#if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_)) #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #else # define sqAtomicAddConst(var,n) \ asm volatile ("lock addl %1, %0" : "=m" (var) : "i" (n), "m" (var)) #endif #else #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #endif /* Dear implementor, you have choices. Google atomic increment and you will
- find a number of implementations for other architectures.
*/ #endif
I now try to google it. Maybe you already know how to fix it?
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
Ok. I exclude IA32ABIPlugin. It's help. And now I have next problem:
[ 87%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o In file included from /cogVM/blessed/platforms/Cross/vm/sqTicker.c:56: /cogVM/blessed/platforms/Cross/vm/sqAtomicOps.h:140: ошибка: #error atomic access of 64-bit variables not yet defined for this platform make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What I can do now?
2012/10/3 David T. Lewis lewis@mail.msen.com
On Wed, Oct 03, 2012 at 10:31:55AM +0200, Igor Stasenko wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com
wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov
[sp,#844],%edx'
/tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: ***
[IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o]
???????????? 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
FYI, the smallest useable VM requires these plugins:
BitBltSimulation BalloonEnginePlugin FilePlugin
But usually you will also want networking, so a good starting point for a minimal VM is:
BitBltSimulation BalloonEnginePlugin FilePlugin SocketPlugin
Dave
Ok, I just remove keys from makefilelist. And now I have error* no high res clock defined:*
sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0; #if defined(__GNUC__) && ( defined(i386) || defined(__i386) || defined(__i386__) \ || defined(i486) || defined(__i486) || defined (__i486__) \ || defined(intel) || defined(x86) || defined(i86pc) ) __asm__ __volatile__ ("rdtsc" : "=A"(value)); #else *# error "no high res clock defined"* #endif return value; }
I try to just return value here;
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
I was incorrect. Problem happens early on defining atomic access of 64-bit variables. So I just uncomment something like this:
/* Dear implementor, you have choices. For example consider defining get64 &
- set64 thusly
- #define get64(var) read64(&(var))
- #define set64(var,val) write64(&(var),val)
- and get the JIT to generate read64 & write64 above atomic 64-bit
read/write. */ *# define get64(var) read64(&(var)) # define set64(var,val) write64(&(var),val)
//error atomic access of 64-bit variables not yet defined for this platform
# endif
Now I have another problem:
[ 90%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/unix/vm/sqUnixHeartbeat.c.o cc1: error: incorrect key "-mno-rtd" cc1: error: incorrect key "-mno-accumulate-outgoing-args" make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/unix/vm/sqUnixHeartbeat.c.o] error 1
make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What this keys mean? And what I can do?
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
I found comment:
/* Atomic increment of 32-bit values allows a lock-free implementation of the
- request side of signalSemaphoreWithIndex:
*/
/* Currently we provide definitions for x86 and GCC only. */
#if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_)) #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #else # define sqAtomicAddConst(var,n) \ asm volatile ("lock addl %1, %0" : "=m" (var) : "i" (n), "m" (var)) #endif #else #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #endif /* Dear implementor, you have choices. Google atomic increment and you will
- find a number of implementations for other architectures.
*/ #endif
I now try to google it. Maybe you already know how to fix it?
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
Ok. I exclude IA32ABIPlugin. It's help. And now I have next problem:
[ 87%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o In file included from /cogVM/blessed/platforms/Cross/vm/sqTicker.c:56: /cogVM/blessed/platforms/Cross/vm/sqAtomicOps.h:140: ошибка: #error atomic access of 64-bit variables not yet defined for this platform make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What I can do now?
2012/10/3 David T. Lewis lewis@mail.msen.com
On Wed, Oct 03, 2012 at 10:31:55AM +0200, Igor Stasenko wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com
wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov
[sp,#844],%edx'
/tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: ***
[IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o]
???????????? 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
FYI, the smallest useable VM requires these plugins:
BitBltSimulation BalloonEnginePlugin FilePlugin
But usually you will also want networking, so a good starting point for a minimal VM is:
BitBltSimulation BalloonEnginePlugin FilePlugin SocketPlugin
Dave
On 3 October 2012 20:31, Denis Kudriashov dionisiydk@gmail.com wrote:
Ok, I just remove keys from makefilelist. And now I have error no high res clock defined:
sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0; #if defined(__GNUC__) && ( defined(i386) || defined(__i386) || defined(__i386__) \ || defined(i486) || defined(__i486) || defined (__i486__) \ || defined(intel) || defined(x86) || defined(i86pc) ) __asm__ __volatile__ ("rdtsc" : "=A"(value)); #else # error "no high res clock defined" #endif return value; }
I try to just return value here;
bad idea..
seems like you get to the place where you need to make your hands dirty implementing some stuff :)
But i think this was done before for ARM.
I think, Dimitry can help you there, since he were adopted Stack VM for ARM before:
https://gitorious.org/~golubovsky/cogvm/dmg-blessed
Check his code, maybe it can help you.
2012/10/3 Igor Stasenko siguctua@gmail.com
On 3 October 2012 20:31, Denis Kudriashov dionisiydk@gmail.com wrote:
Ok, I just remove keys from makefilelist. And now I have error no high
res clock defined:
sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0; #if defined(__GNUC__) && ( defined(i386) || defined(__i386) ||
defined(__i386__) \
|| defined(i486) || defined(__i486) || defined (__i486__) \ || defined(intel) || defined(x86) || defined(i86pc) ) __asm__ __volatile__ ("rdtsc" : "=A"(value));
#else # error "no high res clock defined" #endif return value; }
I try to just return value here;
bad idea..
seems like you get to the place where you need to make your hands dirty implementing some stuff :)
But i think this was done before for ARM.
I think, Dimitry can help you there, since he were adopted Stack VM for ARM before:
I will look at it. But now my linking process broken. I have too many undefines during linking C executable StackVM which finished with error:
85%] Built target SurfacePlugin Linking C executable /cogVM/blessed/results/StackVM CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `markAndTraceInterpreterOops': gcc3x-interp.c:(.text+0x6130): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `primitiveLongRunningPrimitiveSemaphore': gcc3x-interp.c:(.text+0x6868): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `forceInterruptCheck': gcc3x-interp.c:(.text+0x68c4): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `L0mapInterpreterOops': gcc3x-interp.c:(.text+0x9a0c): undefined reference to `sqLowLevelMFence' gcc3x-interp.c:(.text+0x9a68): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `interpreterAllocationReserveBytes': gcc3x-interp.c:(.text+0xac44): undefined reference to `pow' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `forceInterruptCheckFromHeartbeat': gcc3x-interp.c:(.text+0x10bec): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `L25assertClassOfiscompactClassIndex': gcc3x-interp.c:(.text+0x129e4): undefined reference to `exp' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `L5 ... dct.c:(.text+0x2d54): undefined reference to `cos' dct.c:(.text+0x2d60): undefined reference to `sin' dct.c:(.text+0x2ef8): undefined reference to `sincos' collect2: perform *ld *complete with code 1 make[2]: *** [/cogVM/blessed/results/StackVM] Ошибка 1 make[1]: *** [CMakeFiles/StackVM.dir/all] Ошибка 2 make: *** [all] Ошибка 2
What can be reason? Are undefined's just warnings?
Mariano write about:
Then, I have a problem at linking time, "/usr/bin/*ld*: cannot find -lGL", which
But I dont see any "cannot find -lGL". What this error actualy means?
On 3 October 2012 21:15, Denis Kudriashov dionisiydk@gmail.com wrote:
2012/10/3 Igor Stasenko siguctua@gmail.com
On 3 October 2012 20:31, Denis Kudriashov dionisiydk@gmail.com wrote:
Ok, I just remove keys from makefilelist. And now I have error no high res clock defined:
sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0; #if defined(__GNUC__) && ( defined(i386) || defined(__i386) || defined(__i386__) \ || defined(i486) || defined(__i486) || defined (__i486__) \ || defined(intel) || defined(x86) || defined(i86pc) ) __asm__ __volatile__ ("rdtsc" : "=A"(value)); #else # error "no high res clock defined" #endif return value; }
I try to just return value here;
bad idea..
seems like you get to the place where you need to make your hands dirty implementing some stuff :)
But i think this was done before for ARM.
I think, Dimitry can help you there, since he were adopted Stack VM for ARM before:
I will look at it. But now my linking process broken. I have too many undefines during linking C executable StackVM which finished with error:
85%] Built target SurfacePlugin Linking C executable /cogVM/blessed/results/StackVM CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `markAndTraceInterpreterOops': gcc3x-interp.c:(.text+0x6130): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `primitiveLongRunningPrimitiveSemaphore': gcc3x-interp.c:(.text+0x6868): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `forceInterruptCheck': gcc3x-interp.c:(.text+0x68c4): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `L0mapInterpreterOops': gcc3x-interp.c:(.text+0x9a0c): undefined reference to `sqLowLevelMFence' gcc3x-interp.c:(.text+0x9a68): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `interpreterAllocationReserveBytes': gcc3x-interp.c:(.text+0xac44): undefined reference to `pow' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `forceInterruptCheckFromHeartbeat': gcc3x-interp.c:(.text+0x10bec): undefined reference to `sqLowLevelMFence' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `L25assertClassOfiscompactClassIndex': gcc3x-interp.c:(.text+0x129e4): undefined reference to `exp' CMakeFiles/StackVM.dir/cogVM/blessed/src/vm/gcc3x-interp.c.o: In function `L5 ...
sqLowLevelMFence() is low-level assembler function used in various atomic operations. It is not defined for ARM architecture. Can't help with it.. i know little about ARM. But as i told you, Dimitry already dealt with these problems when making VM work on android platform you should just look and adopt his code. Search mailing list , you can find pointers.
Btw, iPhone VM also runs on ARM, so the solution which Esteban/John Macintosh found, should be similar. I cannot say any more details, because i simply don't know.
dct.c:(.text+0x2d54): undefined reference to `cos' dct.c:(.text+0x2d60): undefined reference to `sin' dct.c:(.text+0x2ef8): undefined reference to `sincos' collect2: perform ld complete with code 1 make[2]: *** [/cogVM/blessed/results/StackVM] Ошибка 1 make[1]: *** [CMakeFiles/StackVM.dir/all] Ошибка 2 make: *** [all] Ошибка 2
no libm on ARM?
-lm
What can be reason? Are undefined's just warnings?
Mariano write about:
Then, I have a problem at linking time, “/usr/bin/ld: cannot find -lGL”, which
But I dont see any "cannot find -lGL”. What this error actualy means?
means that you need to find a code which uses that and remove it :)
P.S. and welcome to beautiful world of C :)
2012/10/4 Igor Stasenko siguctua@gmail.com
sqLowLevelMFence() is low-level assembler function used in various atomic operations. It is not defined for ARM architecture. Can't help with it.. i know little about ARM. But as i told you, Dimitry already dealt with these problems when making VM work on android platform you should just look and adopt his code. Search mailing list , you can find pointers.
Btw, iPhone VM also runs on ARM, so the solution which Esteban/John Macintosh found, should be similar. I cannot say any more details, because i simply don't know.
dct.c:(.text+0x2d54): undefined reference to `cos' dct.c:(.text+0x2d60): undefined reference to `sin' dct.c:(.text+0x2ef8): undefined reference to `sincos' collect2: perform ld complete with code 1 make[2]: *** [/cogVM/blessed/results/StackVM] Ошибка 1 make[1]: *** [CMakeFiles/StackVM.dir/all] Ошибка 2 make: *** [all] Ошибка 2
no libm on ARM?
-lm
So I should try to resolve all undefines.
What can be reason? Are undefined's just warnings?
Mariano write about:
Then, I have a problem at linking time, "/usr/bin/ld: cannot find
-lGL", which
But I dont see any "cannot find -lGL". What this error actualy means?
means that you need to find a code which uses that and remove it :)
P.S. and welcome to beautiful world of C :)
Yes, C world is amazing :)) I wondering about tons of defines pragma instructions. So my first think why all this precompile instructions not implemented at smalltalk side with good object abstraction? If you see code you know about tons of ifdefine IPhoneSomething else ifdefine SomethingElse... which repeated at many places of platforms code. (dont know about slang)
On 3 October 2012 19:55, Denis Kudriashov dionisiydk@gmail.com wrote:
I was incorrect. Problem happens early on defining atomic access of 64-bit variables. So I just uncomment something like this:
/* Dear implementor, you have choices. For example consider defining get64 &
- set64 thusly
- #define get64(var) read64(&(var))
- #define set64(var,val) write64(&(var),val)
- and get the JIT to generate read64 & write64 above atomic 64-bit read/write.
*/ # define get64(var) read64(&(var)) # define set64(var,val) write64(&(var),val)
//error atomic access of 64-bit variables not yet defined for this platform
# endif
Now I have another problem:
[ 90%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/unix/vm/sqUnixHeartbeat.c.o cc1: error: incorrect key "-mno-rtd" cc1: error: incorrect key "-mno-accumulate-outgoing-args" make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/unix/vm/sqUnixHeartbeat.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What this keys mean? And what I can do?
i dont know why it calls it "keys" but this is compiler flags. i would just remove them :)
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
I found comment:
/* Atomic increment of 32-bit values allows a lock-free implementation of the
- request side of signalSemaphoreWithIndex:
*/
/* Currently we provide definitions for x86 and GCC only. */
#if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_)) #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #else # define sqAtomicAddConst(var,n) \ asm volatile ("lock addl %1, %0" : "=m" (var) : "i" (n), "m" (var)) #endif #else #ifdef TARGET_OS_IS_IPHONE #define sqAtomicAddConst(var,n) OSAtomicAdd32(n,&var) #endif /* Dear implementor, you have choices. Google atomic increment and you will
- find a number of implementations for other architectures.
*/ #endif
I now try to google it. Maybe you already know how to fix it?
2012/10/3 Denis Kudriashov dionisiydk@gmail.com
Ok. I exclude IA32ABIPlugin. It's help. And now I have next problem:
[ 87%] Building C object CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o In file included from /cogVM/blessed/platforms/Cross/vm/sqTicker.c:56: /cogVM/blessed/platforms/Cross/vm/sqAtomicOps.h:140: ошибка: #error atomic access of 64-bit variables not yet defined for this platform make[2]: *** [CMakeFiles/StackVM.dir/cogVM/blessed/platforms/Cross/vm/sqTicker.c.o] error 1 make[1]: *** [CMakeFiles/StackVM.dir/all] error 2 make: *** [all] error 2
What I can do now?
2012/10/3 David T. Lewis lewis@mail.msen.com
On Wed, Oct 03, 2012 at 10:31:55AM +0200, Igor Stasenko wrote:
On 3 October 2012 06:29, Denis Kudriashov dionisiydk@gmail.com wrote:
Great. I remove it. Now process stopped at ~30% on:
tmp/cc33Ks89.s: Assembler messages: /tmp/cc33Ks89.s:90: Error: ARM register expected -- `mov [sp,#844],%edx' /tmp/cc33Ks89.s:118: Error: bad instruction `fldl [r0,#0]' make[2]: *** [IA32ABI/CMakeFiles/IA32ABI.dir/cogVM/blessed/platforms/Cross/plugins/IA32ABI/ia32abicc.c.o] ???????????? 1
so remove that plugin from a build. You should start from minimum set of plugins and then proceed adding more once you can make them compiling/working.
FYI, the smallest useable VM requires these plugins:
BitBltSimulation BalloonEnginePlugin FilePlugin
But usually you will also want networking, so a good starting point for a minimal VM is:
BitBltSimulation BalloonEnginePlugin FilePlugin SocketPlugin
Dave
vm-dev@lists.squeakfoundation.org