New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU g++ / Mentor sscom - Linking Issues #19

Open
leoheck opened this Issue Aug 11, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@leoheck
Copy link
Owner

leoheck commented Aug 11, 2016

Não sei por qual motivo, mas Ruaro, gnomo, Andre não estão conseguindo compilar SystemC mais:

Quando ocorre problema:

  • Ao compilar a HeMPS com Systemc tanto usando o g++ quanto o Mentor Questa 10.4a
  • O Questa usa gcc-4.7.4

Não funcionan na maquina do Ruaro, LHeck, Gnomo (gaphl14, gaphl12, gaphl56)

  • Ubuntu 16.04
  • g++ (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413 [Ruaro]
  • g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 [LHeck, Gnomo]
  • GNU ld (GNU Binutils for Ubuntu) 2.26 [Ruaro]
  • GNU ld (GNU Binutils for Ubuntu) 2.26.1 [LHeck, Gnomo ]
  • ldd (Ubuntu GLIBC 2.23-0ubuntu3) 2.23

Maquina que estão funcionando

  • gaphl09 - fochi
    • Ubuntu 12.04
    • g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
    • GNU ld (GNU Binutils for Ubuntu) 2.22
    • ldd (Ubuntu EGLIBC 2.15-0ubuntu10.15) 2.15
  • gaphl54 - andre
    • Ubuntu 14.04
    • g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
    • GNU ld (GNU Binutils for Ubuntu) 2.24
    • ldd (Ubuntu EGLIBC 2.19-0ubuntu6.7) 2.19

Compilando com o Questa (na verdade o problema é na hora de juntar os objetos)

sccom -link 
Start time: 18:08:26 on Aug 15,2016

QuestaSim-64 sccom 10.4a compiler 2015.03 Mar 24 2015

/soft64/mentor/ferramentas/questa/10.4a/questasim/gcc-4.7.4-linux_x86_64/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.4/ld: /lib/crti.o: unrecognized relocation (0x2a) in section `.init'
/soft64/mentor/ferramentas/questa/10.4a/questasim/gcc-4.7.4-linux_x86_64/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.4/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
** Error: (sccom-6126) Linking failed. Creation of work/systemc.so failed.
End time: 18:08:26 on Aug 15,2016, Elapsed time: 0:00:00
Errors: 2, Warnings: 0

Compilando com o g++ (na verdade o problema é na hora de juntar os objetos)

'Generating HeMPS ...'
g++ -I./ -o HeMPS queue.o switchcontrol.o router_cc.o mlite_cpu.o dmni.o ram.o pe.o hemps.o test_bench.o -L. -Linc/. -lsystemc
pe.o: In function `sc_core::sc_in<sc_dt::sc_uint<32> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:304: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
pe.o: In function `sc_core::sc_inout<sc_dt::sc_uint<30> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:1165: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
pe.o: In function `sc_core::sc_inout<sc_dt::sc_uint<32> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:1165: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
pe.o: In function `sc_dt::sc_uint_base::print(std::ostream&) const':
/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const'
/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const'
/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const'
/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const'
/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const'
pe.o:/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: more undefined references to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const' follow
test_bench.o: In function `sc_core::sc_inout<sc_dt::sc_uint<4> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:1165: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
test_bench.o: In function `sc_core::sc_inout<sc_dt::sc_uint<15> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:1165: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
test_bench.o: In function `sc_core::sc_inout<sc_dt::sc_uint<8> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:1165: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
test_bench.o: In function `sc_core::sc_in<sc_dt::sc_uint<4> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:304: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
test_bench.o: In function `sc_core::sc_in<sc_dt::sc_uint<30> >::end_of_elaboration()':
/soft64/util/accelera/systemc/2.3.1/include/sysc/communication/sc_signal_ports.h:304: undefined reference to `sc_core::sc_trace(sc_core::sc_trace_file*, sc_dt::sc_uint_base const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
test_bench.o: In function `sc_dt::sc_uint_base::print(std::ostream&) const':
/soft64/util/accelera/systemc/2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to `sc_dt::sc_uint_base::to_string[abi:cxx11](sc_dt::sc_numrep, bool) const'
collect2: error: ld returned 1 exit status
makefile:35: recipe for target 'HeMPS' failed

Alguns reports relacionados:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808205
dirkvdb/ps3netsrv--#13

@leoheck

This comment has been minimized.

Copy link
Owner Author

leoheck commented Aug 12, 2016

Trocando o ld que vem com o Questa 4.7.4 pelo que vem com que tem no Ubuntu 16.04, o passo de link funcionou. Como trocar o toolchain/binutils do Questa de forma elegnate e permanente, incluindo versões futuras?

@leoheck

This comment has been minimized.

Copy link
Owner Author

leoheck commented Aug 15, 2016

Bom, pra ficar claro, vou reportar o que eu fiz para resolver o problema temporáriamente nas duas abordagens. Estou referenciando a Hemps, onde isso foi observado GaphGroup/hemps#1

Acho que os problemas com q++ e questa podem não estar relacionados. Pelo menos, as soluções foram diferentes.

1 - Arrumando a compilação usando g++

Aqui eu simplesmente adicionei um define que estava faltando. Isso pode ser feito por linha de comando, como por exemplo:

g++ -D_GLIBCXX_USE_CXX11_ABI=0

2 - Arrumando a compilação do Mentor Questa 10.4a [WORKAROUND]

Veja a solução mais elegante na próxima postagem

Aqui eu consegui fazer funcionar usando o ld da máquina do usuário ao invés do ld que vem com o Questa

cd /soft64/mentor/ferramentas/questa/10.4a/questasim/
cp -r gcc-4.7.4-linux_x86_64 gcc-4.7.4-linux_x86_64-mod
cd gcc-4.7.4-linux_x86_64-mod
rm -rf libexec/gcc/x86_64-unknown-linux-gnu/4.7.4/ld
ln -ls /usr/bin/ld libexec/gcc/x86_64-unknown-linux-gnu/4.7.4/ld

Na hora de compilar use a nova pasta modificada:

sscom -cpppath /soft64/mentor/ferramentas/questa/10.4a/questasim/gcc-4.7.4-linux_x86_64-mod-lheck/bin/g++

@leoheck leoheck changed the title [CAD] SystemC Issue [CAD] SystemC Linking Issue Aug 15, 2016

@leoheck leoheck changed the title [CAD] SystemC Linking Issue [CAD] G++ Linking Issue (on Ubuntu 16.04) Aug 16, 2016

@leoheck

This comment has been minimized.

Copy link
Owner Author

leoheck commented Aug 16, 2016

Boa, consegui fazer funcionar com o Questa sem gabiarra. Funcionou no meu Ubuntu 16.04

Adicionar na compilação e link essa flag:

-B/usr/bin/

Isso vai instruir o gcc a usar o linker da máquina que está mais atualizado com relação a libc.
O gcc do Questa ainda vai estar sendo usado.

@leoheck leoheck changed the title [CAD] G++ Linking Issue (on Ubuntu 16.04) g++ Linking Issue Aug 21, 2016

@leoheck leoheck changed the title g++ Linking Issue Mentos sscom and GNU g++ Linking Issues Aug 21, 2016

@leoheck leoheck changed the title Mentos sscom and GNU g++ Linking Issues Mentor sscom and GNU g++ Linking Issues Aug 21, 2016

@leoheck leoheck changed the title Mentor sscom and GNU g++ Linking Issues GNU g++ / Mentor sscom - Linking Issues Nov 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment