Hi Kirk,

The problem is that protobuf relies on the fact that undefined
preprocessor symbols are expanded by default to 0. This is causing
problems for gem5 as for sanity we force the compiler to warn for
undefined symbols.

I posted a workaround on the reviewboard
http://reviews.gem5.org/r/3779/ but ultimately that's probably
something that should be taken with the protobuf developers. It would
be good to take this matter with the protobuf developers as well,
maybe defining PROTOBUF_INLINE_NOT_IN_HEADERS would be a safer
approach.

Nikos

On 9 January 2017 at 08:47, Andreas Hansson <[email protected]> wrote:
> Hi Kritik,
>
> Thanks for all the diligence. To me this sounds like an issue in the
> protobuf headers, do you not think so?
>
> Andreas
>
>
> On 06/01/2017, 17:09, "gem5-dev on behalf of kritik bhimani"
> <[email protected] on behalf of [email protected]> wrote:
>
>>I got the following as error after doing a fresh clone and fresh build in
>>the following case for RISCV . The error also persist while building for
>>X86 and ARM
>>scons build/RISCV/gem5.opt -j4
>>
>>In file included from build/RISCV/mem/probes/mem_trace.cc:46:0:
>>build/RISCV/proto/packet.pb.h:324:6: error:
>>"PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
>> #if !PROTOBUF_INLINE_NOT_IN_HEADERS
>>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>cc1plus: all warnings being treated as errors
>>scons: *** [build/RISCV/mem/probes/mem_trace.o] Error 1
>>scons: building terminated because of errors.
>>
>>The above error can be rectified by making the following changes in
>>SConstruct file in the root of repo
>>
>>@@ -652,7 +652,7 @@
>>     # Enable -Wall and -Wextra and then disable the few warnings that
>>     # we consistently violate
>>     main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra',
>>-                         '-Wno-sign-compare', '-Wno-unused-parameter'])
>>+                         '-Wno-sign-compare',
>>'-Wno-unused-parameter','-DPROTOBUF_INLINE_NOT_IN_HEADERS=0'])
>>     # We always compile using C++11
>>     main.Append(CXXFLAGS=['-std=c++11'])
>>
>>For more context on the above error
>>http://stackoverflow.com/questions/34474091/protobuf-inline-not-in-headers
>>/34485004#34485004
>>
>>https://github.com/Open-Transactions/opentxs/issues/647
>>
>>I request to please verify the above changes by compiling it on Ubuntu
>>16.10 and make the appropriate changes to SConscript since it might save
>>some time for new non MAC users.
>>
>>I also checked that version of libprotobuf-dev and other associated
>>packages installed on my system is the latest from
>>https://launchpad.net/ubuntu/+source/protobuf
>>_______________________________________________
>>gem5-dev mailing list
>>[email protected]
>>http://m5sim.org/mailman/listinfo/gem5-dev
>
> IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium. Thank you.
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to