Open coco875 opened 1 month ago
just in case the code I try to compile:
#include "gcc-plugin.h"
#include "plugin-version.h"
#include "tree.h"
#ifdef _WIN32
__declspec(dllexport)
#endif
int plugin_is_GPL_compatible;
/* Attribute handler callback */
static tree handle_hook_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) {
printf("hello hook!\n");
return NULL_TREE;
}
/* Attribute definition */
static struct attribute_spec hook_attr =
{ "hook", 1, 1, false, false, false, false, handle_hook_attribute, NULL };
/* Plugin callback called during attribute registration.
Registered with register_callback (plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL)
*/
static void register_attributes(void *event_data, void *data) {
register_attribute(&hook_attr);
}
#ifdef _WIN32
__declspec(dllexport)
#endif
int plugin_init (struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) {
const char *plugin_name = plugin_info->base_name;
printf("Hello, World!\n");
register_callback(plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL);
return 0;
}
I succeed to found it in https://packages.msys2.org/package/mingw-w64-x86_64-gcc but not in mingw distribute or w64devkit and in winlibs there is header but not cc1plus.exe.a or cc1.exe.a
I do build GCC with the --enable-plugin
flag, but no .exe.a
files are generated.
But I don't know why that's the case.
gcc give the abilities to make some plugin but from https://gcc.gnu.org/onlinedocs/gccint/Plugins-building.html it's say for windows it require add cc1.exe.a who are in plugin directory at the same level that all include but can't find it and without it I get: