Rebuilding AHX plugin from source

Discuss questions about plugin development with the Hollywood SDK here
Post Reply
SamuraiCrow
Posts: 304
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Rebuilding AHX plugin from source

Post 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!
I'm on registered MorphOS using FlowStudio.

User avatar
airsoftsoftwair
Posts: 4207
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Rebuilding AHX plugin from source

Post 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.

SamuraiCrow
Posts: 304
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Rebuilding AHX plugin from source

Post by SamuraiCrow »

I think the flag is __attribute__((used)) in front of the function definition. I'll try that.
I'm on registered MorphOS using FlowStudio.

SamuraiCrow
Posts: 304
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Rebuilding AHX plugin from source

Post 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
 
I'm on registered MorphOS using FlowStudio.

Post Reply