Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread Enrico Sorichetti via Oorexx-devel
Hello everybody !

Seems a pretty radical solution to me

System installed with encryption … hard to believe

The heavy duty restrictions came with Catalina ans became  more strict with Big 
Sur

Mojave was and still is pretty permissive 


I shall be glad to help by giving a shot on high Sierra

Let  me know where to download the installation material
And I will give a try on the iMac  and/or Catalina

cheers
enrico 

> On 19 Mar 2021, at 19:48, P.O. Jonsson  wrote:
> 
>> So maybe I follow P.O.'s advice and ask the student for reinstalling MacOS 
>> and only go on
>> 

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread P.O. Jonsson
> Am 19.03.2021 um 19:20 schrieb Rony G. Flatscher :
> 
> P.P.S.: The biggest problem is, that I cannot duplicate the student's 
> problem. So maybe I follow P.O.'s advice and ask the student for reinstalling 
> MacOS and only go on, if the problem remains.
> 
> 


Since here installation method seems unorthodox, before you ask him/her to 
reinstall maybe askto uninstall the package, download it fresh from the 
internet, unpack and RIGHT-Click on the pkg -> in this way you get the „Open“ 
option and can install as usual. Then the installation MUST be ok.

(Fresh from the internet -> SIP will be invoked

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread Rony G. Flatscher
Bonsoir Jean Louis,

thank you very much for your hints!

On 19.03.2021 18:46, Jean Louis Faucher wrote:
> The @path comes the dylib you link with.
> (LC_ID_DYLIB)
>
> otool -D librexx.dylib: @rpath/librexx.4.dylib
> otool -D librexxapi.dylib: @rpath/librexxapi.4.dylib
>
> Your library embeds this dependency:
> otool -L libBSF4ooRexx.dylib
>   ./tmp/libBSF4ooRexx.dylib-64-x86_64 (compatibility version 0.0.0, 
> current version 0.0.0)
>   @rpath/librexx.4.dylib (compatibility version 4.0.0, current version 
> 0.0.0)
>   @rpath/librexxapi.4.dylib (compatibility version 4.0.0, current version 
> 0.0.0)
>   /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM 
> (compatibility version 1.0.0, current version 1.0.0)
>   /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 
> 400.9.4)
>   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
> version 1252.250.1)
>
> In rexxj.sh, you declare -Djava.library.path="$DYLD_LIBRARY_PATH"

No, not that is not the case. On Macs /usr/local/rexxj.sh gets linked to 
rexxj2.sh, by default java
gets invoked with

java org.rexxla.bsf.RexxDispatcher $*

which will run java (create the Java virtual machine and) have it run the Java 
class
RexxDispatcher's main method which gets all command line arguments (like the 
Rexx program file
name). RexxDispatcher will cause libBSF4ooRexx.dylib to be loaded which is 
linked against rexx and
rexxapi. So no DYLD_LIBRARY_PATH there.

All these libraries are present in the system's standard location 
"/usr/local/lib" (symbolic links
to either /Library/Frameworks/BSF4ooRexx.framework/Libraries/ or
/Library/Frameworks/ooRexx.framework/Libraries/) and therefore should be 
locatable by the system.

[If an environment variable named "BSF4Rexx_JavaStartupOptions" is defined, 
then java gets its
defined startup options passed on, such that e.g. the virtual machine's heap 
space can be defined
and the like. But this is not the case for these use cases.]

It is really a bit puzzling! I will call it a day now (a little bit exhausted 
from this week) ... :)

Best regards

---rony

P.S.: Locally I tested a version of libBSF4ooRexx.dylib where the link to 
libjvm.dylib (the Java VM)
does not occur to a Framework directory, but to one of the 
/Library/Java/JavaVirtualMachines Java
subdirectories (have multiple Java versions installed because of BSF4ooRexx) 
which causes a
@rpath/libjvm.dylib entry to be created rather than
/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM.

P.P.S.: The biggest problem is, that I cannot duplicate the student's problem. 
So maybe I follow
P.O.'s advice and ask the student for reinstalling MacOS and only go on, if the 
problem remains.


