-
Notifications
You must be signed in to change notification settings - Fork 22
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
fPIC errors #1
Comments
It looks like '__idp' should have been defined in the object cvc.o.
(when I compiled it, that is where it was)
On line 1078 of src/cvc.c, could you change:
t_midat *__idp;
to
t_midat *__idp = NULL;
?
(this will push it to the data section instead of BSS/Common)
Also, if you could do:
nm cvc.o | grep __idp
?
I get:
00000004 C __idp
00000000 B __idpdat_areasp
thanks
jca
…On Thu, May 4, 2017 at 11:57 AM, nachiket ***@***.***> wrote:
I'm trying to install CVC on Ubuntu 16.10 but get the following errors on
make -f makefile.cvc64
gcc -pipe -Wall -I../pli_incs -fPIC -D__RHEL6X__ -fno-strength-reduce -fomit-frame-pointer -O2 -export-dynamic dig_main.o cvc.o v_src.o v_src2.o v_src3.o v_fx.o v_genfx.o v_fx2.o v_fx3.o v_cnv.o v_ex.o v_ex2.o v_ex3.o v_ex4.o v_trch.o v_del.o v_sdf.o v_prp.o v_prp2.o v_sim.o v_dbg.o v_dbg2.o v_cvr.o v_ms.o v_tf.o v_acc.o v_vpi.o v_vpi2.o v_vpi3.o v_dpi.o v_bbgen.o v_bbgen2.o v_bbgen3.o v_bbopt.o v_cvcms.o v_asmlnk.o v_aslib.o v_regasn.o v_cvcrt.o v_xprop.o fstapi.o fastlz.o lz4.o \
-lm -ldl -lpthread -lz cvclib_str.o exe_main_str.o -o cvc64
/usr/bin/ld: v_sim.o: relocation R_X86_64_32S against undefined symbol `__idp' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: v_aslib.o: relocation R_X86_64_32S against undefined symbol `__idp' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.27 internal error, aborting at ../../bfd/elf64-x86-64.c:4580 in elf_x86_64_relocate_section
I added -fPIC to the compile flags but to no avail.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABvY-EzkxrAS7394sxd2qPcIISLplSaVks5r2h-NgaJpZM4NRFLy>
.
|
Doesn't seem to have helped. Still fails at the relocation error. (Before NULL init value) (After NULL init value) |
The error is caused by the use of __idp from inline asm, such as this line: If I change it to: I have not tested this yet. |
I have a feeling that the compilation model has changed and that code and data may be farther apart in address space than in earlier gcc/glibc, causing this relocation to fail. |
Commit a6215a8 is my first attempt to fix this. At least it compiles now. |
I did try a6125a8 and it does indeed compile cvc on Ubuntu 17..04 zesty. The executable errors out though. This is a pretty fresh VM install. A friend reports building and running cvc64 from the basic sources on Ubuntu but even trying his executable errors out on my system. Errors like this ... which look very similar to the original source compile errors. I'm a hardware guy but I'm assuming this something silly with libs? Copyright (c) 1991-2014 Tachyon Design Automation Corp. |
Phil, just roll back to Ubuntu 16 and you are good to go. Well, you may need |
Hi Phil, It turns out the code is not very portable. It uses some inline assembly language that appears to depend on the details of the calling convention, among other things. I'm not sure what changed in the compiler or libraries between Ubuntu 16.04 and 16.10 to break it. I had enough time to get the code to compile but I don't know the x86 application calling convention well enough to debug it. |
Hi Jamey ... It was indeed the later versions of Ubuntu that were the problem. The stock Tachyon source builds fine on 16.04, as you suggest. In case it helps anyone else on a stock install, you will need to install zlib1g-dev and also copy hexasm (which is small binary built by the make file) to somewhere like /usr/local/bin and run the make a second time. |
Hi All, |
I has similar issues on Debian Stretch. The problem is that GCC now uses -pie by default, and to get back to the previous behavior you need to add -no-pie to the GCC command line. First, I was able to build cvc (cvc64) on Debian Stretch by adding -no-pie to CFLAGS in makefile.cvc (makefile.cvc64):
This works to compile the original cvc source, without the a6125a8 patch. However, running cvc (cvc64) still gave errors, because it is calling GCC under the covers. So, second, I edited src/v_asmlnk.c to add -no-pie in a few places, and now things work! I don't know if it's needed in both of these places, but here's what I changed:
|
Awesome! I would be delighted to accept a pull request, or I can make the changes. |
Thanks to Julie Schwartz (quark17) for submitting the fix to this problem! Fixes issue #1
I ran into this problem after upgrading to Ubuntu 18.04. I have also run into similar problems with GHDL. cvc64 no longer worked, presumably at the stage where it calls GCC, because the default is now to build a PIE. I immediately assumed that I just needed to recompile cvc64 with the latest GCC; of course this just fell over. I tried adding A quick search found this repo, many thanks for this, I would never have found the fix in the BUT .. the compile of cvc64 still fell over. However, just changing the |
I had this same problem on Linux Mint 19. I tried pulling the branch "asm-reference-fix" and building. This built, but then the executable failed with this output: OSS_CVC_7.00b-x86_64-rhel6x of 07/07/14 (Linux-elf). CVC compilation 0.3 seconds elapsed. EXECUTABLE SAVED TO 'cvcsim'. End of OSS_CVC_7.00b-x86_64-rhel6x at Thu Jan 3 21:11:41 2019 (elapsed 0.4 seconds). So I researched a bit and found this seemingly related link: I switched back to the master branch, and as per the recommendation there, I added "-fno-pie -no-pie" to CVCCFLGS in makefile.cvc64. On my system this now builds and runs correctly. |
I'm trying to install CVC on Ubuntu 16.10 but get the following errors on make -f makefile.cvc64
I added -fPIC to the compile flags but to no avail.
The text was updated successfully, but these errors were encountered: