Hum, after reinstalling xcode with "xcode-select -install" it also added
missing MacOXS.sdk symlinks.

 

$ ls -ls /Library/Developer/CommandLineTools/SDKs

0 lrwxr-xr-x  1 root  wheel   14 Oct 30 16:53 MacOSX.sdk -> MacOSX12.0.sdk

0 drwxr-xr-x  7 root  wheel  224 Nov 30  2020 MacOSX11.1.sdk

0 drwxr-xr-x  7 root  wheel  224 Oct 30 16:53 MacOSX11.3.sdk

0 lrwxr-xr-x  1 root  wheel   14 Oct 30 16:52 MacOSX11.sdk -> MacOSX11.3.sdk

0 drwxr-xr-x  7 root  wheel  224 Oct 30 16:52 MacOSX12.0.sdk

0 lrwxr-xr-x  1 root  wheel   14 Oct 30 16:51 MacOSX12.sdk -> MacOSX12.0.sdk

 

So I'll probably not commit the patch.

 

From: Christian Jullien [mailto:[email protected]] 
Sent: Friday, October 29, 2021 18:23
To: '[email protected]'
Subject: [macOS] Monterey patch

 

Hi,

Monterey/Xcode 13.1 changed the lib location

 

From

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

To

/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib

 

I think this patch allows to support any location SDKs/MacOSX*sdk

 

If it's Ok, I'll push it in few days.

 

diff --git a/tccmacho.c b/tccmacho.c

index 57c62c3..5ad62d1 100644

--- a/tccmacho.c

+++ b/tccmacho.c

@@ -874,10 +874,13 @@ ST_FUNC void tcc_add_macos_sdkpath(TCCState* s)

     int (*f)(unsigned int, char**) = dlsym(xcs, "xcselect_host_sdk_path");

     cstr_new(&path);

     if (f) f(1, &sdkroot);

-    if (sdkroot)

+    if (sdkroot) {

         pos = strstr(sdkroot,"SDKs/MacOSX");

-    if (pos)

-        cstr_printf(&path, "%.*s.sdk/usr/lib", (int)(pos - sdkroot + 11),
sdkroot);

+    }

+    if (pos) {

+        int len = strlen(pos);

+        cstr_printf(&path, "%.*s/usr/lib", (int)(pos - sdkroot + len),
sdkroot);

+    }

     /* must use free from libc directly */

#pragma push_macro("free")

#undef free

 

There are also few errors I'll try to identify:

 

Test: 108_constructor...

--- 108_constructor.expect      2021-10-29 17:29:19.000000000 +0200

+++ 108_constructor.output      2021-10-29 18:15:43.000000000 +0200

@@ -1,3 +1,2 @@

constructor

main

-destructor

make[3]: *** [108_constructor.test] Error 1

Test: 109_float_struct_calling...

Test: 110_average...

Test: 111_conversion...

Test: 112_backtrace...

Test: 114_bound_signal...

--- 114_bound_signal.expect     2021-10-29 17:29:19.000000000 +0200

+++ 114_bound_signal.output     2021-10-29 18:15:43.000000000 +0200

@@ -1,2 +0,0 @@

-start

-end

make[3]: *** [114_bound_signal.test] Error 1

 

Christian

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to