From 1271945aa9144090f9c74c1915c4c1d431344df3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 4 Jun 2020 14:13:46 +0100 Subject: [PATCH 1/2] cc: Add -fPIC -shared to -DCFLAGS rather than in the plugin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the output of ‘nbdkit cc --dump-plugin’ so it matches the documentation, and it's slightly cleaner than doing this munging in the cc plugin source code. Fixes: commit a4339e3c3c17d8b95ddf0b20cf015de5078620ec --- plugins/cc/Makefile.am | 2 +- plugins/cc/cc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/cc/Makefile.am b/plugins/cc/Makefile.am index 6b02e891..d7e709f8 100644 --- a/plugins/cc/Makefile.am +++ b/plugins/cc/Makefile.am @@ -42,7 +42,7 @@ nbdkit_cc_plugin_la_SOURCES = \ nbdkit_cc_plugin_la_CPPFLAGS = \ -DCC="\"$(CC)\"" \ - -DCFLAGS="\"$(CFLAGS)\"" \ + -DCFLAGS="\"$(CFLAGS) -fPIC -shared\"" \ -I$(top_srcdir)/common/utils \ -I$(top_srcdir)/include \ -I. \ diff --git a/plugins/cc/cc.c b/plugins/cc/cc.c index 2139cf62..e55c5e76 100644 --- a/plugins/cc/cc.c +++ b/plugins/cc/cc.c @@ -53,7 +53,7 @@ static bool unlink_on_exit = false; /* C compiler and flags. */ static const char *cc = CC; -static const char *cflags = CFLAGS " -fPIC -shared"; +static const char *cflags = CFLAGS; static const char *extra_cflags; /* List of parameters for the subplugin. */ -- 2.25.0