Browse Source

carla-plugin: Only export exactly the symbols that we need

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
f52eb78736
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
17 changed files with 77 additions and 28 deletions
  1. +21
    -23
      source/plugin/Makefile
  2. +12
    -5
      source/plugin/carla-vst-export.cpp
  3. +0
    -0
      source/plugin/symbols/carla-lv2_dsp+ui.def
  4. +2
    -0
      source/plugin/symbols/carla-lv2_dsp+ui.txt
  5. +4
    -0
      source/plugin/symbols/carla-lv2_dsp+ui.version
  6. +0
    -0
      source/plugin/symbols/carla-lv2_dsp.def
  7. +1
    -0
      source/plugin/symbols/carla-lv2_dsp.txt
  8. +4
    -0
      source/plugin/symbols/carla-lv2_dsp.version
  9. +0
    -0
      source/plugin/symbols/carla-lv2_ui.def
  10. +1
    -0
      source/plugin/symbols/carla-lv2_ui.txt
  11. +4
    -0
      source/plugin/symbols/carla-lv2_ui.version
  12. +0
    -0
      source/plugin/symbols/carla-native-plugin.def
  13. +10
    -0
      source/plugin/symbols/carla-native-plugin.txt
  14. +13
    -0
      source/plugin/symbols/carla-native-plugin.version
  15. +0
    -0
      source/plugin/symbols/carla-vst.def
  16. +1
    -0
      source/plugin/symbols/carla-vst.txt
  17. +4
    -0
      source/plugin/symbols/carla-vst.version

+ 21
- 23
source/plugin/Makefile View File

@@ -121,35 +121,33 @@ LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
endif endif
endif endif


ifeq ($(MACOS),true)
SYMBOLS_NATIVE = -Wl,-exported_symbol,_carla_get_native_rack_plugin
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_host_handle_free
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_plugin_engine
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_filename
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_folder
SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor
ifeq ($(WIN32),true)
SYMBOLS_NATIVE = symbols/carla-native-plugin.def
SYMBOLS_VST = symbols/carla-vst.def
ifeq ($(HAVE_PYQT),true) ifeq ($(HAVE_PYQT),true)
SYMBOLS_LV2 += -Wl,-exported_symbol,_lv2ui_descriptor
SYMBOLS_LV2_UI = -Wl,-exported_symbol,_lv2ui_descriptor
SYMBOLS_LV2 = symbols/carla-lv2_dsp+ui.def
SYMBOLS_LV2_UI = symbols/carla-lv2_ui.def
else
SYMBOLS_LV2 = symbols/carla-lv2_dsp.def
endif endif
SYMBOLS_VST = -Wl,-exported_symbol,_VSTPluginMain
else ifeq ($(MACOS),true)
SYMBOLS_NATIVE = -Wl,-export-symbols=symbols/carla-native-plugin.txt
SYMBOLS_VST = -Wl,-export-symbols=symbols/carla-vst.txt
ifeq ($(HAVE_PYQT),true)
SYMBOLS_LV2 = -Wl,-export-symbols=symbols/carla-lv2_dsp+ui.txt
SYMBOLS_LV2_UI = -Wl,-export-symbols=symbols/carla-lv2_ui.txt
else
SYMBOLS_LV2 = -Wl,-export-symbols=symbols/carla-lv2_dsp.txt
endif endif

ifeq ($(WIN32),true)
SYMBOLS_NATIVE = win-def/carla-native-plugin.def
else
SYMBOLS_NATIVE = -Wl,--version-script=symbols/carla-native-plugin.version
SYMBOLS_VST = -Wl,--version-script=symbols/carla-vst.version
ifeq ($(HAVE_PYQT),true) ifeq ($(HAVE_PYQT),true)
SYMBOLS_LV2 = win-def/carla-lv2_dsp+ui.def
SYMBOLS_LV2_UI = win-def/carla-lv2_ui.def
SYMBOLS_LV2 = -Wl,--version-script=symbols/carla-lv2_dsp+ui.version
SYMBOLS_LV2_UI = -Wl,--version-script=symbols/carla-lv2_ui.version
else else
SYMBOLS_LV2 = win-def/carla-lv2_dsp.def
SYMBOLS_LV2 = -Wl,--version-script=symbols/carla-lv2_dsp.version
endif endif
SYMBOLS_VST = win-def/carla-vst.def
endif endif


# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------


+ 12
- 5
source/plugin/carla-vst-export.cpp View File

@@ -1,6 +1,6 @@
/* /*
* Carla Native Plugins * Carla Native Plugins
* Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2013-2020 Filipe Coelho <falktx@falktx.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@@ -50,11 +50,7 @@ __cdecl static void cvst_processReplacingCallback(AEffect* effect, float** input
#endif #endif


CARLA_EXPORT __cdecl CARLA_EXPORT __cdecl
#if defined(CARLA_OS_WIN) || defined(CARLA_OS_MAC)
const AEffect* VSTPluginMain(audioMasterCallback audioMaster); const AEffect* VSTPluginMain(audioMasterCallback audioMaster);
#else
const AEffect* VSTPluginMain(audioMasterCallback audioMaster) asm ("main");
#endif


CARLA_EXPORT __cdecl CARLA_EXPORT __cdecl
const AEffect* VSTPluginMain(audioMasterCallback audioMaster) const AEffect* VSTPluginMain(audioMasterCallback audioMaster)
@@ -94,6 +90,17 @@ const AEffect* VSTPluginMain(audioMasterCallback audioMaster)
return VSTPluginMainInit(effect); return VSTPluginMainInit(effect);
} }


#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
CARLA_EXPORT __cdecl
const AEffect* VSTPluginMain_asm(audioMasterCallback audioMaster) asm ("main");

CARLA_EXPORT __cdecl
const AEffect* VSTPluginMain_asm(audioMasterCallback audioMaster)
{
return VSTPluginMain(audioMaster);
}
#endif

intptr_t VSTAudioMaster(AEffect* effect, int32_t opcode, int32_t index, intptr_t value, void* ptr, float opt) intptr_t VSTAudioMaster(AEffect* effect, int32_t opcode, int32_t index, intptr_t value, void* ptr, float opt)
{ {
const audioMasterCallback audioMaster = (audioMasterCallback)((VstObject*)effect->object)->audioMaster; const audioMasterCallback audioMaster = (audioMasterCallback)((VstObject*)effect->object)->audioMaster;


source/plugin/win-def/carla-lv2_dsp+ui.def → source/plugin/symbols/carla-lv2_dsp+ui.def View File


+ 2
- 0
source/plugin/symbols/carla-lv2_dsp+ui.txt View File

@@ -0,0 +1,2 @@
lv2_descriptor
lv2ui_descriptor

+ 4
- 0
source/plugin/symbols/carla-lv2_dsp+ui.version View File

@@ -0,0 +1,4 @@
{
global: lv2_descriptor; lv2ui_descriptor;
local: *;
};

source/plugin/win-def/carla-lv2_dsp.def → source/plugin/symbols/carla-lv2_dsp.def View File


+ 1
- 0
source/plugin/symbols/carla-lv2_dsp.txt View File

@@ -0,0 +1 @@
lv2_descriptor

+ 4
- 0
source/plugin/symbols/carla-lv2_dsp.version View File

@@ -0,0 +1,4 @@
{
global: lv2_descriptor;
local: *;
};

source/plugin/win-def/carla-lv2_ui.def → source/plugin/symbols/carla-lv2_ui.def View File


+ 1
- 0
source/plugin/symbols/carla-lv2_ui.txt View File

@@ -0,0 +1 @@
lv2ui_descriptor

+ 4
- 0
source/plugin/symbols/carla-lv2_ui.version View File

@@ -0,0 +1,4 @@
{
global: lv2ui_descriptor;
local: *;
};

source/plugin/win-def/carla-native-plugin.def → source/plugin/symbols/carla-native-plugin.def View File


+ 10
- 0
source/plugin/symbols/carla-native-plugin.txt View File

@@ -0,0 +1,10 @@
carla_get_native_patchbay_plugin
carla_get_native_patchbay16_plugin
carla_get_native_patchbay32_plugin
carla_get_native_patchbay64_plugin
carla_get_native_patchbay_cv_plugin
carla_create_native_plugin_host_handle
carla_host_handle_free
carla_get_native_plugin_engine
carla_get_library_filename
carla_get_library_folder

+ 13
- 0
source/plugin/symbols/carla-native-plugin.version View File

@@ -0,0 +1,13 @@
{
global: carla_get_native_patchbay_plugin;
carla_get_native_patchbay16_plugin;
carla_get_native_patchbay32_plugin;
carla_get_native_patchbay64_plugin;
carla_get_native_patchbay_cv_plugin;
carla_create_native_plugin_host_handle;
carla_host_handle_free;
carla_get_native_plugin_engine;
carla_get_library_filename;
carla_get_library_folder;
local: *;
};

source/plugin/win-def/carla-vst.def → source/plugin/symbols/carla-vst.def View File


+ 1
- 0
source/plugin/symbols/carla-vst.txt View File

@@ -0,0 +1 @@
VSTPluginMain

+ 4
- 0
source/plugin/symbols/carla-vst.version View File

@@ -0,0 +1,4 @@
{
global: VSTPluginMain; main;
local: *;
};

Loading…
Cancel
Save