Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-11 Thread ian
Hi Christian,

You're right, obviously.

The point were only "a mailing-list ain't a chat".

But, yes, obviously again, Avi did a great job !!

Kind regards.

ian

Le 11/07/2020 à 08:01, Christian Jullien a écrit :
>
> Hi Ian,
>
> Sorry for the inconvenience.
>
>  
>
> We are talking to tinycc-devel which … hum? … is for devel!
>
> As macos port is new it seems natural to have more (devel) emails than
> before.
>
> Avih did a very good job chasing issues with different ./configure
> options. Thanks again Avi.
>
> This makes macos more robust and compatible with Linux behavior.
>
>  
>
> If I talk privately to other contributors (something I do sometime),
> we may lose useful advices from other persons knowing macos very well.
>
>  
>
> I’ll be glad to follow what maintainers will ask me to do on
> tiny-devel list.
>
>  
>
> Have a nice day.
>
>  
>
>  
>
> *From:*ian [mailto:sibian0...@gmail.com]
> *Sent:* Saturday, July 11, 2020 07:17
> *To:* tinycc-devel@nongnu.org; jull...@eligis.com
> *Cc:* avih
> *Subject:* Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works
> after cleanup
>
>  
>
> Hi.
>
> Please consider not  fucking everybody's mailing-list.
>
> I ain't a  chat hu ?
>
> But FYI your  contribution is welcomed, many thanks.
>
>  
>
> ian
>
>  
>
> Le 09/07/2020 à 23:16, avih via Tinycc-devel a écrit :
>
>
> I've pushed a fix to mob to support arbitrary libdir (c69290fb).
>
> The relative path is now used during `make test', while the fixed
> libdir is used after install.
>
> On Thursday, July 9, 2020, 09:12:06 PM GMT+3, avih via
> Tinycc-devel 
> <mailto:tinycc-devel@nongnu.org> wrote:
>
>  
>
>  
>
> Note to self: Make sure to double check before posting.
>
> Turns out ./dist/lib/ remained from the previous install, which I
> didn't delete
> before testing with --libdir=$(pwd)/dist/mylibs.
>
> Indeed, it only creates ./dist/mylibs, and indeed it fails to find
> the dylib
> when running ./dist/bin/tcc, (make test still works).
>
> On Thursday, July 9, 2020, 09:02:24 PM GMT+3, avih
>  <mailto:avih...@yahoo.com> wrote:
>
>  
>
>  
>
> Thanks. I can confirm current mob (6c94df6) does work also with
> custom prefix,
> as well as building in a custom dir (mkdir build && cd build &&
> ../configure ...).
>
> However, looking at that commit, I thought it would break with a
> custom --libdir,
> like ./configure --libdir=$(pwd)/dist/mylibs but I tried it and it
> still worked.
>
> Turns out it creates both ./dist/lib and ./dist/mylibs, and
> libtcc.dylib is at both
> of them as well as tcc/ and its content (duplicated at both dirs),
> though libtcc.a
> is only at ./dist/lib/ .
>
> Is that expected? I never tried using --libdir before, but commit
> 6c94df6 makes it look
> a bit hardcoded, so I tried it now. Wouldn't it be better to
> specify the absolute
> install [libdir] ?
>
> Avi
>
> On Thursday, July 9, 2020, 08:40:42 PM GMT+3, Christian Jullien
>  <mailto:eli...@orange.fr> wrote:
>
>  
>
>  
>
> I’ve found another (and better) way to achieve this:
>
> -Wl,-rpath,"@executable_path/$(TOP)"
> -Wl,-rpath,"@executable_path/$(TOP)/../lib
> <mailto:%22%20-Wl,-rpath,%22@executable_path/$(TOP)/../lib>"
>
>  
>
>     It is commited, can you please test this one.
>
>  
>
>  
>
> *From:*Tinycc-devel
> [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] *On
> Behalf Of *Christian Jullien
> *Sent:* Thursday, July 09, 2020 19:07
> *To:* tinycc-devel@nongnu.org <mailto:tinycc-devel@nongnu.org>;
> jull...@eligis.com <mailto:jull...@eligis.com>
> *Cc:* 'avih'
> *Subject:* Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer
> works after cleanup
>
>  
>
> Thanks avih, another step is missing (it works well with default
> install location)
>
> Can you please test this:
>
> $ install_name_tool -add_rpath "@executable_path/../lib/" tcc
>
> $ make install
>
> $ ./dist/bin/tcc -vv
>
> tcc version 0.9.27 (x86_64 Darwin)
>
> install: /Users/jullien/tinycc/dist/lib/tcc
>
> …
>
>  
>
> It work for me. If it also works for you I’ll add this step to
> macos build
>
>  
>
> *From:*Tinycc-devel
> [mailto:tinycc-devel-bounces+e

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-11 Thread Christian Jullien
Hi Ian,

Sorry for the inconvenience.

 

We are talking to tinycc-devel which … hum? … is for devel!

As macos port is new it seems natural to have more (devel) emails than before.

Avih did a very good job chasing issues with different ./configure options. 
Thanks again Avi.

This makes macos more robust and compatible with Linux behavior.

 

If I talk privately to other contributors (something I do sometime), we may 
lose useful advices from other persons knowing macos very well.

 

I’ll be glad to follow what maintainers will ask me to do on tiny-devel list.

 

Have a nice day.

 

 

From: ian [mailto:sibian0...@gmail.com] 
Sent: Saturday, July 11, 2020 07:17
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

Hi.

Please consider not  fucking everybody's mailing-list.

I ain't a  chat hu ?

But FYI your  contribution is welcomed, many thanks.

 

ian

 

Le 09/07/2020 à 23:16, avih via Tinycc-devel a écrit :


I've pushed a fix to mob to support arbitrary libdir (c69290fb).

The relative path is now used during `make test', while the fixed libdir is 
used after install.

On Thursday, July 9, 2020, 09:12:06 PM GMT+3, avih via Tinycc-devel  
<mailto:tinycc-devel@nongnu.org>  wrote: 

 

 

Note to self: Make sure to double check before posting.

Turns out ./dist/lib/ remained from the previous install, which I didn't delete
before testing with --libdir=$(pwd)/dist/mylibs.

Indeed, it only creates ./dist/mylibs, and indeed it fails to find the dylib
when running ./dist/bin/tcc, (make test still works).



