ADDED .github/workflows/amiga-gcc.yml Index: .github/workflows/amiga-gcc.yml ================================================================== --- .github/workflows/amiga-gcc.yml +++ .github/workflows/amiga-gcc.yml @@ -0,0 +1,37 @@ +name: amiga-gcc +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + configure_flags: + - + - --disable-amiga-lib + steps: + - name: Install dependencies + run: docker pull amigadev/crosstools:m68k-amigaos + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: | + docker run \ + -e PATH="/opt/m68k-amigaos/bin:$PATH" \ + -v "$PWD:/objfw" \ + amigadev/crosstools:m68k-amigaos \ + sh -c 'cd /objfw && ./configure --host=m68k-amigaos ${{ matrix.configure_flags }}' + - name: make + run: | + docker run \ + -e PATH="/opt/m68k-amigaos/bin:$PATH" \ + -v "$PWD:/objfw" \ + amigadev/crosstools:m68k-amigaos \ + sh -c "cd /objfw && make -j$(nproc)" + - name: make install + run: | + docker run \ + -e PATH="/opt/m68k-amigaos/bin:$PATH" \ + -v "$PWD:/objfw" \ + amigadev/crosstools:m68k-amigaos \ + sh -c "cd /objfw && make -j$(nproc)" ADDED .github/workflows/ios.yml Index: .github/workflows/ios.yml ================================================================== --- .github/workflows/ios.yml +++ .github/workflows/ios.yml @@ -0,0 +1,35 @@ +name: ios +on: [push, pull_request] +jobs: + tests: + runs-on: macos-latest + strategy: + matrix: + arch: + - arm64 + - x86_64 + configure_flags: + - + - --disable-shared + steps: + - name: Install dependencies + run: brew install autoconf automake + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: | + export IPHONEOS_DEPLOYMENT_TARGET="9.0" + if [ "${{ matrix.arch}}" = "x86_64" ]; then + sdk="iphonesimulator" + else + sdk="iphoneos" + fi + export OBJC="clang -isysroot $(xcrun --sdk $sdk --show-sdk-path)" + export OBJC="$OBJC -arch ${{ matrix.arch }}" + ./configure --host=${{ matrix.arch }}-apple-darwin \ + ${{ matrix.configure_flags }} + - name: make + run: make -j$(sysctl -n hw.logicalcpu) + - name: make install + run: sudo make install ADDED .github/workflows/macos-10.15.yml Index: .github/workflows/macos-10.15.yml ================================================================== --- .github/workflows/macos-10.15.yml +++ .github/workflows/macos-10.15.yml @@ -0,0 +1,31 @@ +name: macos-10.15 +on: [push, pull_request] +jobs: + tests: + runs-on: macos-10.15 + strategy: + matrix: + configure_flags: + - + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + steps: + - name: Install dependencies + run: brew install autoconf automake + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure ${{ matrix.configure_flags }} + - name: make + run: make -j$(sysctl -n hw.logicalcpu) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/macos-11.yml Index: .github/workflows/macos-11.yml ================================================================== --- .github/workflows/macos-11.yml +++ .github/workflows/macos-11.yml @@ -0,0 +1,31 @@ +name: macos-11 +on: [push, pull_request] +jobs: + tests: + runs-on: macos-11 + strategy: + matrix: + configure_flags: + - + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + steps: + - name: Install dependencies + run: brew install autoconf automake + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure ${{ matrix.configure_flags }} + - name: make + run: make -j$(sysctl -n hw.logicalcpu) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/nintendo-3ds.yml Index: .github/workflows/nintendo-3ds.yml ================================================================== --- .github/workflows/nintendo-3ds.yml +++ .github/workflows/nintendo-3ds.yml @@ -0,0 +1,35 @@ +name: nintendo-3ds +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: docker pull devkitpro/devkitarm + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitarm \ + sh -c 'cd /objfw && ./configure --host=arm-none-eabi --with-3ds' + - name: make + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitarm \ + sh -c "cd /objfw && make -j$(nproc)" + - name: make install + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitarm \ + sh -c "cd /objfw && make -j$(nproc)" ADDED .github/workflows/nintendo-ds.yml Index: .github/workflows/nintendo-ds.yml ================================================================== --- .github/workflows/nintendo-ds.yml +++ .github/workflows/nintendo-ds.yml @@ -0,0 +1,35 @@ +name: nintendo-ds +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: docker pull devkitpro/devkitarm + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitarm \ + sh -c 'cd /objfw && ./configure --host=arm-none-eabi --with-nds' + - name: make + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitarm \ + sh -c "cd /objfw && make -j$(nproc)" + - name: make install + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitarm \ + sh -c "cd /objfw && make -j$(nproc)" ADDED .github/workflows/ubuntu-18.04-32bit.yml Index: .github/workflows/ubuntu-18.04-32bit.yml ================================================================== --- .github/workflows/ubuntu-18.04-32bit.yml +++ .github/workflows/ubuntu-18.04-32bit.yml @@ -0,0 +1,35 @@ +name: ubuntu-18.04, 32 bit +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-18.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - name: Install dependencies + run: sudo apt install gcc-multilib + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure OBJC="clang -m32" ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-18.04-gcc-32bit.yml Index: .github/workflows/ubuntu-18.04-gcc-32bit.yml ================================================================== --- .github/workflows/ubuntu-18.04-gcc-32bit.yml +++ .github/workflows/ubuntu-18.04-gcc-32bit.yml @@ -0,0 +1,35 @@ +name: ubuntu-18.04, GCC, 32 bit +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-18.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - name: Install dependencies + run: sudo apt install gcc-multilib gobjc + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure OBJC="gcc -m32" ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-18.04-gcc.yml Index: .github/workflows/ubuntu-18.04-gcc.yml ================================================================== --- .github/workflows/ubuntu-18.04-gcc.yml +++ .github/workflows/ubuntu-18.04-gcc.yml @@ -0,0 +1,35 @@ +name: ubuntu-18.04, GCC +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-18.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - name: Install dependencies + run: sudo apt install gobjc + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure OBJC="gcc" ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-18.04.yml Index: .github/workflows/ubuntu-18.04.yml ================================================================== --- .github/workflows/ubuntu-18.04.yml +++ .github/workflows/ubuntu-18.04.yml @@ -0,0 +1,33 @@ +name: ubuntu-18.04 +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-18.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-20.04-32bit.yml Index: .github/workflows/ubuntu-20.04-32bit.yml ================================================================== --- .github/workflows/ubuntu-20.04-32bit.yml +++ .github/workflows/ubuntu-20.04-32bit.yml @@ -0,0 +1,35 @@ +name: ubuntu-20.04, 32 bit +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-20.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - name: Install dependencies + run: sudo apt install gcc-multilib + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure OBJC="clang -m32" ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-20.04-gcc-32bit.yml Index: .github/workflows/ubuntu-20.04-gcc-32bit.yml ================================================================== --- .github/workflows/ubuntu-20.04-gcc-32bit.yml +++ .github/workflows/ubuntu-20.04-gcc-32bit.yml @@ -0,0 +1,35 @@ +name: ubuntu-20.04, GCC, 32 bit +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-20.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - name: Install dependencies + run: sudo apt install gcc-multilib gobjc + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure OBJC="gcc -m32" ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-20.04-gcc.yml Index: .github/workflows/ubuntu-20.04-gcc.yml ================================================================== --- .github/workflows/ubuntu-20.04-gcc.yml +++ .github/workflows/ubuntu-20.04-gcc.yml @@ -0,0 +1,35 @@ +name: ubuntu-20.04, GCC +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-20.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - name: Install dependencies + run: sudo apt install gobjc + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure OBJC="gcc" ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/ubuntu-20.04.yml Index: .github/workflows/ubuntu-20.04.yml ================================================================== --- .github/workflows/ubuntu-20.04.yml +++ .github/workflows/ubuntu-20.04.yml @@ -0,0 +1,33 @@ +name: ubuntu-20.04 +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-20.04 + strategy: + matrix: + configure_flags: + - + - --enable-seluid24 + - --disable-compiler-tls + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + - --disable-shared --enable-seluid24 + - --disable-compiler-tls --disable-threads + steps: + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure ${{ matrix.configure_flags }} + - name: make + run: make -j$(nproc) + - name: make check + run: make check + - name: make install + run: sudo make install ADDED .github/workflows/wii.yml Index: .github/workflows/wii.yml ================================================================== --- .github/workflows/wii.yml +++ .github/workflows/wii.yml @@ -0,0 +1,35 @@ +name: wii +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: docker pull devkitpro/devkitppc + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitPPC/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitppc \ + sh -c 'cd /objfw && ./configure --host=powerpc-eabi --with-wii' + - name: make + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitPPC/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitppc \ + sh -c "cd /objfw && make -j$(nproc)" + - name: make install + run: | + docker run \ + -e DEVKITPRO=/opt/devkitpro \ + -e PATH="/opt/devkitpro/devkitPPC/bin:$PATH" \ + -v "$PWD:/objfw" \ + devkitpro/devkitppc \ + sh -c "cd /objfw && make -j$(nproc)" Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -14,10 +14,13 @@ .PHONY: docs release utils tests: src +check: tests + cd tests && ${MAKE} -s run + docs: rm -fr docs doxygen >/dev/null release: docs Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -994,10 +994,11 @@ ;; esac AC_DEFINE(OF_HAVE_THREADS, 1, [Whether we have threads]) AC_SUBST(USE_SRCS_THREADS, '${SRCS_THREADS}') + AC_SUBST(OBJC_SYNC, objc_sync) AC_ARG_ENABLE(compiler-tls, AS_HELP_STRING([--disable-compiler-tls], [disable compiler thread local storage])) Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -40,10 +40,11 @@ LINKLIB = @LINKLIB@ LOOKUP_ASM_A = @LOOKUP_ASM_A@ LOOKUP_ASM_AMIGALIB_A = @LOOKUP_ASM_AMIGALIB_A@ LOOKUP_ASM_LIB_A = @LOOKUP_ASM_LIB_A@ MAP_LDFLAGS = @MAP_LDFLAGS@ +OBJC_SYNC = @OBJC_SYNC@ OBJFW_LIBS = @OBJFW_LIBS@ OFARC = @OFARC@ OFDNS = @OFDNS@ OFHASH = @OFHASH@ OFHTTP = @OFHTTP@ Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -406,10 +406,11 @@ * @param URL The URL to the directory whose items should be returned * @return An array with the URLs of the items in the specified directory */ - (OFArray OF_GENERIC(OFURL *) *)contentsOfDirectoryAtURL: (OFURL *)URL; +#ifdef OF_HAVE_FILES /** * @brief Returns an array with all subpaths of the specified directory. * * @note `.` and `..` (of the directory itself or any subdirectory) are not * part of the returned array. @@ -417,11 +418,10 @@ * @param path The path to the directory whose subpaths should be returned * @return An array of OFString with the subpaths of the specified directory */ - (OFArray OF_GENERIC(OFString *) *)subpathsOfDirectoryAtPath: (OFString *)path; -#ifdef OF_HAVE_FILES /** * @brief Changes the current working directory. * * @param path The new directory to change to */ Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -1417,10 +1417,15 @@ OFRunLoopState *state = stateForMode(self, mode, false); if (state == nil) return; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wunknown-warning-option" +#pragma GCC diagnostic ignored "-Wmisleading-indentation" + #ifdef OF_HAVE_THREADS [state->_timersQueueMutex lock]; @try { #endif for (OFListItem iter = state->_timersQueue.firstListItem; @@ -1433,10 +1438,12 @@ #ifdef OF_HAVE_THREADS } @finally { [state->_timersQueueMutex unlock]; } #endif + +#pragma GCC diagnostic pop } #ifdef OF_AMIGAOS - (void)addExecSignal: (ULONG)signal target: (id)target selector: (SEL)selector { Index: src/OFUDPSocket.m ================================================================== --- src/OFUDPSocket.m +++ src/OFUDPSocket.m @@ -92,19 +92,17 @@ rnd = (uint16_t)rand(); OFSocketAddressSetPort(address, rnd); if ((ret = bind(_socket, &address->sockaddr.sockaddr, - address->length)) == 0) { - port = rnd; + address->length)) == 0) break; - } if (OFSocketErrNo() != EADDRINUSE) { int errNo = OFSocketErrNo(); OFString *host = OFSocketAddressString(address); - uint16_t port = OFSocketAddressPort(port); + port = OFSocketAddressPort(address); closesocket(_socket); _socket = OFInvalidSocketHandle; @throw [OFBindFailedException Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -586,12 +586,25 @@ OFURLVerifyIsEscaped(_URLEncodedQuery, [OFCharacterSet URLQueryAllowedCharacterSet]); } + /* + * Some versions of GCC issue a false-positive warning + * (turned error) about a string overflow. This is a + * false positive because UTF8String is set to tmp + * above and tmp is either NULL or points *after* the + * slash for the path. So all we do here is go back to + * that slash and restore it. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wunknown-warning-option" +#pragma GCC diagnostic ignored "-Wstringop-overflow" UTF8String--; *UTF8String = '/'; +#pragma GCC diagnostic pop _URLEncodedPath = [[OFString alloc] initWithUTF8String: UTF8String]; OFURLVerifyIsEscaped(_URLEncodedPath, Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -1,9 +1,9 @@ include ../extra.mk SUBDIRS = ${TESTPLUGIN} \ - objc_sync \ + ${OBJC_SYNC} \ terminal CLEAN = EBOOT.PBP \ boot.dol \ ${PROG_NOINST}.arm9 \