OVP Forums - A community of assistance, help, questions, and answers.
  FAQFAQ    SearchSearch      RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in
Error when compiling usingHarness example

 
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> Getting started
View previous topic :: View next topic  
Author Message
MarcoRamirez



Joined: 19 Mar 2014
Posts: 3

PostPosted: Sun Oct 16, 2016 1:19 pm    Post subject: Error when compiling usingHarness example Reply with quote

Hi, I am trying to compile the usingHarness example described in the Installation and Getting Started document. I am using the 20161005 release on a Ubuntu 16 64-bit host. When executing make in the 'module' subdirectory of the example I get the following error:

Code:

# iGen Create OP MODULE module
# Host Depending obj/Linux32/module.d
# Host Compiling Module obj/Linux32/module.o
# Host Linking Module object model.so
/usr/bin/ld: skipping incompatible /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
/opt/Imperas.20161005/ImperasLib/buildutils/Makefile.module:84: recipe for target 'model.so' failed
make: *** [model.so] Error 1


I checked the gcc_s library is installed in the /usr/lib32 directory.

Does anybody know how to fix this problem?
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1656
Location: United Kingdom

PostPosted: Tue Oct 18, 2016 1:49 am    Post subject: Reply with quote

I think that
Quote:
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/libgcc.a
indicates the use of a 64-bit host toolchain, but the OVP product (available on the OVP website) is provided only for 32-bit hosts (64-bit host support is available from Imperas).

I think that there is something incorrect in your setup. When you ran the setup did you use the -m32 flag?

Can you run Imperas/bin/report.sh which will provide some environment details.

Then please try compiling again from clean with VERBOSE=1 set on the command line so we can see exactly what commands are being issued.
Back to top
View user's profile Send private message Visit poster's website
MarcoRamirez



Joined: 19 Mar 2014
Posts: 3

PostPosted: Tue Oct 18, 2016 10:10 am    Post subject: Reply with quote

Hi, thanks for helping me out.

Yes, I used the -m32 flag. I repeated the process.

Set IMPERAS_RUNTIME variable
Code:

maanrl@Maxwell:~$ export IMPERAS_RUNTIME=OVPsim


Sourced the setup script
Code:

maanrl@Maxwell:~$ source /opt/Imperas.20161005/bin/setup.sh
Function 'setupImperas' successfully added to shell:
   Usage: setupImperas [-help] [-m32] <Installation>
           -help, Print this help
           -m32,  Run 32bit product under a 64bit OS


Ran the setup script
Code:

maanrl@Maxwell:~$ setupImperas -m32 /opt/Imperas.20161005
Info: Emulate 32Bit setup
Info: IMPERAS_ISS is undefined, defaulting to iss.exe


Went to example directory and compiled the application
Code:

maanrl@Maxwell:~/Projects/ovp/usingHarnessExe/application$ make
# Compiling application.c
# Linking application.OR1K.elf
rm application.o


Went to the module directory and run make with verbose
Code:

maanrl@Maxwell:~/Projects/ovp/usingHarnessExe/module$ make VERBOSE=1
# iGen Create OP MODULE module
igen.exe --quiet --nobanner --excludem GPT_NH --excludem GPT_UFNR \
   --single \
   --op \
   --batch  module.op.tcl \
   --writec module.c.igen.stubs \
    \
   --overwrite
# Host Depending obj/Linux32/module.d
mkdir -p obj/Linux32
gcc -MM module.c -I/opt/Imperas.20161005/ImpPublic/include/host -I/opt/Imperas.20161005/ImpProprietary/include/host -Wall -Werror -O0 -g -gdwarf-2 -m32  -L/home/maanrl/local/lib -MT obj/Linux32/module.o -MF obj/Linux32/module.d
mkdir -p obj/Linux32
# Host Compiling Module obj/Linux32/module.o
gcc -c -o obj/Linux32/module.o module.c -I/opt/Imperas.20161005/ImpPublic/include/host -I/opt/Imperas.20161005/ImpProprietary/include/host -Wall -Werror -O0 -g -gdwarf-2 -m32
mkdir -p .
# Host Linking Module object model.so
gcc -shared -o model.so obj/Linux32/module.o -L/opt/Imperas.20161005/bin/Linux32 -lRuntimeLoader -m32 -L/home/maanrl/local/lib
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
/opt/Imperas.20161005/ImperasLib/buildutils/Makefile.module:84: recipe for target 'model.so' failed
make: *** [model.so] Error 1


Then I ran the report script
Code:

maanrl@Maxwell:~/Projects/ovp/usingHarnessExe/module$ bash /opt/Imperas.20161005/bin/report.sh

#
# Environment
#
Linux Maxwell 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

#
# Test IMPERAS_HOME
#
IMPERAS_HOME = /opt/Imperas.20161005

