lib_LTLIBRARIES = libinteraspect.la
libinteraspect_la_SOURCES = aop-main.c
-libinteraspect_la_LDFLAGS = -version-info 1:0:0
+libinteraspect_la_CFLAGS = -Wall -Werror -fvisibility=hidden -prefer-pic
+libinteraspect_la_LDFLAGS = -static -prefer-pic -version-info 1:0:0
libinteraspect_la_CPPFLAGS = -DHAVE_CONFIG_H -DIN_GCC -I$(gcc_includes)
.todo_flags_finish = TODO_update_ssa,
};
-void aop_register_pass (const char *pass_name, pass_callback callback)
+void
+aop_register_pass (const char *pass_name, pass_callback callback)
{
struct opt_pass *pass_aop;
struct register_pass_info pass_info;
/* Free memory taken up by struct opt_pass objects saved in the
aop_pass_list vector as well as the vector itself. */
-static void cleanup_passes ()
+static void
+cleanup_passes ()
{
int i;
struct opt_pass *pass;
/* This is the last plug-in function called before GCC exits. Clean
up all the memory we allocated. */
-static void aop_cleanup (void *event_date, void *data)
+static void
+aop_cleanup (void *event_date, void *data)
{
cleanup_passes();
}
/* GCC calls this to initialize a plug-in. Once InterAspect
initializes, it calls down into its client plug-in's
- initialization. */
-int plugin_init (struct plugin_name_args *plugin_info,
- struct plugin_gcc_version *version)
+ initialization.
+
+ By design, this function should be the _only_ exported (externally
+ visible) function in the compbined InterAspect/client package.
+
+ Note that the compiler is set to automatically mark function
+ definitions with "hidden" visibility. We override that behavior
+ here. */
+__attribute__((visibility("default"))) int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
{
fprintf (stderr, "InterAspect init.\n");
calls can pass values from the running program to the advice
function. */
+/* Client plug-in _must_ include this line to indicate that it is
+ GPLv3 compatible.*/
+#define AOP_I_AM_GPL_COMPATIBLE() \
+ __attribute__((visibility("default"))) int plugin_is_GPL_compatible;
+
+/* Define aop_main using the AOP_MAIN_PROTO macro. Absolutely do not
+ just declare it as a void function! */
+#define AOP_MAIN_PROTO __attribute__((visibility("hidden"))) void
+
typedef unsigned int (*pass_callback)();
void aop_register_pass(const char *pass_name, pass_callback callback);