Hi, developers,I have new machine and try to build wp34s.
But the build is fail.
The environment is following.OS: LinuxMint 12 x86_64
Host GCC: gcc 4.6.1 x86_64-linux-gnu(provided by official repository)
Target GCC: gcc 4.6.3 arm-none-eabi(cross compiler is build by myself)
wp34s: SVN rev 2766First,
To build flash image, following error occurs.
cc -Wall -Werror -O1 -g -DHOSTBUILD -DREALBUILD -DXTAL -o Linux_realbuild/post_process.exe post_process.c
post_process.c: In function emainf:
post_process.c:73:2: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]Second,
To build console emulator or QtGui, following error occures.
cc -c -Wall -Werror -g -fno-common -fno-exceptions -O0 -DDEBUG -DQTGUI -o Linux_qt/obj/keys.o keys.c
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.6.1/include/stdint.h:3:0,
from lcd.h:22,
from keys.c:20:
/usr/include/stdint.h:56:27: error: conflicting types for euint64_tf
decNumber/decContext.h:46:32: note: previous declaration of euint64_tf was hereIf OS is Ubuntu11.10(32bit), build is succeeded.
The first one,
I try the flag -Wno-error=pointer-to-int-cast.
Warnning occurs but Error does not.
But Linux_realbuild/post_process.exe does not work.
What should I do?
The macro and semantics is difficult for me.The second one,
/usr/include/stdint.h is here.
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
#endifdecNumber/decContext.h is here
typedef unsigned long long int uint64_t;#ifdef __WORDSIZE == 64
type of uint64_t is different.The consele emulator works good.
QtGui is builded without serial.
I can not build qextserialport.a on x86_64 enviorment nor link it.Can you help me?
If using Linux and x86_64 machine.Modified patch is attached.
Index: trunk/Makefile
===================================================================
--- trunk/Makefile (revision 2766)
+++ trunk/Makefile (working copy)
@@ -333,7 +333,7 @@
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<$(UTILITIES)/post_process$(EXE): post_process.c Makefile features.h xeq.h
- $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+ $(HOSTCC) $(HOSTCFLAGS) -Wno-error=pointer-to-int-cast -o $@ $<xrom.c xrom_labels.h: xrom.wp34s $(XROM) $(OPCODES) Makefile features.h data.h errors.h
$(HOSTCC) -E -P -x c -Ixrom -DCOMPILE_XROM xrom.wp34s > xrom_pre.wp34s
Index: trunk/lcd.c
===================================================================
--- trunk/lcd.c (revision 2766)
+++ trunk/lcd.c (working copy)
@@ -29,8 +29,8 @@
#ifdef USECURSES
static unsigned char dots[400];
#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wformat"
-#pragma GCC diagnostic ignored "-Wformat-extra-args"
+//#pragma GCC diagnostic ignored "-Wformat"
+//#pragma GCC diagnostic ignored "-Wformat-extra-args"
#endifstatic void dispreg(const char n, int index) {
Index: trunk/decNumber/decContext.h
===================================================================
--- trunk/decNumber/decContext.h (revision 2766)
+++ trunk/decNumber/decContext.h (working copy)
@@ -29,6 +29,9 @@
/* extended -- must be either 0 or 1 [present only if DECSUBSET] */
/* */
/* ------------------------------------------------------------------ */
+#if defined __x86_64__
+# define __WORDSIZE 64
+#endif#if !defined(DECCONTEXT)
#define DECCONTEXT
@@ -43,7 +46,11 @@
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint64_t;
+#else
typedef unsigned long long int uint64_t;
+#endif/* Conditional code flag -- set this to 0 for best performance */
#define DECSUBSET 0 // 1=enable subset arithmetic
Index: trunk/linux-build-arm
===================================================================
--- trunk/linux-build-arm (revision 2766)
+++ trunk/linux-build-arm (working copy)
@@ -1,4 +1,7 @@
#!/bin/sh-PATH="/usr/local/CodeSourcery/Sourcery_G++_Lite/bin:$PATH"
-make REALBUILD=1
+#PATH="/usr/local/CodeSourcery/Sourcery_G++_Lite/bin:$PATH"
+PATH="/usr/local/arm-none-eabi/bin:/usr/lib/qt4/bin:$PATH"
+QMAKESPEC=/usr/lib/qt4/mkspecs/linux-g++
+make REALBUILD=1 XTAL=1
+
[WP34s] Build error on linux 64bit
|
04-07-2012, 08:51 AM
04-07-2012, 08:59 AM
I built qextserial on MacOSX 64 bits and Linux 32 bits but not on Linux 64 bits indeed. I'll have a look.
04-07-2012, 09:56 AM
The post processor and much of the code relies heavily on the fact tha an int is a 32 bit entity. Does gcc-64bit come with an option to produce a 32bit executable? If yes, set it in the makefile for HOSTOPTS.
04-07-2012, 01:21 PM
The necessary option for gcc and ld to produce 32-bit executables on a 64-bit host is "-m32". If you want 32-bit ints, the could should really include <stdint.h> or <inttypes.h> and use int32_t instead of int (or uint32_t instead of unsigned int), as these are the ONLY numeric types that the C standard guarantees to be 32-bit. Unfortunately the Microsoft compiler does not provide <stdint.h> and <inttypes.h>, because it is not actually a C compiler. On those rare occasions when I'm forced to use the Microsoft compiler, I write my own stdint.h that typedefs [u]int{8,16,32}_t to the appropriate Microsoft types. Whenever possible I avoid the Microsoft compiler and use GCC via MinGW.
04-07-2012, 01:28 PM
I had no choice. :-(
04-07-2012, 02:33 PM
Ok, I have been able to build it and to run it on an Ubuntu 64 bits.
1) I reported your change to decContext.h
I'll see how to make the emulator natively compatible with Linux 64 bits. So far, there is still a bug because of the 64 bits: the .dat file is not 2048 bytes long.
04-07-2012, 03:03 PM
To fix the .dat file size, just add: CFLAGS += -DFIX_64_BITS in the Makefile. Right now, it is defined for MacOSX only. But it applies to any 64 bits OS. I'll work on supporting Linux 64 bits natively when I have enough time. Right now, I'm busy with Stopwatch, generating the multi-platform emulator automatically and make WP34sFlash work reliably so this is not high-priority.
04-08-2012, 09:44 AM
Thank you, Eric. -m32 option works good. decNumber/decContext.h has same probrem, which you said <stdint.h> and uint32_t typedef probrem.
decNumber/decContext.h and -m32 is OK if only post_process.exe uses this. post_process.c is OK to use -m32. I propose following patch.
04-08-2012, 09:44 AM
Thank you, Pascal. Please modify trunk/QtGui/SerialPort.txt to get correct version of qextserialport.
Some BUG is found to find in trunk/QtGui/Makefile at line 174. So, I can run "QtGui/Linux/WP-34s -dev" with serial good.
04-08-2012, 02:11 PM
Thanks. I'll fix the bug and update the README. But I think I'll move to a more recent version of qextserialport as it fixes some quirks. |
« Next Oldest | Next Newest »
|