remove some compiling options for MacOS

This commit is contained in:
zhengshuxin 2022-04-11 19:09:39 +08:00
parent 36e21ccd96
commit d9f0c8b5da
59 changed files with 87 additions and 64 deletions

View File

@ -61,7 +61,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
RPATH = macos
SYSLIB += -rdynamic -L/usr/lib -liconv
LDFLAGS = -dynamiclib -shared

View File

@ -27,7 +27,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -27,7 +27,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -29,7 +29,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -53,7 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof -fPIC -Werror \
-Wno-unused-private-field

View File

@ -29,7 +29,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -65,7 +65,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -34,7 +34,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,7 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -33,7 +33,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,7 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -58,7 +58,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -49,7 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -53,7 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -49,7 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,7 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,7 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -104,7 +104,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-ffunction-sections \

View File

@ -57,7 +57,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -49,7 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
@ -97,7 +97,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -53,7 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -24,7 +24,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -53,7 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -54,7 +54,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -49,7 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
@ -97,7 +97,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -D_REENTRANT -pedantic -DMACOSX
SYSLIB = -lpthread
endif

View File

@ -30,7 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -D_REENTRANT -pedantic -DMACOSX
SYSLIB = -lpthread
endif

View File

@ -44,7 +44,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
@ -84,7 +84,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -94,7 +94,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-Wno-unused-private-field \

View File

@ -49,7 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -56,7 +56,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -liconv -rdynamic

View File

@ -50,7 +50,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
UNIXTYPE = MACOSX
endif

View File

@ -25,7 +25,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -D_REENTRANT
SYSLIB = -lpthread
endif

View File

@ -73,7 +73,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -95,7 +95,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-Wno-deprecated-declarations

View File

@ -208,10 +208,12 @@ static void fiber_io_loop(ACL_FIBER *self fiber_unused, void *ctx)
* other fiber maybe in the ready queue and wants to
* add some IO event.
*/
acl_fiber_yield();
while (acl_fiber_yield() > 0) {}
if (ev->fdcount > 0 || ev->waiter > 0) {
continue;
} else if (ring_size(&ev->events) > 0) {
continue;
}
msg_info("%s(%d), tid=%lu: fdcount=0, waiter=%u, events=%d",
__FUNCTION__, __LINE__, __pthread_self(),

View File

@ -76,7 +76,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-Wno-unused-private-field

View File

@ -54,7 +54,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -32,10 +32,12 @@ protected:
acl::socket_stream conn;
printf("%s: begin to connect %s\r\n", __FUNCTION__, addr_.c_str());
printf("\r\n");
if (conn.open(addr_, 0, 0)) {
printf("%s: connect %s ok\r\n", __FUNCTION__, addr_.c_str());
printf(">>> %s: connect %s ok\r\n", __FUNCTION__, addr_.c_str());
} else {
printf("%s: connect %s error %s\r\n", __FUNCTION__,
printf(">>> %s: connect %s error %s\r\n", __FUNCTION__,
addr_.c_str(), acl::last_serror());
}
@ -56,10 +58,11 @@ static void fiber_redis(const char* addr, bool use_sem)
{
acl::socket_stream conn;
printf("\r\n");
if (conn.open(addr, 0, 0)) {
printf("%s: connect %s ok\r\n", __FUNCTION__, addr);
printf(">>> %s: connect %s ok\r\n", __FUNCTION__, addr);
} else {
printf("%s: connect %s error %s\r\n",
printf(">>> %s: connect %s error %s\r\n",
__FUNCTION__, addr, acl::last_serror());
}

View File

@ -0,0 +1,18 @@
#!/bin/sh
./fiber_connect -s 127.0.0.1:6379
echo ""
echo "Enter any key to continue..."
read n
./fiber_connect -s 127.0.0.1:6379 -S
echo ""
echo "Enter any key to continue..."
read n
./fiber_connect -s 127.0.0.1:637
echo ""
echo "Enter any key to continue..."
read n
./fiber_connect -s 127.0.0.1:637 -S

View File

@ -64,7 +64,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -53,7 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -31,7 +31,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -40,7 +40,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -52,7 +52,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -70,7 +70,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-fdata-sections \

View File

@ -52,7 +52,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -48,7 +48,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -25,7 +25,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -D_REENTRANT -pedantic
SYSLIB = -lpthread
endif

View File

@ -44,7 +44,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding -Wno-invalid-offsetof
UNIXTYPE = MACOSX
endif

View File

@ -40,7 +40,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
UNIXTYPE = MACOSX
endif

View File

@ -45,7 +45,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
# CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding -Wno-invalid-offsetof
UNIXTYPE = MACOSX
endif