www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Dynamic library

reply Chris <wendlec tcd.ie> writes:
I followed these steps:

https://dlang.org/dll-linux.html#dso7

What I get is this error:

libphobos2.so: file format not recognized; treating as linker 
script

I don't know why it is not recognized. Any ideas?
Apr 11 2016
parent reply Chris <wendlec tcd.ie> writes:
On Monday, 11 April 2016 at 11:42:22 UTC, Chris wrote:
 I followed these steps:

 https://dlang.org/dll-linux.html#dso7

 What I get is this error:

 libphobos2.so: file format not recognized; treating as linker 
 script

 I don't know why it is not recognized. Any ideas?
For the record, I fixed it by changing the contents of libphobos2.so from libphobos2.so.069.2 [or whatever] to GROUP (libphobos2.so.0.69.2)
Apr 11 2016
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 11 April 2016 at 13:40:14 UTC, Chris wrote:
 For the record, I fixed it by changing the contents of 
 libphobos2.so from
How did you do that btw? The file there should really just be a link to some binary file, maybe it got mangled in copying at some point.
Apr 11 2016
parent reply Chris <wendlec tcd.ie> writes:
On Monday, 11 April 2016 at 13:45:42 UTC, Adam D. Ruppe wrote:
 On Monday, 11 April 2016 at 13:40:14 UTC, Chris wrote:
 For the record, I fixed it by changing the contents of 
 libphobos2.so from
How did you do that btw? The file there should really just be a link to some binary file, maybe it got mangled in copying at some point.
Turns out that it was due to dvm (the D version manager). Somehow the libraries (in linux/lib64/) are not unzipped properly when dvm installs a version of D/dmd. I unzipped them manually and now it works without changing "libphobos2.so" as it is now recognizes as a "link to libphobos2.so.0.xx.x". In the dvm installation libphobos2.so is recognized as "shared library" while it is only a line of text (interpreted as linker script).
Apr 11 2016
parent reply Chris <wendlec tcd.ie> writes:
I wanted to test, if I could use D with JNA (Java Native Access). 
I get this error message:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fd24ab66074, pid=15733, 
tid=140541714827008
#
# JRE version: OpenJDK Runtime Environment (8.0_66-b17) (build 
1.8.0_66-internal-b17)
# Java VM: OpenJDK 64-Bit Server VM (25.66-b17 mixed mode 
linux-amd64 compressed oops)
# Problematic frame:
# C  [libphobos2.so.0.69+0x467074]  _d_dso_registry+0x59c

libphobos is a "problematic frame".
Apr 11 2016
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2016-04-11 at 14:15 +0000, Chris via Digitalmars-d-learn wrote:
 I wanted to test, if I could use D with JNA (Java Native Access).=C2=A0
 I get this error message:
=20
 # A fatal error has been detected by the Java Runtime Environment:
 #
 #=C2=A0=C2=A0SIGSEGV (0xb) at pc=3D0x00007fd24ab66074, pid=3D15733,=C2=A0
 tid=3D140541714827008
 #
 # JRE version: OpenJDK Runtime Environment (8.0_66-b17) (build=C2=A0
 1.8.0_66-internal-b17)
 # Java VM: OpenJDK 64-Bit Server VM (25.66-b17 mixed mode=C2=A0
 linux-amd64 compressed oops)
 # Problematic frame:
 # C=C2=A0=C2=A0[libphobos2.so.0.69+0x467074]=C2=A0=C2=A0_d_dso_registry+0=
x59c
=20
 libphobos is a "problematic frame".
Did you solve this problem? Does it go away using a newer JDK, e.g. 8_77? Have you tried the Oracle or Azul builds? If you have a small project you can send me that exhibits the problem for you, I can take a look at it. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Apr 12 2016
next sibling parent Chris <wendlec tcd.ie> writes:
On Tuesday, 12 April 2016 at 10:11:27 UTC, Russel Winder wrote:
 On Mon, 2016-04-11 at 14:15 +0000, Chris via 
 Digitalmars-d-learn wrote:
 I wanted to test, if I could use D with JNA (Java Native 
 Access).
 I get this error message:
 
 # A fatal error has been detected by the Java Runtime 
 Environment:
 #
 #  SIGSEGV (0xb) at pc=0x00007fd24ab66074, pid=15733,
 tid=140541714827008
 #
 # JRE version: OpenJDK Runtime Environment (8.0_66-b17) (build
 1.8.0_66-internal-b17)
 # Java VM: OpenJDK 64-Bit Server VM (25.66-b17 mixed mode
 linux-amd64 compressed oops)
 # Problematic frame:
 # C  [libphobos2.so.0.69+0x467074]  _d_dso_registry+0x59c
 
 libphobos is a "problematic frame".
Did you solve this problem? Does it go away using a newer JDK, e.g. 8_77? Have you tried the Oracle or Azul builds? If you have a small project you can send me that exhibits the problem for you, I can take a look at it.
I haven't solved the problem yet. I'll try 8_77, if I can get it for Ubuntu (which I use at work). It is not even a project yet, just a "Hello, world!" kind of test. I guess I got it wrong somehow when I compiled / linked the D .so file. I'll have another look and if I cannot get it to work I'll send you the files. Thanks for the offer.
Apr 12 2016
prev sibling parent Chris <wendlec tcd.ie> writes:
On Tuesday, 12 April 2016 at 10:11:27 UTC, Russel Winder wrote:
 Did you solve this problem?

 Does it go away using a newer JDK, e.g. 8_77?

 Have you tried the Oracle or Azul builds?

 If you have a small project you can send me that exhibits the 
 problem for you, I can take a look at it.
I could get it to work with 8_77. However, I get this message ("12" is the result I want): ------------- 12 pure virtual method called terminate called without an active exception Aborted (core dumped) ------------- As soon as I use any phobos relates stuff in the module, I get this error (libpthread.so is the issue): ------------------------ # JRE version: Java(TM) SE Runtime Environment (8.0_77-b03) (build 1.8.0_77-b03) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b03 mixed mode linux-amd64 compressed oops) # Problematic frame: # C [libpthread.so.0+0x9c84] pthread_mutex_lock+0x4 I wonder is it a bug in Java?
Apr 13 2016