Skip to content

can not be build for Linux #180

@laoshaw

Description

@laoshaw

I installed swift-corelibs-libdispatch from source:

-- Install configuration: ""
-- Installing: /usr/local/include/dispatch/base.h
-- Installing: /usr/local/include/dispatch/block.h
-- Installing: /usr/local/include/dispatch/data.h
-- Installing: /usr/local/include/dispatch/dispatch.h
-- Installing: /usr/local/include/dispatch/group.h
-- Installing: /usr/local/include/dispatch/introspection.h
-- Installing: /usr/local/include/dispatch/io.h
-- Installing: /usr/local/include/dispatch/object.h
-- Installing: /usr/local/include/dispatch/once.h
-- Installing: /usr/local/include/dispatch/queue.h
-- Installing: /usr/local/include/dispatch/semaphore.h
-- Installing: /usr/local/include/dispatch/source.h
-- Installing: /usr/local/include/dispatch/time.h
-- Up-to-date: /usr/local/share/man/man3/dispatch.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_after.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_api.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_apply.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_async.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_data_create.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_group_create.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_io_create.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_io_read.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_object.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_once.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_queue_create.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_read.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_semaphore_create.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_source_create.3
-- Up-to-date: /usr/local/share/man/man3/dispatch_time.3
-- Up-to-date: /usr/local/include/os/object.h
-- Up-to-date: /usr/local/include/os/generic_unix_base.h
-- Up-to-date: /usr/local/include/os/generic_win_base.h
-- Up-to-date: /usr/local/include/Block.h
-- Up-to-date: /usr/local/lib/libBlocksRuntime.so
-- Up-to-date: /usr/local/lib/libdispatch.so

which contains dispatch and blocksruntime already.
when I build CF Lite for Linux: make -f MakefileLinux I got:

/bin/cp ForFoundationOnly.h CF-Objects/normal/CoreFoundation/ForFoundationOnly.h
/bin/cp TargetConditionals.h CF-Objects/normal/CoreFoundation/TargetConditionals.h
/usr/bin/clang -O0 -g -c -x c -fblocks -fpic -pipe -std=gnu99 -Wno-trigraphs -fexceptions -DCF_BUILDING_CF=1 -DDEPLOYMENT_TARGET_LINUX=1 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_9 -DU_SHOW_DRAFT_API=1 -DU_SHOW_CPLUSPLUS_API=0 -ICF-Objects/normal -ICF-Objects/normal/CoreFoundation -DVERSION=1153.18 -include CoreFoundation_Prefix.h CFCharacterSet.c -o CF-Objects/normal/CFCharacterSet.o
In file included from CFCharacterSet.c:34:
In file included from ./CFInternal.h:112:
CF-Objects/normal/CoreFoundation/ForFoundationOnly.h:518:66: warning: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-const-int-float-conversion]
    return (CFHashCode)(integralHash + (CFHashCode)((d - dInt) * ULONG_MAX));
                                                               ~ ^~~~~~~~~
/usr/lib/llvm-16/lib/clang/16/include/limits.h:57:37: note: expanded from macro 'ULONG_MAX'
#define ULONG_MAX (__LONG_MAX__ *2UL+1UL)
                   ~~~~~~~~~~~~~~~~~^~~~
In file included from CFCharacterSet.c:34:
./CFInternal.h:294:12: error: unknown type name 'dispatch_time_t'; did you mean 'dispatch_once_t'?
CF_PRIVATE dispatch_time_t __CFTSRToDispatchTime(uint64_t tsr);
           ^~~~~~~~~~~~~~~
           dispatch_once_t
./CoreFoundation_Prefix.h:191:24: note: 'dispatch_once_t' declared here
typedef pthread_once_t dispatch_once_t;
                       ^
In file included from CFCharacterSet.c:34:
In file included from ./CFInternal.h:758:
In file included from /usr/local/include/dispatch/dispatch.h:73:
/usr/local/include/dispatch/once.h:41:18: error: typedef redefinition with different types ('intptr_t' (aka 'long') vs 'pthread_once_t' (aka 'int'))
typedef intptr_t dispatch_once_t;
                 ^
./CoreFoundation_Prefix.h:191:24: note: previous definition is here
typedef pthread_once_t dispatch_once_t;
                       ^
In file included from CFCharacterSet.c:34:
./CFInternal.h:759:10: fatal error: 'dispatch/private.h' file not found
#include <dispatch/private.h>
         ^~~~~~~~~~~~~~~~~~~~
1 warning and 3 errors generated.
make: *** [MakefileLinux:50: CF-Objects/normal/CFCharacterSet.o] Error 1

There seems no way to build CF Lite for Linux based on Apple's releases anymore?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions