tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [macOS] Monterey patch


From: Christian Jullien
Subject: [Tinycc-devel] [macOS] Monterey patch
Date: Fri, 29 Oct 2021 18:23:08 +0200

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]