Post Reply 
Trying to improve x49gp
11-15-2021, 10:54 PM
Post: #70
RE: Trying to improve x49gp
(11-13-2021 12:12 AM)3298 Wrote:  As Claudio said, his branch is more up-to-date than the ones you listed.

Regarding the errors, I haven't needed to recompile x49gp in ages because I didn't make changes, and nobody else did either ... but prompted by your request, I did so just now, and indeed there are some errors. All of them are just warnings promoted to errors by the -Werror flag, so the quick fix would be to get rid of that, or at least put in exemptions for the warnings that do occur.
Those I saw are:
- A whole bunch of array-bounds in qemu/qemu-git/tcg/x86_64/tcg-target.c. Those may or may not be valid, I'm not familiar enough with QEMU's guts to tell. That said, x49gp uses an ancient stripped-down version of QEMU, so a bit of breakage every now and then stemming from compiler updates is annoying but kind of expected.
- A pair of stringop-overflow in block-vvfat.c (which is also from QEMU, despite not being in that subdirectory). Same commentary applies.
- A pair of deprecated-declarations in /usr/include/gtk-2.0/gtk/gtktoolitem.h (yes, that's a system header; it's used in a number of x49gp source files) because the latest version of GTK2 declares some types as deprecated and then goes on to use them in function declarations. Silly GTK2, that will never work with -Werror - I can call that a GTK2 bug, right?

The last one can only be worked around (and that most likely has to be done in all GTK2 applications compiling with -Werror now, not just x49gp). The first two should be investigated and eventually fixed properly. Nevertheless, here's a quick fix via exemptions from -Werror. The warnings will still show up, but at least it will finish compiling.
Code:
diff --git a/Makefile b/Makefile
index 32cd67b..ad7ff2c 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,7 @@ CC += $(shell if [ "`uname -m`" = "sparc64" -o "`uname -m`" = "sun4u" ]; then ec
 
 COCOA_LIBS=$(shell if [ "`uname -s`" = "Darwin" ]; then echo "-F/System/Library/Frameworks -framework Cocoa -framework IOKit"; fi)
 
-X49GP_CFLAGS = -O2 -Wall -Werror $(DEBUG) $(INCLUDES) $(DEFINES)
+X49GP_CFLAGS = -O2 -Wall -Werror -Wno-error=deprecated-declarations $(DEBUG) $(INCLUDES) $(DEFINES)
 X49GP_LDFLAGS += $(DEBUG) $(GDB_LDFLAGS)
 X49GP_LDLIBS = $(X49GP_LIBS) $(GDB_LIBS) $(COCOA_LIBS)
 
@@ -177,7 +177,7 @@ _dir_qemu: dummy
        $(CC) $(CFLAGS) $(X49GP_CFLAGS) -o $@ -c $<
 
 block-vvfat.o: block-vvfat.c
-       $(CC) $(CFLAGS) $(X49GP_CFLAGS) -fno-aggressive-loop-optimizations -o $@ -c $<
+       $(CC) $(CFLAGS) $(X49GP_CFLAGS) -Wno-error=stringop-overflow -fno-aggressive-loop-optimizations -o $@ -c $<
 
 clean-qemu:
        $(MAKE) -C $(QEMU) -f Makefile-small clean
diff --git a/qemu/qemu-git/configure-small b/qemu/qemu-git/configure-small
index 2f629e4..93f93b8 100755
--- a/qemu/qemu-git/configure-small
+++ b/qemu/qemu-git/configure-small
@@ -81,7 +81,7 @@ ar="${cross_prefix}${ar}"
 ld="${cross_prefix}${ld}"
 
 # default flags for all hosts
-QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
+QEMU_CFLAGS="-fno-strict-aliasing -Wno-error=array-bounds $QEMU_CFLAGS"
 CFLAGS="-g $CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
Save that in a file, and run
Code:
patch -p1 -i <filename-you-saved-it-to>
to apply it.

---

As for distributing binaries: I can only speak for myself (other people could build it and distribute the results themselves, after all), but I've refrained from providing binaries so far for a number of reasons:

- I can provide a package for Arch Linux relatively easily, but that opens the door to people asking for Debian/Ubuntu, Fedora, BSD, MacOS, etc. packages which range from much harder to impossible with what I have. Not providing any is at least consistent.
- x49gp is derived from a modified ancient QEMU which is licensed under GPL, which means x49gp has to be GPL-licensed (or compatible) as well. It's not quite there, unfortunately. The most important part of GPL compliance is providing the source of course, which is trivial if the source is the only form it's distributed in ... but we should be declaring explicitly which license x49gp uses (which isn't as easy as it sounds, because not all contributors can be contacted anymore to ask whether they are okay with a particular license), and we shouldn't be bundling source-less calculator firmware with it. Aside from enforcing compliance with the GPL requirement for providing sources on request, avoiding binary distribution somewhat mitigates these legal headaches by helping keep a low profile.
- Speaking about bundling firmware, while some of my changes published in this thread (and subsequently committed into Claudio's repository) were aimed at eliminating the firmware from x49gp to insulate against license issues, there's still the bootcode left. At least those changes moving the firmware choice from the build process to a first-launch setup was a step in the right direction, because that means a user could just pick the newRPL firmware and get a usable emulator without HP firmware other than bootcode. Still, by bundling the bootcode (and firmware in the repository - mostly for convenience now, after those changes) HP could pound on its copyright on that data. Our only defense would be that strictly speaking they should have been aware of x49gp for a long time via HP employee Tim Wessman's past contributions, and still have not objected, thereby silently permitting us to keep distributing them. Keeping a low profile helps there too.

I DEFINITELY LOVE YOU (grin)

It actually worked. Thanks a million! This post should be pinned, as it's a working solution for newer Linux installations.

Thanks again. Now enjoying both my physical HP50G and my newest Linux one.

Cheers.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Trying to improve x49gp - 3298 - 10-28-2014, 10:08 PM
RE: Trying to improve x49gp - Han - 10-28-2014, 10:53 PM
RE: Trying to improve x49gp - Egan Ford - 10-29-2014, 02:54 AM
RE: Trying to improve x49gp - Egan Ford - 10-29-2014, 02:57 AM
RE: Trying to improve x49gp - Egan Ford - 10-29-2014, 03:10 AM
RE: Trying to improve x49gp - 3298 - 10-29-2014, 08:43 AM
RE: Trying to improve x49gp - Egan Ford - 10-31-2014, 12:36 AM
RE: Trying to improve x49gp - debrouxl - 10-29-2014, 09:18 AM
RE: Trying to improve x49gp - Claudio L. - 10-29-2014, 11:58 AM
RE: Trying to improve x49gp - Claudio L. - 10-29-2014, 12:04 PM
RE: Trying to improve x49gp - 3298 - 11-04-2014, 09:50 PM
RE: Trying to improve x49gp - Egan Ford - 11-08-2014, 09:50 PM
RE: Trying to improve x49gp - 3298 - 05-05-2018, 10:43 PM
RE: Trying to improve x49gp - 3298 - 05-05-2018, 10:45 PM
RE: Trying to improve x49gp - Claudio L. - 05-07-2018, 06:33 PM
RE: Trying to improve x49gp - 3298 - 05-07-2018, 08:55 PM
RE: Trying to improve x49gp - Claudio L. - 05-07-2018, 11:09 PM
RE: Trying to improve x49gp - dmmaster - 05-07-2018, 07:17 PM
RE: Trying to improve x49gp - 3298 - 05-07-2018, 08:12 PM
RE: Trying to improve x49gp - dmmaster - 05-07-2018, 08:36 PM
RE: Trying to improve x49gp - Claudio L. - 05-08-2018, 02:57 AM
RE: Trying to improve x49gp - 3298 - 05-08-2018, 11:19 AM
RE: Trying to improve x49gp - Claudio L. - 05-08-2018, 03:02 PM
RE: Trying to improve x49gp - 3298 - 05-08-2018, 06:17 PM
RE: Trying to improve x49gp - 3298 - 05-13-2018, 10:27 PM
RE: Trying to improve x49gp - Claudio L. - 05-14-2018, 01:24 AM
RE: Trying to improve x49gp - 3298 - 05-15-2018, 10:22 AM
RE: Trying to improve x49gp - 3298 - 08-23-2018, 05:44 PM
RE: Trying to improve x49gp - ijabbott - 08-23-2018, 07:15 PM
RE: Trying to improve x49gp - Claudio L. - 08-24-2018, 02:36 AM
RE: Trying to improve x49gp - 3298 - 08-26-2018, 02:22 PM
RE: Trying to improve x49gp - pier4r - 08-26-2018, 06:31 PM
RE: Trying to improve x49gp - Claudio L. - 08-27-2018, 01:39 PM
RE: Trying to improve x49gp - 3298 - 08-27-2018, 08:20 PM
RE: Trying to improve x49gp - Claudio L. - 08-27-2018, 09:07 PM
RE: Trying to improve x49gp - 3298 - 08-27-2018, 10:39 PM
RE: Trying to improve x49gp - Claudio L. - 08-28-2018, 02:51 AM
RE: Trying to improve x49gp - 3298 - 08-28-2018, 08:04 AM
RE: Trying to improve x49gp - Claudio L. - 08-29-2018, 02:17 AM
RE: Trying to improve x49gp - 3298 - 08-29-2018, 11:12 AM
RE: Trying to improve x49gp - Claudio L. - 08-29-2018, 10:02 PM
RE: Trying to improve x49gp - 3298 - 08-29-2018, 10:21 PM
RE: Trying to improve x49gp - brickviking - 08-29-2018, 10:46 PM
RE: Trying to improve x49gp - 3298 - 08-29-2018, 11:53 PM
RE: Trying to improve x49gp - Claudio L. - 08-30-2018, 09:35 PM
RE: Trying to improve x49gp - Claudio L. - 08-29-2018, 10:09 PM
RE: Trying to improve x49gp - brickviking - 08-31-2018, 12:10 AM
RE: Trying to improve x49gp - Claudio L. - 08-31-2018, 12:47 AM
RE: Trying to improve x49gp - 3298 - 08-31-2018, 08:15 AM
RE: Trying to improve x49gp - Claudio L. - 08-31-2018, 06:11 PM
RE: Trying to improve x49gp - pier4r - 08-31-2018, 07:43 PM
RE: Trying to improve x49gp - brickviking - 08-31-2018, 10:52 PM
RE: Trying to improve x49gp - Sylvain Cote - 08-31-2018, 11:12 PM
RE: Trying to improve x49gp - Claudio L. - 08-31-2018, 11:45 PM
RE: Trying to improve x49gp - Claudio L. - 10-04-2018, 09:21 PM
RE: Trying to improve x49gp - brickviking - 10-05-2018, 08:55 AM
RE: Trying to improve x49gp - 3298 - 10-05-2018, 11:26 AM
RE: Trying to improve x49gp - 3298 - 10-09-2018, 03:13 PM
RE: Trying to improve x49gp - Claudio L. - 10-10-2018, 02:25 PM
RE: Trying to improve x49gp - 3298 - 10-10-2018, 09:50 PM
RE: Trying to improve x49gp - Claudio L. - 10-11-2018, 02:43 AM
RE: Trying to improve x49gp - Claudio L. - 10-05-2018, 06:33 PM
RE: Trying to improve x49gp - brickviking - 10-05-2018, 09:43 PM
RE: Trying to improve x49gp - brickviking - 10-10-2018, 09:21 PM
RE: Trying to improve x49gp - Helix751 - 11-12-2021, 12:08 PM
RE: Trying to improve x49gp - Claudio L. - 11-12-2021, 09:39 PM
RE: Trying to improve x49gp - Helix751 - 11-15-2021, 10:46 PM
RE: Trying to improve x49gp - 3298 - 11-13-2021, 12:12 AM
RE: Trying to improve x49gp - Helix751 - 11-15-2021 10:54 PM
RE: Trying to improve x49gp - Claudio L. - 11-17-2021, 09:22 PM
RE: Trying to improve x49gp - 3298 - 11-17-2021, 11:47 PM
RE: Trying to improve x49gp - Claudio L. - 11-18-2021, 06:41 PM
RE: Trying to improve x49gp - Eric Rechlin - 11-18-2021, 07:16 PM
RE: Trying to improve x49gp - Claudio L. - 11-18-2021, 10:25 PM
RE: Trying to improve x49gp - Helix751 - 11-17-2021, 08:27 PM
RE: Trying to improve x49gp - 3298 - 11-17-2021, 09:17 PM
RE: Trying to improve x49gp - Helix751 - 12-05-2021, 08:36 PM
RE: Trying to improve x49gp - Claudio L. - 12-06-2021, 03:33 PM
RE: Trying to improve x49gp - Helix751 - 12-13-2021, 12:17 PM
RE: Trying to improve x49gp - gwh - 11-17-2021, 09:52 PM
RE: Trying to improve x49gp - 3298 - 11-17-2021, 11:02 PM
RE: Trying to improve x49gp - gwh - 11-18-2021, 05:40 AM
RE: Trying to improve x49gp - ijabbott - 11-18-2021, 08:23 PM
RE: Trying to improve x49gp - Claudio L. - 11-19-2021, 09:04 PM
RE: Trying to improve x49gp - 3298 - 11-19-2021, 11:50 PM
RE: Trying to improve x49gp - Claudio L. - 11-20-2021, 02:05 AM
RE: Trying to improve x49gp - gwh - 11-20-2021, 06:18 PM
RE: Trying to improve x49gp - Claudio L. - 11-21-2021, 09:47 PM
RE: Trying to improve x49gp - Claudio L. - 11-22-2021, 04:06 PM
RE: Trying to improve x49gp - Eric Rechlin - 11-19-2021, 10:26 PM
RE: Trying to improve x49gp - Claudio L. - 12-02-2021, 02:39 PM
RE: Trying to improve x49gp - gwh - 12-02-2021, 03:03 PM
RE: Trying to improve x49gp - gwh - 12-02-2021, 03:32 PM
RE: Trying to improve x49gp - Claudio L. - 12-06-2021, 03:36 PM



User(s) browsing this thread: 2 Guest(s)