westerndigitalcorporation / swerv-ISS

Western Digital’s Open Source RISC-V SweRV Instruction Set Simulator
201 stars 41 forks source link

Compilation Failure due to optimizations on various compilers #14

Closed AmeyaVS closed 5 years ago

AmeyaVS commented 5 years ago

Due to introduction of template method in Core/HartConfig class in this commit: https://github.com/westerndigitalcorporation/swerv-ISS/commit/882de25a8be2f7944f22205671c6d4a2239bc75d#diff-fdf14d2fb8fede41af40647977544f4eR633

Compilation fails with undefined references of following methods:

bool WdRiscv::HartConfig::applyConfig<unsigned int>(WdRiscv::Hart<unsigned int>&, bool) const
bool WdRiscv::HartConfig::finalizeCsrConfig<unsigned int>(std::vector<WdRiscv::Hart<unsigned int>*, std::allocator<WdRiscv::Hart<unsigned int>*> >&) const
bool WdRiscv::HartConfig::applyMemoryConfig<unsigned int>(WdRiscv::Hart<unsigned int>&, bool) const
bool WdRiscv::HartConfig::applyConfig<unsigned long>(WdRiscv::Hart<unsigned long>&, bool) const
bool WdRiscv::HartConfig::finalizeCsrConfig<unsigned long>(std::vector<WdRiscv::Hart<unsigned long>*, std::allocator<WdRiscv::Hart<unsigned long>*> >&) const
bool WdRiscv::HartConfig::applyMemoryConfig<unsigned long>(WdRiscv::Hart<unsigned long>&, bool) const

The private static method in HartConfig class does not help alleviate this issue. As compiler with varying optimization flag inline/removes the API's from the HartConfig.cpp.o object file.

The pull request #13 Fixes the issue.

jrahmeh commented 5 years ago

Ameya,

Sorry about that. My bad. I made a release from the wrong working area. Please pull and try again. Problem should be fixed.

Joe

On Fri, Sep 20, 2019 at 12:27 PM Ameya Vikram Singh < notifications@github.com> wrote:

Due to introduction of template method in Core/HartConfig class in this commit: 882de25#diff-fdf14d2fb8fede41af40647977544f4eR633 https://github.com/westerndigitalcorporation/swerv-ISS/commit/882de25a8be2f7944f22205671c6d4a2239bc75d#diff-fdf14d2fb8fede41af40647977544f4eR633

Compilation fails with undefined references of following methods:

bool WdRiscv::HartConfig::applyConfig(WdRiscv::Hart&, bool) const bool WdRiscv::HartConfig::finalizeCsrConfig(std::vector<WdRiscv::Hart, std::allocator<WdRiscv::Hart> >&) const bool WdRiscv::HartConfig::applyMemoryConfig(WdRiscv::Hart&, bool) const bool WdRiscv::HartConfig::applyConfig(WdRiscv::Hart&, bool) const bool WdRiscv::HartConfig::finalizeCsrConfig(std::vector<WdRiscv::Hart, std::allocator<WdRiscv::Hart> >&) const bool WdRiscv::HartConfig::applyMemoryConfig(WdRiscv::Hart&, bool) const

The private static method in HartConfig class does not help alleviate this issue. As compiler with varying optimization flag inline/removes the API's from the HartConfig.cpp.o object file.

The pull request #13 https://github.com/westerndigitalcorporation/swerv-ISS/pull/13 Fixes the issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/westerndigitalcorporation/swerv-ISS/issues/14?email_source=notifications&email_token=AASHQXYO32Z5CURV37NTNVTQKUBWTA5CNFSM4IYZQFGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HMXOR2Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AASHQX4323PTXDAANM7SI6TQKUBWTANCNFSM4IYZQFGA .

jrahmeh commented 5 years ago

Compilation issue fixed.