> On 19 Mar 2021, at 18:36, Rony G. Flatscher  wrote:
>> Dear P.O.,
>>
>> On 19.03.2021 17:59, P.O. Jonsson wrote:
>> ... cut ...
>>> Two wild guesses: is the student maybe running macOS with encryption? 
>> Hmm, would you have links that explain/describe about the implications of 
>> doing so?
>>
>> One thing I start to speculate with is Apple's security measures that incur 
>> side-effects for the
>> uninitiated (like myself in that regard) that cause this.
>>
>> When installing BSF4ooRexx Apple does not allow that to proceed as the 
>> installation package is
>> unsigned and/or downloaded from the Internet. Rather she would go into 
>> System Preferences where
>> there was an item (forgot which one) that allowed her to install that very 
>> same BSF4ooRexx package.
>> If something went wrong there it may be the case that that inhibits 
>> finding/loading the shared
>> libraries from that package?
>>
>>> Or use a case sensitive file system?
>> This should not pose a problem as BSF4ooRexx works on the case sensitive 
>> Linux file systems.
>>> This problem looks to me like a „Windows-type“ problem, i.e. I guess the OS 
>>> itself is rotten in
>>> some way. I would ask the student to reinstall macOS. And reinstall 
>>> BSF/ooRexx after that.
>>>
>>> If that is to much work try to find another machine where s/he can do the 
>>> same installation. If
>>> the problem arises again it is in his/her special setup.
>>>
>>> I have never once experienced something like what you describe, and I am 
>>> juggling many different
>>> ooRexx/BSF/installer/dmg versions at the same time. On an older machine 
>>> using hfs+ I have a
>>> problem with sub-second filenames but that is the only thing. And I have 
>>> macOS on anything from
>>> High Sierra to Big Sur.
>> Thank you very much for your feedback and ideas, which are really helpful in 
>> this situation!
>>
>> Having experimented with new builds of the shared library (on "Big Sur") 
>> they all work and the
>> linking step creates @rpath/librexx.4.dylib, @rpath/librexxapi.4.dylib, and 
>> @rpath/libjvm.dylib (but
>> also /usr/lib/libc++.1.dylib and /usr/lib/libSystem.B.dylib).
>>
>> Not sure whether further time investments would alleviate the problem on the 
>> student's 

Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread Jean Louis Faucher
Guten tag Rony

The @path comes the dylib you link with.
(LC_ID_DYLIB)

otool -D librexx.dylib: @rpath/librexx.4.dylib
otool -D librexxapi.dylib: @rpath/librexxapi.4.dylib

Your library embeds this dependency:
otool -L libBSF4ooRexx.dylib
./tmp/libBSF4ooRexx.dylib-64-x86_64 (compatibility version 0.0.0, 
current version 0.0.0)
@rpath/librexx.4.dylib (compatibility version 4.0.0, current version 
0.0.0)
@rpath/librexxapi.4.dylib (compatibility version 4.0.0, current version 
0.0.0)
/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM 
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 
400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1252.250.1)

In rexxj.sh, you declare -Djava.library.path="$DYLD_LIBRARY_PATH"
Is it including the path to the oorexx dylibs ?


> On 19 Mar 2021, at 18:36, Rony G. Flatscher  wrote:
> 
> Dear P.O.,
> 
> On 19.03.2021 17:59, P.O. Jonsson wrote:
> ... cut ...
>> Two wild guesses: is the student maybe running macOS with encryption? 
> 
> Hmm, would you have links that explain/describe about the implications of 
> doing so?
> 
> One thing I start to speculate with is Apple's security measures that incur 
> side-effects for the
> uninitiated (like myself in that regard) that cause this.
> 
> When installing BSF4ooRexx Apple does not allow that to proceed as the 
> installation package is
> unsigned and/or downloaded from the Internet. Rather she would go into System 
> Preferences where
> there was an item (forgot which one) that allowed her to install that very 
> same BSF4ooRexx package.
> If something went wrong there it may be the case that that inhibits 
> finding/loading the shared
> libraries from that package?
> 
>> Or use a case sensitive file system?
> This should not pose a problem as BSF4ooRexx works on the case sensitive 
> Linux file systems.
>> This problem looks to me like a „Windows-type“ problem, i.e. I guess the OS 
>> itself is rotten in
>> some way. I would ask the student to reinstall macOS. And reinstall 
>> BSF/ooRexx after that.
>> 
>> If that is to much work try to find another machine where s/he can do the 
>> same installation. If
>> the problem arises again it is in his/her special setup.
>> 
>> I have never once experienced something like what you describe, and I am 
>> juggling many different
>> ooRexx/BSF/installer/dmg versions at the same time. On an older machine 
>> using hfs+ I have a
>> problem with sub-second filenames but that is the only thing. And I have 
>> macOS on anything from
>> High Sierra to Big Sur.
> 
> Thank you very much for your feedback and ideas, which are really helpful in 
> this situation!
> 
> Having experimented with new builds of the shared library (on "Big Sur") they 
> all work and the
> linking step creates @rpath/librexx.4.dylib, @rpath/librexxapi.4.dylib, and 
> @rpath/libjvm.dylib (but
> also /usr/lib/libc++.1.dylib and /usr/lib/libSystem.B.dylib).
> 
> Not sure whether further time investments would alleviate the problem on the 
> student's computer,
> given your wealth of MacOS systems and experiences (will have to adapt the 
> Mac installer of
> BSF4ooRexx to cater for zsh, and time permitting to change the installer to 
> check for the existence
> of ooRexx on the system already, and if so use that ooRexx instead the one on 
> board of BSF4ooRexx
> and the like)!
> 
> Best regards
> 
> ---rony
> 
> 
> 
> 
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel



___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread Rony G. Flatscher
Dear P.O.,

On 19.03.2021 17:59, P.O. Jonsson wrote:
... cut ...
> Two wild guesses: is the student maybe running macOS with encryption? 

Hmm, would you have links that explain/describe about the implications of doing 
so?

One thing I start to speculate with is Apple's security measures that incur 
side-effects for the
uninitiated (like myself in that regard) that cause this.

When installing BSF4ooRexx Apple does not allow that to proceed as the 
installation package is
unsigned and/or downloaded from the Internet. Rather she would go into System 
Preferences where
there was an item (forgot which one) that allowed her to install that very same 
BSF4ooRexx package.
If something went wrong there it may be the case that that inhibits 
finding/loading the shared
libraries from that package?

> Or use a case sensitive file system?
This should not pose a problem as BSF4ooRexx works on the case sensitive Linux 
file systems.
> This problem looks to me like a „Windows-type“ problem, i.e. I guess the OS 
> itself is rotten in
> some way. I would ask the student to reinstall macOS. And reinstall 
> BSF/ooRexx after that.
>
> If that is to much work try to find another machine where s/he can do the 
> same installation. If
> the problem arises again it is in his/her special setup.
>
> I have never once experienced something like what you describe, and I am 
> juggling many different
> ooRexx/BSF/installer/dmg versions at the same time. On an older machine using 
> hfs+ I have a
> problem with sub-second filenames but that is the only thing. And I have 
> macOS on anything from
> High Sierra to Big Sur.

Thank you very much for your feedback and ideas, which are really helpful in 
this situation!

Having experimented with new builds of the shared library (on "Big Sur") they 
all work and the
linking step creates @rpath/librexx.4.dylib, @rpath/librexxapi.4.dylib, and 
@rpath/libjvm.dylib (but
also /usr/lib/libc++.1.dylib and /usr/lib/libSystem.B.dylib).

Not sure whether further time investments would alleviate the problem on the 
student's computer,
given your wealth of MacOS systems and experiences (will have to adapt the Mac 
installer of
BSF4ooRexx to cater for zsh, and time permitting to change the installer to 
check for the existence
of ooRexx on the system already, and if so use that ooRexx instead the one on 
board of BSF4ooRexx
and the like)!

Best regards

---rony




___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread P.O. Jonsson
Dear Rony,

> Am 19.03.2021 um 17:03 schrieb Rony G. Flatscher :
> 
>>> Anyone with an idea, an advice what to look for, what to do in this case?
>>> 
> 

Dear Rony,

Two wild guesses: is the student maybe running macOS with encryption? Or use a 
case sensitive file system?

This problem looks to me like a „Windows-type“ problem, i.e. I guess the OS 
itself is rotten in some way. I would ask the student to reinstall macOS. And 
reinstall BSF/ooRexx after that.

If that is to much work try to find another machine where s/he can do the same 
installation. If the problem arises again it is in his/her special setup.

I have never once experienced something like what you describe, and I am 
juggling many different ooRexx/BSF/installer/dmg versions at the same time. On 
an older machine using hfs+ I have a problem with sub-second filenames but that 
is the only thing. And I have macOS on anything from High Sierra to Big Sur.___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Mac: "Library not loaded: @rpath/librexx.4.dylib"

2021-03-19 Thread Rony G. Flatscher
Hi Jean Louis,

On 18.03.2021 19:10, Jean Louis Faucher wrote:
> 2 URLs that could help
>
> https://stackoverflow.com/questions/45464584/macosx-which-dynamic-libraries-linked-by-binary
> 
> try
> DYLD_PRINT_LIBRARIES=1 DYLD_PRINT_LIBRARIES_POST_LAUNCH=1 DYLD_PRINT_RPATHS=1 
> rexxj.sh ...

This did not have any effect, googling around a little bit one source says: for 
security reasons
bash does not pass on environment variables that start with DYLD_ ... however, 
if one would copy
bash to another location und use that one it would work again, PITA.

> https://blog.krzyzanowskim.com/2018/12/05/rpath-what/
> 

Thank you, very interesting as well, however at the end it states also:

Controling linker with environment variables

The behaviour of dyld may be controlled by environment variables, however 
If System Integrity
Protection is enabled, environment variables are ignored when executing 
binaries protected by
System Integrity Protection - that is most of the time.

PS. it's different on Linux because different loader is used.

> From here, I could be wrong, but I understand that @rpath instructs the 
> dynamic linker to search a
> list of LC_RPATH in order, and substitute @rpath by the value of LC_RPATH to 
> locate the dynamic
> library.
>
> To display the LC_RPATH of rexx:
> otool -l rexx | grep LC_RPATH -A2
>
> The value is @executable_path/../lib
> so @rpath/librexx.4.dylib
> becomes 
> @executable_path/../lib//librexx.4.dylib
>
> rexxj.sh is launching java, not rexx.
> I assume that java and rexx are not in the same folder, so maybe it’s the 
> reason why this library
> is not found ?

On my system (even after having upgraded to "Big Sur") everything works using 
the same BSF4ooRexx
installation package as the student. (One problem I have is, that I cannot 
duplicate the behavior on
my machine but could witness it via a shared screen session watchin the 
student's Mac.)

In this use case Java loads libBSF4ooRexx.dylib which is linked against ooRexx. 
(MacOS has become
really quite pesky it turned out that the already installed otool was gone, 
probably because of some
updates by Apple and needed to reinstall the commandline tools to get the tool 
access to xcrun. Also
during the upgrade to "Big Sur" Apple forced my system - without my consent! - 
to change the login
shell from bash to zsh, which has consequences also for the BSF4ooRexx 
installation that I need to
tackle as well! :( )

Thanks to your otool sample/idea I could find and print the DYLIB related 
information from
libBSF4ooRexx.dylib:

otool -l libBSF4ooRexx.dylib | grep DYLIB -A2

which yields:

 cmd LC_ID_DYLIB
  cmdsize 64
 name ./tmp/libBSF4ooRexx.dylib-64-x86_64 (offset 24)
--
  cmd LC_LOAD_DYLIB
  cmdsize 48
 name @rpath/librexx.4.dylib (offset 24)
--
  cmd LC_LOAD_DYLIB
  cmdsize 56
 name @rpath/librexxapi.4.dylib (offset 24)
--
  cmd LC_LOAD_DYLIB
  cmdsize 88
 name /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM 
(offset 24)
--
  cmd LC_LOAD_DYLIB
  cmdsize 48
 name /usr/lib/libc++.1.dylib (offset 24)
--
  cmd LC_LOAD_DYLIB
  cmdsize 56
 name /usr/lib/libSystem.B.dylib (offset 24)

Will have to look into linking against librexx.4.dylib and librexxapi.4.dylib 
which currently is
defined as:

... cut ...

CFLAGS = -fPIC
BSF_ORX_TARGET_64  = $(BLD_PATH)/libBSF4ooRexx.dylib-64-x86_64
... cut ...

LFLAGS = -shared
ORX_LIBPATH_64 = /Library/Frameworks/ooRexx.framework/Libraries/
ORX_LIBS_64 = $(ORX_LIBPATH_64)/librexx.dylib 
$(ORX_LIBPATH_64)/librexxapi.dylib
... cut ...

g++ -c $(CFLAGS) $(INC_PATH) $(INC_PATH_ALL) -m64 -arch x86_64 -DUSE_OREXX 
-DUNIX -DBSF4REXX_64_BIT -o$(BSF_OBJ_ORX_64) BSF4ooRexx.cc
g++ -dynamiclib $(LFLAGS) -o $(BSF_ORX_TARGET_64) $(BSF_OBJ_ORX_64) 
$(ORX_LIBS_64) -framework JavaVM -arch x86_64
... cut ...

The reason for "/Library/Frameworks/ooRexx.framework/Libraries/" is the 
BSF4ooRexx "full" package
includes ooRexx which gets placed there. (AFAICT I have done nothing that 
qualifies @rpath to be
used instead of that explicit path?)

As the ooRexx files get linked from /usr/local/bin and /usr/local/lib at 
installation time, I should
probably link against "/usr/local/lib" instead on MacOSX. Is there anything I 
should consider in
addition?

TIA,

---rony


>
>> On 18 Mar 2021, at 17:47, Rony G. Flatscher > > wrote:
>>
>> Got a strange error on a student's MacBook (Mojave) which I am not able to 
>> recreate at all nor
>> have I received a comparable error report so far:
>>
>> T-MacBook-Air:~ t.f$ rexxj.sh 
>>