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
> "
>
>  
>
> 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?
>
> 

[Tinycc-devel] macos: new tcc command line option?

2020-07-10 Thread Christian Jullien
Hi maintainers,

 

As often, Apple reinvent the wheel and makes things differently.

Among other, clang handles shared libs .dylib with a different set of
compiler options.

For example, -shared is replaced by -dynamiclib etc.

 

It means that a ./configure must test if it uses clang or tcc and adapt its
compiler options.

 

Question: with proper #if/#endif do you allow me to handle clang specific
options on macos?

 

FYI I currently see 4/5 options to add (or at least silently drop) to
support tcc on macos with a better compatibility with clang.

 

C.

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


Re: [Tinycc-devel] Tiny c availability

2020-07-10 Thread Steffen Nurpmeso
Christian Jullien wrote in
<002701d65677$164843e0$42d8cba0$@orange.fr>:
 |i wrote:
 ||Christian Jullien wrote in
 ||<003901d65604$ce397be0$6aac73a0$@orange.fr>:
 |||I added USES file which list known projects working with tcc. To be \
 |||completed
 ||
 ||With zest.

 |Hi, which zest are you talking about (I found many references but none \
 |seem to be for C).
 |Can you please point me on the official page?

Ah, le rue est grise et triste.
"Mon cœur et mon zeste."

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

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


Re: [Tinycc-devel] [issue] macos: tcc cannot self-host with --disable-static

2020-07-10 Thread avih via Tinycc-devel
 Thanks.

Yeah, I was suspecting it could have been the case. Nevertheless, I thought it's
worth noting, for the record.

Cheers.


 On Friday, July 10, 2020, 02:56:19 PM GMT+3, Christian Jullien 
 wrote:  
 
 Thank you for testing the different configure options on macos.
I can easily fix this but it will fail later. I'm not sure that tcc is 
currently able to generate .dylib

tcc -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
tcc: error: _main not defined

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Friday, July 10, 2020 11:42
To: tinycc-devel@nongnu.org
Cc: avih
Subject: [Tinycc-devel] [issue] macos: tcc cannot self-host with 
--disable-static

Self-hosting with static linking works fine:


[ -e ./conftest.c ] || { echo error: not tcc root; exit 1; }
rm -rf ./bld ./bldself ./dist1 2>/dev/null || :

mkdir bld && cd bld && \
../configure --prefix=$(pwd)/../dist1 && make && make test && make install

cd .. && mkdir bldself && cd bldself && \
../configure --cc=$(pwd)/../dist1/bin/tcc && make && make test


However, if changing the last line to:
../configure --disable-static --cc=$(pwd)/../dist1/bin/tcc && make && make test

then `make' fails at the end on this line:

<...>/../dist1/bin/tcc -dynamiclib -current_version 0.9.27 
-compatibility_version 0.9.27 -install_name @rpath/libtcc.dylib -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


with:
tcc: error: invalid option -- '-current_version'
make: *** [libtcc.dylib] Error 1


I guess it's somewhat expected that these options are not currently
supported, but I think it would be nice if tcc could self-host a dynamically
linked tcc.

Avi

___
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] [issue] macos: tcc cannot self-host with --disable-static

2020-07-10 Thread Christian Jullien
Thank you for testing the different configure options on macos.
I can easily fix this but it will fail later. I'm not sure that tcc is 
currently able to generate .dylib

tcc -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
tcc: error: _main not defined

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of avih via Tinycc-devel
Sent: Friday, July 10, 2020 11:42
To: tinycc-devel@nongnu.org
Cc: avih
Subject: [Tinycc-devel] [issue] macos: tcc cannot self-host with 
--disable-static

Self-hosting with static linking works fine:


[ -e ./conftest.c ] || { echo error: not tcc root; exit 1; }
rm -rf ./bld ./bldself ./dist1 2>/dev/null || :

mkdir bld && cd bld && \
../configure --prefix=$(pwd)/../dist1 && make && make test && make install

cd .. && mkdir bldself && cd bldself && \
../configure --cc=$(pwd)/../dist1/bin/tcc && make && make test


However, if changing the last line to:
../configure --disable-static --cc=$(pwd)/../dist1/bin/tcc && make && make test

then `make' fails at the end on this line:

<...>/../dist1/bin/tcc -dynamiclib -current_version 0.9.27 
-compatibility_version 0.9.27 -install_name @rpath/libtcc.dylib -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


with:
tcc: error: invalid option -- '-current_version'
make: *** [libtcc.dylib] Error 1


I guess it's somewhat expected that these options are not currently
supported, but I think it would be nice if tcc could self-host a dynamically
linked tcc.

Avi

___
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] [issue] macos: tcc cannot self-host with --disable-static

2020-07-10 Thread avih via Tinycc-devel
Self-hosting with static linking works fine:


[ -e ./conftest.c ] || { echo error: not tcc root; exit 1; }
rm -rf ./bld ./bldself ./dist1 2>/dev/null || :

mkdir bld && cd bld && \
../configure --prefix=$(pwd)/../dist1 && make && make test && make install

cd .. && mkdir bldself && cd bldself && \
../configure --cc=$(pwd)/../dist1/bin/tcc && make && make test


However, if changing the last line to:
../configure --disable-static --cc=$(pwd)/../dist1/bin/tcc && make && make test

then `make' fails at the end on this line:

<...>/../dist1/bin/tcc -dynamiclib -current_version 0.9.27 
-compatibility_version 0.9.27 -install_name @rpath/libtcc.dylib -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


with:
tcc: error: invalid option -- '-current_version'
make: *** [libtcc.dylib] Error 1


I guess it's somewhat expected that these options are not currently
supported, but I think it would be nice if tcc could self-host a dynamically
linked tcc.

Avi

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