Re: [Mono-dev] Error building mono on x86 (Mono-devel-list Digest, Vol 118, Issue 21)
On 18/02/15 13:09, Rafael Mueller - Inventti wrote: Currently the .so is in the same directory as the application, and the main application is marked as x86. running: MONO_LOG_LEVEL=debug ../MONO312/bin/mono SimuladorPDV.exe I got: Mono: DllImport error loading library '/home/mueller/simulador/libnfcepack_agente.so': '/home/mueller/simulador/libnfcepack_agente.so: wrong ELF class: ELFCLASS32'. I'm also able to run others x86 applications on this mono installation, but those app's doesn't [DllImport] and p/invoke other's .so Can you confirm that mono is should work with this setup? No. amd64 Mono can only JIT amd64 code and only P/Invoke amd64 libraries. Mono ignores the architecture flag on assemblies, and always uses the JITter it was built against. You can never load an i386 .so with amd64 Mono. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Error building mono on x86
Hi, I forgot to say, but I'm trying to build it as x86 on a x64 machine - the compilation as x64 worked (without the --host) Compilation on a x86 box also worked. This problem happens when I compile as x86 on a x64 box. Thanks, Rafael From: Miguel de Icaza mig...@xamarin.com Sent: Wednesday, February 18, 2015 12:21 AM To: Rafael Mueller - Inventti Cc: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Error building mono on x86 Hello, I am not sure why you are passing a --host command line option. Configure should be able to figure this out on its own. Miguel On Tue, Feb 17, 2015 at 6:29 PM, Rafael Mueller - Inventti raf...@inventti.com.brmailto:raf...@inventti.com.br wrote: Hi there, My (c#) application (compiled on windows, as x86) needs to load a 32 bits library (.so), so I must compile mono as x86, right? I've downloaded the 3.12 source and configured it with ./configure --host=i386-pc-linux-gnu But it always fails to compile: In file included from mono-context.c:8:0: mono-context.c: In function 'mono_sigctx_to_monoctx': ../../mono/utils/mono-sigcontext.h:144:74: error: 'REG_EAX' undeclared (first use in this function) #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))-uc_mcontext.gregs [REG_EAX]) I've tried to add AC_GNU_SOURCE on configure.achttp://configure.ac and also compiling with CFLAGS=$CFLAGS -D_GNU_SOURCE but I still can't compile it. I'm doing anything wrong? Any other advice to compile it on x86? I've also tried with mono 3.2.3 and 3.6, without success. Kind regards, Rafael ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.commailto:Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Error building mono on x86
Currently the .so is in the same directory as the application, and the main application is marked as x86. running: MONO_LOG_LEVEL=debug ../MONO312/bin/mono SimuladorPDV.exe I got: Mono: DllImport error loading library '/home/mueller/simulador/libnfcepack_agente.so': '/home/mueller/simulador/libnfcepack_agente.so: wrong ELF class: ELFCLASS32'. I'm also able to run others x86 applications on this mono installation, but those app's doesn't [DllImport] and p/invoke other's .so Can you confirm that mono is should work with this setup? mueller@UbuntuServer:~/simulador$ uname -a Linux UbuntuServer 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux mueller@UbuntuServer:~/simulador$ ../MONO312/bin/mono -V Mono JIT compiler version 3.12.0 (tarball Wed Feb 18 09:23:22 BRST 2015) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC:sgen mueller@UbuntuServer:~/simulador$ file libnfcepack_agente.so libnfcepack_agente.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=3c38c599de292a04755697ee18756cd79fb769aa, not stripped mueller@UbuntuServer:~/simulador$ file SimuladorPDV.exe SimuladorPDV.exe: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows mueller@UbuntuServer:~/simulador$ MONO_LOG_LEVEL=debug ../MONO312/bin/mono SimuladorPDV.exe skip Mono: DllImport error loading library '/home/mueller/simulador/libnfcepack_agente.so': '/home/mueller/simulador/libnfcepack_agente.so: wrong ELF class: ELFCLASS32'. From: Rafael Teixeira mono...@gmail.com Sent: Wednesday, February 18, 2015 8:18 AM To: Rafael Mueller - Inventti; Miguel de Icaza Cc: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Error building mono on x86 AFAIR your x64 mono will jit to 32 bits your x86 marked DLL if the main application is also marked as x86 , and then it will p/invoke properly your 32 bit .so, although in Linux where to place .so files is a bit more complex. On Wed, Feb 18, 2015, 07:16 Rafael Mueller - Inventti raf...@inventti.com.brmailto:raf...@inventti.com.br wrote: Hi, I forgot to say, but I'm trying to build it as x86 on a x64 machine - the compilation as x64 worked (without the --host) Compilation on a x86 box also worked. This problem happens when I compile as x86 on a x64 box. Thanks, Rafael From: Miguel de Icaza mig...@xamarin.commailto:mig...@xamarin.com Sent: Wednesday, February 18, 2015 12:21 AM To: Rafael Mueller - Inventti Cc: mono-devel-list@lists.ximian.commailto:mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Error building mono on x86 Hello, I am not sure why you are passing a --host command line option. Configure should be able to figure this out on its own. Miguel On Tue, Feb 17, 2015 at 6:29 PM, Rafael Mueller - Inventti raf...@inventti.com.brmailto:raf...@inventti.com.br wrote: Hi there, My (c#) application (compiled on windows, as x86) needs to load a 32 bits library (.so), so I must compile mono as x86, right? I've downloaded the 3.12 source and configured it with ./configure --host=i386-pc-linux-gnu But it always fails to compile: In file included from mono-context.c:8:0: mono-context.c: In function ‘mono_sigctx_to_monoctx’: ../../mono/utils/mono-sigcontext.h:144:74: error: ‘REG_EAX’ undeclared (first use in this function) #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))-uc_mcontext.gregs [REG_EAX]) I've tried to add AC_GNU_SOURCE on configure.achttp://configure.ac and also compiling with CFLAGS=$CFLAGS -D_GNU_SOURCE but I still can't compile it. I'm doing anything wrong? Any other advice to compile it on x86? I've also tried with mono 3.2.3 and 3.6, without success. Kind regards, Rafael ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.commailto:Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.commailto:Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Error building mono on x86
Hi there, My (c#) application (compiled on windows, as x86) needs to load a 32 bits library (.so), so I must compile mono as x86, right? I've downloaded the 3.12 source and configured it with ./configure --host=i386-pc-linux-gnu But it always fails to compile: In file included from mono-context.c:8:0: mono-context.c: In function 'mono_sigctx_to_monoctx': ../../mono/utils/mono-sigcontext.h:144:74: error: 'REG_EAX' undeclared (first use in this function) #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))-uc_mcontext.gregs [REG_EAX]) I've tried to add AC_GNU_SOURCE on configure.ac and also compiling with CFLAGS=$CFLAGS -D_GNU_SOURCE but I still can't compile it. I'm doing anything wrong? Any other advice to compile it on x86? I've also tried with mono 3.2.3 and 3.6, without success. Kind regards, Rafael ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Error building mono on x86
Hello, I am not sure why you are passing a --host command line option. Configure should be able to figure this out on its own. Miguel On Tue, Feb 17, 2015 at 6:29 PM, Rafael Mueller - Inventti raf...@inventti.com.br wrote: Hi there, My (c#) application (compiled on windows, as x86) needs to load a 32 bits library (.so), so I must compile mono as x86, right? I've downloaded the 3.12 source and configured it with ./configure --host=i386-pc-linux-gnu But it always fails to compile: In file included from mono-context.c:8:0: mono-context.c: In function ‘mono_sigctx_to_monoctx’: ../../mono/utils/mono-sigcontext.h:144:74: error: ‘REG_EAX’ undeclared (first use in this function) #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))-uc_mcontext.gregs [REG_EAX]) I've tried to add AC_GNU_SOURCE on configure.ac and also compiling with CFLAGS=$CFLAGS -D_GNU_SOURCE but I still can't compile it. I'm doing anything wrong? Any other advice to compile it on x86? I've also tried with mono 3.2.3 and 3.6, without success. Kind regards, Rafael ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list