#
# Test IMPERAS* Environment variables
#
IMPERAS_M32=1
IMPERAS_UNAME=Linux
IMPERAS_ISS=iss.exe
IMPERAS_SHRSUF=so
IMPERAS_RUNTIME=OVPsim
IMPERAS_ARCH=Linux32
IMPERAS_VLNV=/opt/Imperas.20161005/lib/Linux32/ImperasLib
IMPERAS_HOME=/opt/Imperas.20161005

#
# Test LM_LICENSE_FILE Environment variable
#

#
# Test IMPERASD_LICENSE_FILE Environment variable
#

#
# Test PATH Environment variable
#
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/maanrl/local/bin:/opt/soft64/mips/bin:/opt/tce-1.13/bin:/opt/Imperas.20161005/bin/Linux32

#
# Test LD_LIBRARY_PATH Environment variable
#
LD_LIBRARY_PATH=:/home/maanrl/local/lib:/opt/Imperas.20161005/bin/Linux32

#
# Test /opt/Imperas.20161005/InstallLog.txt
#
Installed 20161005.0 OVPsim Demo_Processors
Installed 20161005.0 OVPsim Imperas.harness
Installed 20161005.0 OVPsim Imperas.iGen
Installed 20161005.0 OVPsim Imperas.iss
Installed 20161005.0 OVPsim Nios_II.model
Installed 20161005.0 OVPsim Nios_II.source.model
Installed 20161005.0 OVPsim OVP.httpvis
Installed 20161005.0 OVPsim OVPsim
Installed 20161005.0 OVPsim OVPsim.RunTime
Installed 20161005.0 OVPsim OVPsim.igui
Installed 20161005.0 OVPsim OVPsim.iss
Installed 20161005.0 OVPsim arc.model
Installed 20161005.0 OVPsim arm-aarch64-none-elf.gdb
Installed 20161005.0 OVPsim arm-arm-none-eabi.gdb
Installed 20161005.0 OVPsim arm.model
Installed 20161005.0 OVPsim armm.model
Installed 20161005.0 OVPsim eGui
Installed 20161005.0 OVPsim imp-arc.gdb
Installed 20161005.0 OVPsim imp-m32c.gdb
Installed 20161005.0 OVPsim imp-microblaze.gdb
Installed 20161005.0 OVPsim imp-mips.gdb
Installed 20161005.0 OVPsim imp-nios2.gdb
Installed 20161005.0 OVPsim imp-powerpc.gdb
Installed 20161005.0 OVPsim imp-pse.gdb
Installed 20161005.0 OVPsim imp-rl78.gdb
Installed 20161005.0 OVPsim imp-v850.gdb
Installed 20161005.0 OVPsim m16c.model
Installed 20161005.0 OVPsim m16c.source.model
Installed 20161005.0 OVPsim microblaze.model
Installed 20161005.0 OVPsim microblaze.source.model
Installed 20161005.0 OVPsim mips32.model
Installed 20161005.0 OVPsim mips64.model
Installed 20161005.0 OVPsim or1k.gdb
Installed 20161005.0 OVPsim or1k.model
Installed 20161005.0 OVPsim or1k.source.model
Installed 20161005.0 OVPsim powerpc32.model
Installed 20161005.0 OVPsim powerpc32.source.model
Installed 20161005.0 OVPsim rh850.model
Installed 20161005.0 OVPsim rh850.source.model
Installed 20161005.0 OVPsim rl78.model
Installed 20161005.0 OVPsim rl78.source.model
Installed 20161005.0 OVPsim updatecheck
Installed 20161005.0 OVPsim v850.model
Installed 20161005.0 OVPsim v850.source.model
Installed 20161005.0 or1k.toolchain or1k.toolchain

#
# Test make
#
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

#
# Test gcc
#
gcc (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


I also checked for the 32-bit compatibility libraries and they seem to be installed
Code:

maanrl@Maxwell:~$ sudo apt-get install lib32z1 lib32ncurses5  libbz2-1.0:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
lib32ncurses5 is already the newest version (6.0+20160213-1ubuntu1).
lib32z1 is already the newest version (1:1.2.8.dfsg-2ubuntu4).
libbz2-1.0:i386 is already the newest version (1.0.6-8).
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
Back to top
View user's profile Send private message
LeeMoore
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 635

PostPosted: Mon Oct 24, 2016 5:54 am    Post subject: Reply with quote

This looks like an issue with the toolchain you have installed.
Did you build this yourself ? I notice it is installed under /usr/local

please try compiling a simple 'hello world' application using the -m32 flag to the compiler to see if it can build 32 bit executables

Thx
Lee
Back to top
View user's profile Send private message
MarcoRamirez



Joined: 19 Mar 2014
Posts: 3

PostPosted: Wed Oct 26, 2016 8:35 am    Post subject: Reply with quote

It was a conflict with a research tool I installed months ago, after removing the tool and reinstalling gcc OVPsim seems to be working fine.

Thanks for your help
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> Getting started All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Information regarding OVP © 2008-2022 Imperas Software