On Thursday, July 9, 2020, 09:02:24 PM GMT+3, avih  <mailto:avih...@yahoo.com> 
 wrote: 

 

 

Thanks. I can confirm current mob (6c94df6) does work also with custom prefix,
as well as building in a custom dir (mkdir build && cd build && ../configure 
...).

However, looking at that commit, I thought it would break with a custom 
--libdir,
like ./configure --libdir=$(pwd)/dist/mylibs but I tried it and it still worked.

Turns out it creates both ./dist/lib and ./dist/mylibs, and libtcc.dylib is at 
both
of them as well as tcc/ and its content (duplicated at both dirs), though 
libtcc.a
is only at ./dist/lib/ .

Is that expected? I never tried using --libdir before, but commit 6c94df6 makes 
it look
a bit hardcoded, so I tried it now. Wouldn't it be better to specify the 
absolute
install [libdir] ?

Avi



On Thursday, July 9, 2020, 08:40:42 PM GMT+3, Christian Jullien  
<mailto:eli...@orange.fr>  wrote: 

 

 

I’ve found another (and better) way to achieve this:

-Wl,-rpath,"@executable_path/$(TOP) 
<mailto:%22%20-Wl,-rpath,%22@executable_path/$(TOP)/../lib> " 
-Wl,-rpath,"@executable_path/$(TOP)/../lib"

 

It is commited, can you please test this one.

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Thursday, July 09, 2020 19:07
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: 'avih'
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

Thanks avih, another step is missing (it works well with default install 
location)

Can you please test this:

$ install_name_tool -add_rpath "@executable_path/../lib/" tcc

$ make install

$ ./dist/bin/tcc -vv

tcc version 0.9.27 (x86_64 Darwin)

install: /Users/jullien/tinycc/dist/lib/tcc

…

 

It work for me. If it also works for you I’ll add this step to macos build

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Thursday, July 09, 2020 18:23
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 


Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  <mailto:avih...@yahoo.com> 
 wrote: 

 

 


Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien  
<mailto:eli...@orange.fr>  wrote: 

 

 

?? can you please try with mob and give me the complete log?

 

The fix is “macos: tcc searches 

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-10 Thread ian
Hi.

Please consider not  fucking everybody's mailing-list.

I ain't a  chat hu ?

But FYI your  contribution is welcomed, many thanks.


ian


Le 09/07/2020 à 23:16, avih via Tinycc-devel a écrit :
>
> I've pushed a fix to mob to support arbitrary libdir (c69290fb).
>
> The relative path is now used during `make test', while the fixed
> libdir is used after install.
>
> On Thursday, July 9, 2020, 09:12:06 PM GMT+3, avih via Tinycc-devel
>  wrote:
>
>
> Note to self: Make sure to double check before posting.
>
> Turns out ./dist/lib/ remained from the previous install, which I
> didn't delete
> before testing with --libdir=$(pwd)/dist/mylibs.
>
> Indeed, it only creates ./dist/mylibs, and indeed it fails to find the
> dylib
> when running ./dist/bin/tcc, (make test still works).
>
>
> On Thursday, July 9, 2020, 09:02:24 PM GMT+3, avih 
> wrote:
>
>
> Thanks. I can confirm current mob (6c94df6) does work also with custom
> prefix,
> as well as building in a custom dir (mkdir build && cd build &&
> ../configure ...).
>
> However, looking at that commit, I thought it would break with a
> custom --libdir,
> like ./configure --libdir=$(pwd)/dist/mylibs but I tried it and it
> still worked.
>
> Turns out it creates both ./dist/lib and ./dist/mylibs, and
> libtcc.dylib is at both
> of them as well as tcc/ and its content (duplicated at both dirs),
> though libtcc.a
> is only at ./dist/lib/ .
>
> Is that expected? I never tried using --libdir before, but commit
> 6c94df6 makes it look
> a bit hardcoded, so I tried it now. Wouldn't it be better to specify
> the absolute
> install [libdir] ?
>
> Avi
>
>
> On Thursday, July 9, 2020, 08:40:42 PM GMT+3, Christian Jullien
>  wrote:
>
>
> I’ve found another (and better) way to achieve this:
>
> -Wl,-rpath,"@executable_path/$(TOP)"
> -Wl,-rpath,"@executable_path/$(TOP)/../lib
> <mailto:%22%20-Wl,-rpath,%22@executable_path/$(TOP)/../lib>"
>
>  
>
> It is commited, can you please test this one.
>
>  
>
>  
>
> *From:*Tinycc-devel
> [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] *On Behalf
> Of *Christian Jullien
> *Sent:* Thursday, July 09, 2020 19:07
> *To:* tinycc-devel@nongnu.org; jull...@eligis.com
> *Cc:* 'avih'
> *Subject:* Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works
> after cleanup
>
>  
>
> Thanks avih, another step is missing (it works well with default
> install location)
>
> Can you please test this:
>
> $ install_name_tool -add_rpath "@executable_path/../lib/" tcc
>
> $ make install
>
> $ ./dist/bin/tcc -vv
>
> tcc version 0.9.27 (x86_64 Darwin)
>
> install: /Users/jullien/tinycc/dist/lib/tcc
>
> …
>
>  
>
> It work for me. If it also works for you I’ll add this step to macos build
>
>  
>
> *From:*Tinycc-devel
> [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] *On Behalf
> Of *avih via Tinycc-devel
> *Sent:* Thursday, July 09, 2020 18:23
> *To:* tinycc-devel@nongnu.org; jull...@eligis.com
> *Cc:* avih
> *Subject:* Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works
> after cleanup
>
>  
>
>
> Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
> compile programs successfully, and -run works as well.
>
> So it seems that install target doesn't take everything into account.
>
> On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih 
> wrote:
>
>  
>
>  
>
>
> Oh, I missed the commits from today.
>
> Indeed, with latest mob (6bd0ced) this now succeeds:
> ./configure --disable-static && make && make test
>
> However, when building and installing like this:
> ./configure --disable-static --prefix=$(pwd)/dist && make && make test
> && make install
>
> Then it succeeds, but the tcc binary seems missing the dylib:
> $ ./dist/bin/tcc
> dyld: Library not loaded: @rpath/libtcc.dylib
> Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
> Reason: image not found
> Abort trap: 6
>
> When not using --disable-static, then tcc runs fine, compiles and even
> -run works.
>
> On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien
>  wrote:
>
>  
>
>  
>
> ?? can you please try with mob and give me the complete log?
>
>  
>
> The fix is
> “macos: tcc searches for libtcc.dyln in the same directory as its executable”
>
>  
>
> C.
>
>  
>
> *From:*avih [mailto:avih...@yahoo.com]
> *Sent:* Thursday, July 09, 2020 17:52
> *To:* jull...@eligis.com; tinycc-devel@nongnu.org
> *Subject:* Re: [Tinycc-devel] mac

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread avih via Tinycc-devel
 
I've pushed a fix to mob to support arbitrary libdir (c69290fb).

The relative path is now used during `make test', while the fixed libdir is 
used after install.

 On Thursday, July 9, 2020, 09:12:06 PM GMT+3, avih via Tinycc-devel 
 wrote:  
 
  Note to self: Make sure to double check before posting.

Turns out ./dist/lib/ remained from the previous install, which I didn't delete
before testing with --libdir=$(pwd)/dist/mylibs.

Indeed, it only creates ./dist/mylibs, and indeed it fails to find the dylib
when running ./dist/bin/tcc, (make test still works).


 On Thursday, July 9, 2020, 09:02:24 PM GMT+3, avih  
wrote:  
 
  Thanks. I can confirm current mob (6c94df6) does work also with custom prefix,
as well as building in a custom dir (mkdir build && cd build && ../configure 
...).

However, looking at that commit, I thought it would break with a custom 
--libdir,
like ./configure --libdir=$(pwd)/dist/mylibs but I tried it and it still worked.

Turns out it creates both ./dist/lib and ./dist/mylibs, and libtcc.dylib is at 
both
of them as well as tcc/ and its content (duplicated at both dirs), though 
libtcc.a
is only at ./dist/lib/ .

Is that expected? I never tried using --libdir before, but commit 6c94df6 makes 
it look
a bit hardcoded, so I tried it now. Wouldn't it be better to specify the 
absolute
install [libdir] ?

Avi


 On Thursday, July 9, 2020, 08:40:42 PM GMT+3, Christian Jullien 
 wrote:  
 
 #yiv6312635793 -- filtered {}#yiv6312635793 filtered {}#yiv6312635793 filtered 
{}#yiv6312635793 filtered {}#yiv6312635793 filtered {}#yiv6312635793 
p.yiv6312635793MsoNormal, #yiv6312635793 li.yiv6312635793MsoNormal, 
#yiv6312635793 div.yiv6312635793MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:New;}#yiv6312635793
 a:link, #yiv6312635793 span.yiv6312635793MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv6312635793 a:visited, #yiv6312635793 
span.yiv6312635793MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv6312635793 
p.yiv6312635793msonormal, #yiv6312635793 li.yiv6312635793msonormal, 
#yiv6312635793 div.yiv6312635793msonormal 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New;}#yiv6312635793
 p.yiv6312635793msonormal1, #yiv6312635793 li.yiv6312635793msonormal1, 
#yiv6312635793 div.yiv6312635793msonormal1 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6312635793 
span.yiv6312635793msohyperlink {}#yiv6312635793 
span.yiv6312635793msohyperlinkfollowed {}#yiv6312635793 
span.yiv6312635793emailstyle17 {}#yiv6312635793 span.yiv6312635793msohyperlink1 
{color:blue;text-decoration:underline;}#yiv6312635793 
span.yiv6312635793msohyperlinkfollowed1 
{color:purple;text-decoration:underline;}#yiv6312635793 
span.yiv6312635793emailstyle171 {color:#1F497D;}#yiv6312635793 
span.yiv6312635793EmailStyle25 {color:#1F497D;}#yiv6312635793 
span.yiv6312635793EmailStyle26 {color:#1F497D;}#yiv6312635793 
.yiv6312635793MsoChpDefault {font-size:10.0pt;}#yiv6312635793 filtered 
{}#yiv6312635793 div.yiv6312635793WordSection1 {}#yiv6312635793 
I’ve found another (and better) way to achieve this:

-Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"@executable_path/$(TOP)/../lib"

  

It is commited, can you please test this one.

  

  

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Thursday, July 09, 2020 19:07
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: 'avih'
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  

Thanks avih, another step is missing (it works well with default install 
location)

Can you please test this:

$ install_name_tool -add_rpath "@executable_path/../lib/" tcc

$ make install

$ ./dist/bin/tcc -vv

tcc version 0.9.27 (x86_64 Darwin)

install: /Users/jullien/tinycc/dist/lib/tcc

…

  

It work for me. If it also works for you I’ll add this step to macos build

  

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Thursday, July 09, 2020 18:23
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  


Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  wrote: 

  

  


Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtc

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread avih via Tinycc-devel
 Note to self: Make sure to double check before posting.

Turns out ./dist/lib/ remained from the previous install, which I didn't delete
before testing with --libdir=$(pwd)/dist/mylibs.

Indeed, it only creates ./dist/mylibs, and indeed it fails to find the dylib
when running ./dist/bin/tcc, (make test still works).


 On Thursday, July 9, 2020, 09:02:24 PM GMT+3, avih  
wrote:  
 
  Thanks. I can confirm current mob (6c94df6) does work also with custom prefix,
as well as building in a custom dir (mkdir build && cd build && ../configure 
...).

However, looking at that commit, I thought it would break with a custom 
--libdir,
like ./configure --libdir=$(pwd)/dist/mylibs but I tried it and it still worked.

Turns out it creates both ./dist/lib and ./dist/mylibs, and libtcc.dylib is at 
both
of them as well as tcc/ and its content (duplicated at both dirs), though 
libtcc.a
is only at ./dist/lib/ .

Is that expected? I never tried using --libdir before, but commit 6c94df6 makes 
it look
a bit hardcoded, so I tried it now. Wouldn't it be better to specify the 
absolute
install [libdir] ?

Avi


 On Thursday, July 9, 2020, 08:40:42 PM GMT+3, Christian Jullien 
 wrote:  
 
 #yiv8281334735 -- filtered {}#yiv8281334735 filtered {}#yiv8281334735 filtered 
{}#yiv8281334735 filtered {}#yiv8281334735 filtered {}#yiv8281334735 
p.yiv8281334735MsoNormal, #yiv8281334735 li.yiv8281334735MsoNormal, 
#yiv8281334735 div.yiv8281334735MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:New;}#yiv8281334735
 a:link, #yiv8281334735 span.yiv8281334735MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv8281334735 a:visited, #yiv8281334735 
span.yiv8281334735MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv8281334735 
p.yiv8281334735msonormal, #yiv8281334735 li.yiv8281334735msonormal, 
#yiv8281334735 div.yiv8281334735msonormal 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New;}#yiv8281334735
 p.yiv8281334735msonormal1, #yiv8281334735 li.yiv8281334735msonormal1, 
#yiv8281334735 div.yiv8281334735msonormal1 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv8281334735 
span.yiv8281334735msohyperlink {}#yiv8281334735 
span.yiv8281334735msohyperlinkfollowed {}#yiv8281334735 
span.yiv8281334735emailstyle17 {}#yiv8281334735 span.yiv8281334735msohyperlink1 
{color:blue;text-decoration:underline;}#yiv8281334735 
span.yiv8281334735msohyperlinkfollowed1 
{color:purple;text-decoration:underline;}#yiv8281334735 
span.yiv8281334735emailstyle171 {color:#1F497D;}#yiv8281334735 
span.yiv8281334735EmailStyle25 {color:#1F497D;}#yiv8281334735 
span.yiv8281334735EmailStyle26 {color:#1F497D;}#yiv8281334735 
.yiv8281334735MsoChpDefault {font-size:10.0pt;}#yiv8281334735 filtered 
{}#yiv8281334735 div.yiv8281334735WordSection1 {}#yiv8281334735 
I’ve found another (and better) way to achieve this:

-Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"@executable_path/$(TOP)/../lib"

  

It is commited, can you please test this one.

  

  

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Thursday, July 09, 2020 19:07
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: 'avih'
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  

Thanks avih, another step is missing (it works well with default install 
location)

Can you please test this:

$ install_name_tool -add_rpath "@executable_path/../lib/" tcc

$ make install

$ ./dist/bin/tcc -vv

tcc version 0.9.27 (x86_64 Darwin)

install: /Users/jullien/tinycc/dist/lib/tcc

…

  

It work for me. If it also works for you I’ll add this step to macos build

  

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Thursday, July 09, 2020 18:23
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  


Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  wrote: 

  

  


Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian 

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread avih via Tinycc-devel
 Thanks. I can confirm current mob (6c94df6) does work also with custom prefix,
as well as building in a custom dir (mkdir build && cd build && ../configure 
...).

However, looking at that commit, I thought it would break with a custom 
--libdir,
like ./configure --libdir=$(pwd)/dist/mylibs but I tried it and it still worked.

Turns out it creates both ./dist/lib and ./dist/mylibs, and libtcc.dylib is at 
both
of them as well as tcc/ and its content (duplicated at both dirs), though 
libtcc.a
is only at ./dist/lib/ .

Is that expected? I never tried using --libdir before, but commit 6c94df6 makes 
it look
a bit hardcoded, so I tried it now. Wouldn't it be better to specify the 
absolute
install [libdir] ?

Avi


 On Thursday, July 9, 2020, 08:40:42 PM GMT+3, Christian Jullien 
 wrote:  
 
 #yiv960526 #yiv960526 -- _filtered {} _filtered {} _filtered {} 
_filtered {} _filtered {}#yiv960526 #yiv960526 
p.yiv960526MsoNormal, #yiv960526 li.yiv960526MsoNormal, 
#yiv960526 div.yiv960526MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:New;}#yiv960526
 a:link, #yiv960526 span.yiv960526MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv960526 a:visited, #yiv960526 
span.yiv960526MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv960526 
p.yiv960526msonormal, #yiv960526 li.yiv960526msonormal, 
#yiv960526 div.yiv960526msonormal 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New;}#yiv960526
 p.yiv960526msonormal1, #yiv960526 li.yiv960526msonormal1, 
#yiv960526 div.yiv960526msonormal1 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv960526 
span.yiv960526msohyperlink {}#yiv960526 
span.yiv960526msohyperlinkfollowed {}#yiv960526 
span.yiv960526emailstyle17 {}#yiv960526 span.yiv960526msohyperlink1 
{color:blue;text-decoration:underline;}#yiv960526 
span.yiv960526msohyperlinkfollowed1 
{color:purple;text-decoration:underline;}#yiv960526 
span.yiv960526emailstyle171 {color:#1F497D;}#yiv960526 
span.yiv960526EmailStyle25 {color:#1F497D;}#yiv960526 
span.yiv960526EmailStyle26 {color:#1F497D;}#yiv960526 
.yiv960526MsoChpDefault {font-size:10.0pt;} _filtered {}#yiv960526 
div.yiv960526WordSection1 {}#yiv960526 
I’ve found another (and better) way to achieve this:

-Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"@executable_path/$(TOP)/../lib"

  

It is commited, can you please test this one.

  

  

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Thursday, July 09, 2020 19:07
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: 'avih'
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  

Thanks avih, another step is missing (it works well with default install 
location)

Can you please test this:

$ install_name_tool -add_rpath "@executable_path/../lib/" tcc

$ make install

$ ./dist/bin/tcc -vv

tcc version 0.9.27 (x86_64 Darwin)

install: /Users/jullien/tinycc/dist/lib/tcc

…

  

It work for me. If it also works for you I’ll add this step to macos build

  

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Thursday, July 09, 2020 18:23
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  


Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  wrote: 

  

  


Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien 
 wrote: 

  

  

?? can you please try with mob and give me the complete log?

 

The fix is “macos: tcc searches for libtcc.dyln in the same directory as its 
executable”

 

C.

 

From: avih [mailto:avih...@yahoo.com] 
Sent: Thursday, July 09, 2020 17:52
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

What's the fix? I tried lo

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Christian Jullien
I’ve found another (and better) way to achieve this:

-Wl,-rpath,"@executable_path/$(TOP) 
<mailto:%22%20-Wl,-rpath,%22@executable_path/$(TOP)/../lib> " 
-Wl,-rpath,"@executable_path/$(TOP)/../lib"

 

It is commited, can you please test this one.

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Thursday, July 09, 2020 19:07
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: 'avih'
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

Thanks avih, another step is missing (it works well with default install 
location)

Can you please test this:

$ install_name_tool -add_rpath "@executable_path/../lib/" tcc

$ make install

$ ./dist/bin/tcc -vv

tcc version 0.9.27 (x86_64 Darwin)

install: /Users/jullien/tinycc/dist/lib/tcc

…

 

It work for me. If it also works for you I’ll add this step to macos build

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Thursday, July 09, 2020 18:23
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 


Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  wrote: 

 

 


Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien 
 wrote: 

 

 

?? can you please try with mob and give me the complete log?

 

The fix is “macos: tcc searches for libtcc.dyln in the same directory as its 
executable”

 

C.

 

From: avih [mailto:avih...@yahoo.com] 
Sent: Thursday, July 09, 2020 17:52
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

What's the fix? I tried looking at the earlier messages, but didn't
see a diff/patch.

For me on osx 10.13 (real MBA) I also have the same issue when
using --disable-static, but it seems fine without it, including -run.

On Thursday, July 9, 2020, 06:38:10 PM GMT+3, Michael Matz 
 wrote: 

 

 

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.




Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Christian Jullien
Thanks avih, another step is missing (it works well with default install 
location)

Can you please test this:

$ install_name_tool -add_rpath "@executable_path/../lib/" tcc

$ make install

$ ./dist/bin/tcc -vv

tcc version 0.9.27 (x86_64 Darwin)

install: /Users/jullien/tinycc/dist/lib/tcc

…

 

It work for me. If it also works for you I’ll add this step to macos build

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Thursday, July 09, 2020 18:23
To: tinycc-devel@nongnu.org; jull...@eligis.com
Cc: avih
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 


Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  wrote: 

 

 


Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien 
 wrote: 

 

 

?? can you please try with mob and give me the complete log?

 

The fix is “macos: tcc searches for libtcc.dyln in the same directory as its 
executable”

 

C.

 

From: avih [mailto:avih...@yahoo.com] 
Sent: Thursday, July 09, 2020 17:52
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

What's the fix? I tried looking at the earlier messages, but didn't
see a diff/patch.

For me on osx 10.13 (real MBA) I also have the same issue when
using --disable-static, but it seems fine without it, including -run.

On Thursday, July 9, 2020, 06:38:10 PM GMT+3, Michael Matz 
 wrote: 

 

 

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.




Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread avih via Tinycc-devel
 
Seems that moving ./dist/lib/libtcc.dylib to ./dist/bin/ makes it work,
compile programs successfully, and -run works as well.

So it seems that install target doesn't take everything into account.

 On Thursday, July 9, 2020, 07:17:38 PM GMT+3, avih  
wrote:  
 
  
Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
 Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
 Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

 On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien 
 wrote:  
 
 #yiv6760391554 -- filtered {}#yiv6760391554 filtered {}#yiv6760391554 filtered 
{}#yiv6760391554 filtered {}#yiv6760391554 p.yiv6760391554MsoNormal, 
#yiv6760391554 li.yiv6760391554MsoNormal, #yiv6760391554 
div.yiv6760391554MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:New;}#yiv6760391554
 a:link, #yiv6760391554 span.yiv6760391554MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv6760391554 a:visited, #yiv6760391554 
span.yiv6760391554MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv6760391554 
span.yiv6760391554EmailStyle17 {color:#1F497D;}#yiv6760391554 
span.yiv6760391554datetime {}#yiv6760391554 .yiv6760391554MsoChpDefault 
{}#yiv6760391554 filtered {}#yiv6760391554 div.yiv6760391554WordSection1 
{}#yiv6760391554 
?? can you please try with mob and give me the complete log?

  

The fix is “macos: tcc searches for libtcc.dyln in the same directory as its 
executable”

  

C.

  

From: avih [mailto:avih...@yahoo.com] 
Sent: Thursday, July 09, 2020 17:52
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  

What's the fix? I tried looking at the earlier messages, but didn't
see a diff/patch.

For me on osx 10.13 (real MBA) I also have the same issue when
using --disable-static, but it seems fine without it, including -run.

On Thursday, July 9, 2020, 06:38:10 PM GMT+3, Michael Matz 
 wrote: 

  

  

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.




Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread avih via Tinycc-devel
 
Oh, I missed the commits from today.

Indeed, with latest mob (6bd0ced) this now succeeds:
./configure --disable-static && make && make test

However, when building and installing like this:
./configure --disable-static --prefix=$(pwd)/dist && make && make test && make 
install

Then it succeeds, but the tcc binary seems missing the dylib:
$ ./dist/bin/tcc
dyld: Library not loaded: @rpath/libtcc.dylib
 Referenced from: /Users/avih/dev/tcc/tcc.upstream/./dist/bin/tcc
 Reason: image not found
Abort trap: 6

When not using --disable-static, then tcc runs fine, compiles and even -run 
works.

 On Thursday, July 9, 2020, 07:07:12 PM GMT+3, Christian Jullien 
 wrote:  
 
 #yiv1885721961 #yiv1885721961 -- _filtered {} _filtered {} _filtered {} 
_filtered {}#yiv1885721961 #yiv1885721961 p.yiv1885721961MsoNormal, 
#yiv1885721961 li.yiv1885721961MsoNormal, #yiv1885721961 
div.yiv1885721961MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:New;}#yiv1885721961
 a:link, #yiv1885721961 span.yiv1885721961MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv1885721961 a:visited, #yiv1885721961 
span.yiv1885721961MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv1885721961 
span.yiv1885721961EmailStyle17 {color:#1F497D;}#yiv1885721961 
span.yiv1885721961datetime {}#yiv1885721961 .yiv1885721961MsoChpDefault {} 
_filtered {}#yiv1885721961 div.yiv1885721961WordSection1 {}#yiv1885721961 
?? can you please try with mob and give me the complete log?

  

The fix is “macos: tcc searches for libtcc.dyln in the same directory as its 
executable”

  

C.

  

From: avih [mailto:avih...@yahoo.com] 
Sent: Thursday, July 09, 2020 17:52
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

  

What's the fix? I tried looking at the earlier messages, but didn't
see a diff/patch.

For me on osx 10.13 (real MBA) I also have the same issue when
using --disable-static, but it seems fine without it, including -run.

On Thursday, July 9, 2020, 06:38:10 PM GMT+3, Michael Matz 
 wrote: 

  

  

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.




Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
  ___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Christian Jullien
?? can you please try with mob and give me the complete log?

 

The fix is “macos: tcc searches for libtcc.dyln in the same directory as its 
executable”

 

C.

 

From: avih [mailto:avih...@yahoo.com] 
Sent: Thursday, July 09, 2020 17:52
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

 

What's the fix? I tried looking at the earlier messages, but didn't
see a diff/patch.

For me on osx 10.13 (real MBA) I also have the same issue when
using --disable-static, but it seems fine without it, including -run.

On Thursday, July 9, 2020, 06:38:10 PM GMT+3, Michael Matz 
 wrote: 

 

 

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.




Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Christian Jullien
Thanks Michael,

Good to know.

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Michael Matz
Sent: Thursday, July 09, 2020 17:38
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.


Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread avih via Tinycc-devel
 What's the fix? I tried looking at the earlier messages, but didn't
see a diff/patch.

For me on osx 10.13 (real MBA) I also have the same issue when
using --disable-static, but it seems fine without it, including -run.

 On Thursday, July 9, 2020, 06:38:10 PM GMT+3, Michael Matz 
 wrote:  
 
 Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

> If you have a moment, can you please test if my macos fix for dyld also 
> works on your configuration?

Yes, it works fine here on my emulated macOS.


Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
  ___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Michael Matz

Hello Christian,

(I missed the question earlier, apologies)

On Thu, 9 Jul 2020, Christian Jullien wrote:

If you have a moment, can you please test if my macos fix for dyld also 
works on your configuration?


Yes, it works fine here on my emulated macOS.


Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Michael Matz

Hello,

On Thu, 9 Jul 2020, Christian Jullien wrote:


Got it! Once again Apple does things in your back.
Whatever starts with DYLD_ is processed directly by the system in a 
different way on a real mac (tested on Catalina and High Sierra).


Read: 
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-dyld-environment-variables


Ah, I guess the purpose of this is the same as why Linux ld.so ignores 
e.g. LD_LIBRARY_PATH for setuid binaries (understandable).  That MacOS 
(with some settings?) ignores this also for normal binaries is of course 
strange.  I'm glad you found a work-around :)



Ciao,
Michael.



Michael, it probably works for you because your system is set 
differently. Mine is 'standard" I mean installed wo. special tuning.


--- Makefile ---
ifndef TOP
TOP = .
CURDIR = $(PWD)
SYSTEM = `uname`
endif

export DYLD_LIBRARY_PATH := $(CURDIR)/$(TOP)
export DYLD_LIBRARY_FOO := $(CURDIR)/$(TOP)
export DYLD_FOO_PATH := $(CURDIR)/$(TOP)
export DYLDFOO_PATH := $(CURDIR)/$(TOP)
export EDYLD_LIBRARY_PATH := $(CURDIR)/$(TOP)
export

all:
   @echo Running on $(SYSTEM)
   @echo in Makefile environment is set to
   @set

$ make | grep DY
DYLDFOO_PATH=/Users/jullien/foo/.
EDYLD_LIBRARY_PATH=/Users/jullien/foo/.

All "^DYLD_" variables are dropped!!!
I'll revert to the code I wrote which uses "DYLD_LIBRARY_PATH= tcc"

I faced a similar issue while porting Le-Lisp (not OpenLisp) on macOS. The 
assembler code has dlink and llink variables (dynamic and lexical link). macOS 
assembler uses llink internally and silently dropped (wo warning) this variable 
while dlink was kept (!). It took me 2 days to understand. G!

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Wednesday, July 08, 2020 17:50
To: tinycc-devel@nongnu.org; jull...@eligis.com
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

Thank you for testing, make is the same:
jullien@jacquet:~/tinycc $ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.

Single dash was an automatic edit from my email agent. I pass of course 2 dashes

I tested on High Sierra which uses bash and Catalina which uses zsh. It fails 
the same on both systems.

jullien@jacquet:~/tinycc $ make clean
jullien@jacquet:~/tinycc $ ./configure --disable-static
Binary directory/usr/local/bin
TinyCC directory/usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory/usr/local/share/man
Info directory  /usr/local/share/info
Doc directory   /usr/local/share/doc
/usr/include dir
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
Source path /Users/jullien/tinycc
C compiler  clang (10.0)
Target OS   Darwin
CPU x86_64
Config  OSX static=no
Creating config.mak and config.h
config.h is unchanged
jullien@jacquet:~/tinycc $ make && make test
clang -o tcc.o -c tcc.c 
-DCONFIG_USR_INCLUDE="\"/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include\""
 -DTCC_TARGET_X86_64 -DTCC_TARGET_MACHO   -DONE_SOURCE=0 -Wall -O2 
-Wdeclaration-after-statement -fno-strict-aliasing -fheinous-gnu-extensions -Wno-pointer-

clang -shared -o libtcc.dylib libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o 
tccrun.o x86_64-gen.o x86_64-link.o i386-asm.o tccmacho.o  -flat_namespace 
-undefined warning
clang -o tcc tcc.o libtcc.dylib -lm -lpthread -ldl  -flat_namespace -undefined warning  
-Wl,-rpath,"/usr/local/lib"
../tcc -c libtcc1.c -o libtcc1.o -B.. -I..
../tcc -c alloca86_64.S -o alloca86_64.o -B.. -I..
../tcc -c alloca86_64-bt.S -o alloca86_64-bt.o -B.. -I..
../tcc -c va_list.c -o va_list.o -B.. -I..
../tcc -ar rcs ../libtcc1.a libtcc1.o alloca86_64.o alloca86_64-bt.o va_list.o
../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I..
../tcc -c bt-log.c -o ../bt-log.o -B.. -I..
../tcc -c bcheck.c -o ../bcheck.o -B.. -I.. -g
...
 hello-exe 
dyld: Library not loaded: libtcc.dylib
 Referenced from: /Users/jullien/tinycc/tests/../tcc
 Reason: image not found
/bin/sh: line 1: 62218 Abort trap: 6   ../tcc -B.. -I../include -I.. 
-I.. ../examples/ex1.c -o hello
+ ../tcc -vv
dyld: Library not loaded: libtcc.dylib
 Referenced from: /Users/jullien/tinycc/tests/../tcc
 Reason: image not found
/bin/sh: line 1: 62220 Abort trap: 6   ../tcc -vv
+ ldd ../tcc
/bin/sh: ldd: command not found
+ exit 1
make[2]: *** [hello-exe] Error 1
make[1]: *** [all] Error 2
make: *** [test] Error 2




-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Michael Matz
Sent: Wednesday, July 08, 2020 17:35
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works afte

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Christian Jullien
Michael,

If you have a moment, can you please test if my macos fix for dyld also works 
on your configuration?
My changes tell tcc to find dyld in the same directory as it binary. Clearly, 
DYLD_LIBRARY_PATH can't be use as, for security reasons, it is reset when call 
subprocess.

Thx.

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Michael Matz
Sent: Wednesday, July 08, 2020 17:35
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

Hello,

On Wed, 8 Jul 2020, Christian Jullien wrote:

> 
> It is still unclear why it does not work but on macOS, ./configure 
> –disable-static Now raises an error:
> 
>  hello-exe 
> 
> === recurse /Users/jullien/tinycc/tests/.. ===
> 
> dyld: Library not loaded: libtcc.dylib
> 
>   Referenced from: /Users/jullien/tinycc/tests/../tcc
> 
>   Reason: image not found

Hmm, can't reproduce here:

% git log -1 --online HEAD
9d75f14 Fix structure passing i386 PE
% make clean
% ./configure --disable-static
...
Config  OSX static=no
...
% make
% make test
... works ...

(Note the double dash for configure options, I'm not sure if it was just a typo 
in your mail).  And there's proof that the export from the Makefile does work, 
because calling tcc from the tests directory directly indeed doesn't work:

% cd tests; ../tcc -h
dyld: Library not loaded: libtcc.dylib
   Referenced from: /Users/micha/src/tinycc/tests/../tcc
   Reason: image not found
Abort trap: 6

So that the testsuite works for me is the indication that the 'export 
DYLD_LIBRARY_PATH' construct does work (for me).  Any differences in make 
behaviour perhaps?

% make --version
GNU Make 3.81
Copyright (C) 2006  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.

This program built for i386-apple-darwin11.3.0


Ciao,
Michael.


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-08 Thread Christian Jullien
Got it! Once again Apple does things in your back.
Whatever starts with DYLD_ is processed directly by the system in a different 
way on a real mac (tested on Catalina and High Sierra).
Read: 
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-dyld-environment-variables

Michael, it probably works for you because your system is set differently. Mine 
is 'standard" I mean installed wo. special tuning.

--- Makefile ---
ifndef TOP
 TOP = .
 CURDIR = $(PWD)
 SYSTEM = `uname`
endif

 export DYLD_LIBRARY_PATH := $(CURDIR)/$(TOP)
 export DYLD_LIBRARY_FOO := $(CURDIR)/$(TOP)
 export DYLD_FOO_PATH := $(CURDIR)/$(TOP)
 export DYLDFOO_PATH := $(CURDIR)/$(TOP)
 export EDYLD_LIBRARY_PATH := $(CURDIR)/$(TOP)
 export

all:
@echo Running on $(SYSTEM)
@echo in Makefile environment is set to
@set

$ make | grep DY
DYLDFOO_PATH=/Users/jullien/foo/.
EDYLD_LIBRARY_PATH=/Users/jullien/foo/.

All "^DYLD_" variables are dropped!!!
I'll revert to the code I wrote which uses "DYLD_LIBRARY_PATH= tcc"

I faced a similar issue while porting Le-Lisp (not OpenLisp) on macOS. The 
assembler code has dlink and llink variables (dynamic and lexical link). macOS 
assembler uses llink internally and silently dropped (wo warning) this variable 
while dlink was kept (!). It took me 2 days to understand. G!

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Wednesday, July 08, 2020 17:50
To: tinycc-devel@nongnu.org; jull...@eligis.com
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

Thank you for testing, make is the same:
jullien@jacquet:~/tinycc $ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.

Single dash was an automatic edit from my email agent. I pass of course 2 dashes

I tested on High Sierra which uses bash and Catalina which uses zsh. It fails 
the same on both systems.

jullien@jacquet:~/tinycc $ make clean
jullien@jacquet:~/tinycc $ ./configure --disable-static
Binary directory/usr/local/bin
TinyCC directory/usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory/usr/local/share/man
Info directory  /usr/local/share/info
Doc directory   /usr/local/share/doc
/usr/include dir
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
Source path /Users/jullien/tinycc
C compiler  clang (10.0)
Target OS   Darwin
CPU x86_64
Config  OSX static=no
Creating config.mak and config.h
config.h is unchanged
jullien@jacquet:~/tinycc $ make && make test
clang -o tcc.o -c tcc.c 
-DCONFIG_USR_INCLUDE="\"/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include\""
 -DTCC_TARGET_X86_64 -DTCC_TARGET_MACHO   -DONE_SOURCE=0 -Wall -O2 
-Wdeclaration-after-statement -fno-strict-aliasing -fheinous-gnu-extensions 
-Wno-pointer-

clang -shared -o libtcc.dylib libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o 
tccrun.o x86_64-gen.o x86_64-link.o i386-asm.o tccmacho.o  -flat_namespace 
-undefined warning
clang -o tcc tcc.o libtcc.dylib -lm -lpthread -ldl  -flat_namespace -undefined 
warning  -Wl,-rpath,"/usr/local/lib"
../tcc -c libtcc1.c -o libtcc1.o -B.. -I..
../tcc -c alloca86_64.S -o alloca86_64.o -B.. -I..
../tcc -c alloca86_64-bt.S -o alloca86_64-bt.o -B.. -I..
../tcc -c va_list.c -o va_list.o -B.. -I..
../tcc -ar rcs ../libtcc1.a libtcc1.o alloca86_64.o alloca86_64-bt.o va_list.o
../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I..
../tcc -c bt-log.c -o ../bt-log.o -B.. -I..
../tcc -c bcheck.c -o ../bcheck.o -B.. -I.. -g
...
 hello-exe 
dyld: Library not loaded: libtcc.dylib
  Referenced from: /Users/jullien/tinycc/tests/../tcc
  Reason: image not found
/bin/sh: line 1: 62218 Abort trap: 6   ../tcc -B.. -I../include -I.. 
-I.. ../examples/ex1.c -o hello
+ ../tcc -vv
dyld: Library not loaded: libtcc.dylib
  Referenced from: /Users/jullien/tinycc/tests/../tcc
  Reason: image not found
/bin/sh: line 1: 62220 Abort trap: 6   ../tcc -vv
+ ldd ../tcc
/bin/sh: ldd: command not found
+ exit 1
make[2]: *** [hello-exe] Error 1
make[1]: *** [all] Error 2
make: *** [test] Error 2




-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Michael Matz
Sent: Wednesday, July 08, 2020 17:35
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

Hello,

On Wed, 8 Jul 2020, Christian Jullien wrote:

> 
> It is still unclear why it does not work but on macOS, ./configure 
> –disable-static Now raises an error:
> 
>  hello-exe 
> 
> === recurse /Users/jullien/tinycc/tests/.. ===
> 
> dyld: Library not loaded: libtcc.dylib

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-08 Thread Christian Jullien
Thank you for testing, make is the same:
jullien@jacquet:~/tinycc $ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.

Single dash was an automatic edit from my email agent. I pass of course 2 dashes

I tested on High Sierra which uses bash and Catalina which uses zsh. It fails 
the same on both systems.

jullien@jacquet:~/tinycc $ make clean
jullien@jacquet:~/tinycc $ ./configure --disable-static
Binary directory/usr/local/bin
TinyCC directory/usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory/usr/local/share/man
Info directory  /usr/local/share/info
Doc directory   /usr/local/share/doc
/usr/include dir
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
Source path /Users/jullien/tinycc
C compiler  clang (10.0)
Target OS   Darwin
CPU x86_64
Config  OSX static=no
Creating config.mak and config.h
config.h is unchanged
jullien@jacquet:~/tinycc $ make && make test
clang -o tcc.o -c tcc.c 
-DCONFIG_USR_INCLUDE="\"/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include\""
 -DTCC_TARGET_X86_64 -DTCC_TARGET_MACHO   -DONE_SOURCE=0 -Wall -O2 
-Wdeclaration-after-statement -fno-strict-aliasing -fheinous-gnu-extensions 
-Wno-pointer-

clang -shared -o libtcc.dylib libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o 
tccrun.o x86_64-gen.o x86_64-link.o i386-asm.o tccmacho.o  -flat_namespace 
-undefined warning
clang -o tcc tcc.o libtcc.dylib -lm -lpthread -ldl  -flat_namespace -undefined 
warning  -Wl,-rpath,"/usr/local/lib"
../tcc -c libtcc1.c -o libtcc1.o -B.. -I..
../tcc -c alloca86_64.S -o alloca86_64.o -B.. -I..
../tcc -c alloca86_64-bt.S -o alloca86_64-bt.o -B.. -I..
../tcc -c va_list.c -o va_list.o -B.. -I..
../tcc -ar rcs ../libtcc1.a libtcc1.o alloca86_64.o alloca86_64-bt.o va_list.o
../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I..
../tcc -c bt-log.c -o ../bt-log.o -B.. -I..
../tcc -c bcheck.c -o ../bcheck.o -B.. -I.. -g
...
 hello-exe 
dyld: Library not loaded: libtcc.dylib
  Referenced from: /Users/jullien/tinycc/tests/../tcc
  Reason: image not found
/bin/sh: line 1: 62218 Abort trap: 6   ../tcc -B.. -I../include -I.. 
-I.. ../examples/ex1.c -o hello
+ ../tcc -vv
dyld: Library not loaded: libtcc.dylib
  Referenced from: /Users/jullien/tinycc/tests/../tcc
  Reason: image not found
/bin/sh: line 1: 62220 Abort trap: 6   ../tcc -vv
+ ldd ../tcc
/bin/sh: ldd: command not found
+ exit 1
make[2]: *** [hello-exe] Error 1
make[1]: *** [all] Error 2
make: *** [test] Error 2




-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Michael Matz
Sent: Wednesday, July 08, 2020 17:35
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after 
cleanup

Hello,

On Wed, 8 Jul 2020, Christian Jullien wrote:

> 
> It is still unclear why it does not work but on macOS, ./configure 
> –disable-static Now raises an error:
> 
>  hello-exe 
> 
> === recurse /Users/jullien/tinycc/tests/.. ===
> 
> dyld: Library not loaded: libtcc.dylib
> 
>   Referenced from: /Users/jullien/tinycc/tests/../tcc
> 
>   Reason: image not found

Hmm, can't reproduce here:

% git log -1 --online HEAD
9d75f14 Fix structure passing i386 PE
% make clean
% ./configure --disable-static
...
Config  OSX static=no
...
% make
% make test
... works ...

(Note the double dash for configure options, I'm not sure if it was just a typo 
in your mail).  And there's proof that the export from the Makefile does work, 
because calling tcc from the tests directory directly indeed doesn't work:

% cd tests; ../tcc -h
dyld: Library not loaded: libtcc.dylib
   Referenced from: /Users/micha/src/tinycc/tests/../tcc
   Reason: image not found
Abort trap: 6

So that the testsuite works for me is the indication that the 'export 
DYLD_LIBRARY_PATH' construct does work (for me).  Any differences in make 
behaviour perhaps?

% make --version
GNU Make 3.81
Copyright (C) 2006  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.

This program built for i386-apple-darwin11.3.0


Ciao,
Michael.


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-08 Thread Michael Matz

Hello,

On Wed, 8 Jul 2020, Christian Jullien wrote:



It is still unclear why it does not work but on macOS, ./configure
–disable-static
Now raises an error:

 hello-exe 

=== recurse /Users/jullien/tinycc/tests/.. ===

dyld: Library not loaded: libtcc.dylib

  Referenced from: /Users/jullien/tinycc/tests/../tcc

  Reason: image not found


Hmm, can't reproduce here:

% git log -1 --online HEAD
9d75f14 Fix structure passing i386 PE
% make clean
% ./configure --disable-static
...
Config  OSX static=no
...
% make
% make test
... works ...

(Note the double dash for configure options, I'm not sure if it was just a 
typo in your mail).  And there's proof that the export from the Makefile 
does work, because calling tcc from the tests directory directly indeed 
doesn't work:


% cd tests; ../tcc -h
dyld: Library not loaded: libtcc.dylib
  Referenced from: /Users/micha/src/tinycc/tests/../tcc
  Reason: image not found
Abort trap: 6

So that the testsuite works for me is the indication that the 'export 
DYLD_LIBRARY_PATH' construct does work (for me).  Any differences in make 
behaviour perhaps?


% make --version
GNU Make 3.81
Copyright (C) 2006  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.

This program built for i386-apple-darwin11.3.0


Ciao,
Michael.___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel