From: Emese Revfy <re.emese@gmail.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
PaX Team <pageexec@freemail.hu>,
Brad Spengler <spender@grsecurity.net>,
kernel-hardening@lists.openwall.com,
Michal Marek <mmarek@suse.com>, Kees Cook <keescook@chromium.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Fengguang Wu <fengguang.wu@intel.com>,
Dmitry Vyukov <dvyukov@google.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
David Brown <david.brown@linaro.org>
Subject: Re: [PATCH v7 1/6] Shared library support
Date: Thu, 5 May 2016 20:40:08 +0200 [thread overview]
Message-ID: <20160505204008.863221b34f9b7c6111e4e7f9@gmail.com> (raw)
In-Reply-To: <CAK7LNAT7eOHQ94qscQgTDXTBi+NZsE4SQzw=h3xcK9PCRigFag@mail.gmail.com>
On Wed, 4 May 2016 13:09:05 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> Hi Emese,
>
>
> 2016-05-04 6:29 GMT+09:00 Emese Revfy <re.emese@gmail.com>:
> > On Tue, 3 May 2016 11:00:56 +0900
> > Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> >
> > Hi,
> >
> >> # Compile .c file, create position independent .o file
> >> # host-cxxshobjs -> .o
> >> quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@
> >> cmd_host-cxxshobjs = $(HOSTCXX) $(hostcxx_flags) -fPIC -c -o $@ $<
> >> $(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE
> >> $(call if_changed_dep,host-cxxshobjs)
> >>
> >>
> >>
> >>
> >> We generally use HOSTCC to compile *.c files,
> >> and HOSTCXX to compile *.cc files.
> >>
> >>
> >> But, here, you mention to use HOSTCXX to compile .c files
> >> such as cyc_complexity_plugin.c, sancov_plugin.c, etc.
> >>
> >> This is not straight-forward. It is worthwhile to comment the reason.
> >
> > I wrote a comment about it here:
> > https://github.com/ephox-gcc-plugins/gcc-plugins_linux-next/commit/74f6343a7f13c071e00c417332051e25f15009ea
> >
>
>
>
> +# Note that plugin capable gcc versions can be either C or C++ based
> +# therefore plugin source files have to be compilable in both C and C++ mode.
> +# This is why a C++ compiler is invoked on a .c file.
>
> Thanks.
>
> Please let me confirm if I understood correctly.
>
>
> We generally have to do something with the name-space conflict
> (with 'extern "C"') in the mixture of C/C++.
>
> Depending on the GCC version,
> GCC-plugin-related libraries could be built for C or C++.
>
> So, we need to check the GCC version and choose correct one
> from C or C++.
The plugin source files have to be compilable by both versions
because gcc versions 4.5 and 4.6 are compiled by a C compiler,
gcc-4.7 can be compiled by a C or a C++ compiler,
and versions 4.8+ can only be compiled by a C++ compiler.
--
Emese
next prev parent reply other threads:[~2016-05-05 18:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 18:19 [PATCH v7 0/6] Introduce GCC plugin infrastructure Emese Revfy
2016-04-22 18:21 ` [PATCH v7 1/6] Shared library support Emese Revfy
2016-05-02 5:03 ` Masahiro Yamada
2016-05-02 17:56 ` Emese Revfy
2016-05-03 2:00 ` Masahiro Yamada
2016-05-03 21:29 ` Emese Revfy
2016-05-04 4:09 ` Masahiro Yamada
2016-05-05 18:40 ` Emese Revfy [this message]
2016-05-03 2:06 ` Masahiro Yamada
2016-05-03 21:25 ` Emese Revfy
2016-05-05 18:43 ` Emese Revfy
2016-04-22 18:22 ` [PATCH v7 2/6] GCC plugin infrastructure Emese Revfy
2016-05-02 5:07 ` Masahiro Yamada
2016-05-02 17:59 ` [kernel-hardening] " Emese Revfy
2016-05-11 11:24 ` Michal Marek
2016-05-12 15:04 ` Emese Revfy
2016-04-22 18:23 ` [PATCH v7 3/6] The GCC plugin infrastructure supports the arm and arm64 architectures too Emese Revfy
2016-05-02 5:08 ` Masahiro Yamada
2016-04-22 18:24 ` [PATCH v7 4/6] Add Cyclomatic complexity GCC plugin Emese Revfy
2016-05-02 5:09 ` Masahiro Yamada
2016-04-22 18:26 ` [PATCH v7 5/6] Documentation for the GCC plugin infrastructure Emese Revfy
2016-05-02 5:10 ` Masahiro Yamada
2016-05-02 18:07 ` Emese Revfy
2016-04-22 18:27 ` [PATCH v7 6/6] Add sancov plugin Emese Revfy
2016-04-22 18:51 ` Dmitry Vyukov
2016-04-26 20:40 ` [PATCH v7 0/6] Introduce GCC plugin infrastructure Kees Cook
2016-04-27 1:40 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160505204008.863221b34f9b7c6111e4e7f9@gmail.com \
--to=re.emese@gmail.com \
--cc=david.brown@linaro.org \
--cc=dvyukov@google.com \
--cc=fengguang.wu@intel.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mmarek@suse.com \
--cc=pageexec@freemail.hu \
--cc=spender@grsecurity.net \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox