Page 1 of 1

Rebuilding AHX plugin from source

Posted: Mon Jun 15, 2020 8:43 pm
by SamuraiCrow
Hi!

I tried rebuilding the AHX plugin under MorphOS 3.13 using the latest SDK for the OS. I think the dead code elimination is too aggressive on GCC 9. What version of GCC did you use to build the plugin? Also, the source on the download page builds 1.2 instead of 1.3.

Thanks in advance!

Re: Rebuilding AHX plugin from source

Posted: Tue Jun 16, 2020 10:19 pm
by airsoftsoftwair
Yes, you must make sure that the compiler doesn't strip the important symbols in amigaentry.c. I'm still on gcc5 which doesn't strip them but in gcc9 you can probably set a flag or something to tell the compiler to not strip them.

I'll soon upload the 1.3 sources but judging from the history, there's just a single line that is different.

Re: Rebuilding AHX plugin from source

Posted: Wed Jun 17, 2020 3:49 am
by SamuraiCrow
I think the flag is __attribute__((used)) in front of the function definition. I'll try that.

Re: Rebuilding AHX plugin from source

Posted: Wed Jun 17, 2020 5:28 am
by SamuraiCrow
Confirmed!

The GCC9 build is still a lot smaller but seems to work! The following diff should be applied to Hollywood:SDK/includes/hollywood/plugin.h

Code: Select all

diff --git a/System:Applications/Hollywood/SDK/include/hollywood/plugin_old.h b/System:Applications/Hollywood/SDK/include/hollywood/plugin.h
index 279aaa3..3a35944 100644
--- a/System:Applications/Hollywood/SDK/include/hollywood/plugin_old.h
+++ b/System:Applications/Hollywood/SDK/include/hollywood/plugin.h
@@ -96,6 +96,8 @@
 #define HW_EXPORT __saveds
 #elif defined(HW_WIN32)
 #define HW_EXPORT __declspec(dllexport)
+#elif defined(HW_MORPHOS) || defined(HW_AMIGAOS4)
+#define HW_EXPORT __attribute__((used)) 
 #else
 #define HW_EXPORT
 #endif