[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAT7eOHQ94qscQgTDXTBi+NZsE4SQzw=h3xcK9PCRigFag@mail.gmail.com>
Date: Wed, 4 May 2016 13:09:05 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Emese Revfy <re.emese@...il.com>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
PaX Team <pageexec@...email.hu>,
Brad Spengler <spender@...ecurity.net>,
kernel-hardening@...ts.openwall.com,
Michal Marek <mmarek@...e.com>,
Kees Cook <keescook@...omium.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Fengguang Wu <fengguang.wu@...el.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
David Brown <david.brown@...aro.org>
Subject: Re: [PATCH v7 1/6] Shared library support
Hi Emese,
2016-05-04 6:29 GMT+09:00 Emese Revfy <re.emese@...il.com>:
> On Tue, 3 May 2016 11:00:56 +0900
> Masahiro Yamada <yamada.masahiro@...ionext.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++.
Am I right?
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists