From bc3c5a8f9d57c4363dacb7a552aeb14bea51efee Mon Sep 17 00:00:00 2001 From: CGH0S7 <776459475@qq.com> Date: Fri, 7 Feb 2025 16:21:42 +0800 Subject: [PATCH] build fix --- .ci/android.sh | 22 + .ci/clang-format.sh | 37 ++ .ci/ios.sh | 15 + .ci/linux.sh | 34 ++ .ci/macos-universal.sh | 43 ++ .ci/macos.sh | 21 + .ci/pack.sh | 80 +++ .ci/source.sh | 20 + .ci/transifex.sh | 14 + .ci/windows.sh | 17 + .gitattributes | 4 + .gitignore | 62 ++- .gitmodules | 93 ++++ .history/.gitmodules_20250207123101 | 93 ++++ .history/.gitmodules_20250207123201 | 93 ++++ CMakeLists.txt | 28 +- externals/catch2/CMake/llvm-cov-wrapper | 0 externals/catch2/fuzzing/build_fuzzers.sh | 0 .../tests/TestScripts/testBazelSharding.py | 0 .../TestScripts/testPartialTestCaseEvent.py | 0 .../tests/TestScripts/testRandomOrder.py | 0 .../catch2/tests/TestScripts/testSharding.py | 0 .../catch2/tools/scripts/approvalTests.py | 0 externals/catch2/tools/scripts/approve.py | 0 .../catch2/tools/scripts/buildAndTest.sh | 0 .../tools/scripts/checkConvenienceHeaders.py | 0 .../tools/scripts/checkDuplicateFilenames.py | 0 .../catch2/tools/scripts/checkLicense.py | 0 .../catch2/tools/scripts/developBuild.py | 0 .../catch2/tools/scripts/fixWhitespace.py | 0 .../tools/scripts/generateAmalgamatedFiles.py | 0 .../catch2/tools/scripts/majorRelease.py | 0 .../catch2/tools/scripts/minorRelease.py | 0 .../catch2/tools/scripts/patchRelease.py | 0 .../tools/scripts/updateDocumentSnippets.py | 0 .../catch2/tools/scripts/updateDocumentToC.py | 0 .../simple_ex1.dir/DependInfo.cmake | 22 + .../simple_ex1.dir/cmake_clean.cmake | 10 + .../CMakeFiles/simple_ex1.dir/progress.make | 3 + .../cpp-jwt/include/jwt/test/test_base64 | Bin externals/cpp-jwt/include/jwt/test/test_hmac | Bin .../cpp-jwt/include/jwt/test/test_jwt_decode | Bin .../cpp-jwt/include/jwt/test/test_jwt_header | Bin .../cpp-jwt/include/jwt/test/test_jwt_object | Bin .../cpp-jwt/include/jwt/test/test_jwt_payload | Bin .../include/jwt/test/test_jwt_signature | Bin externals/cpp-jwt/include/jwt/test/test_rsa | Bin .../cpp-jwt/include/jwt/test/test_stack_alloc | Bin externals/cpp-jwt/include/jwt/test/test_sv | Bin .../cryptopp/TestScripts/change-version.sh | 0 externals/cryptopp/TestScripts/configure.sh | 0 .../cryptopp/TestScripts/cryptdll-windows.cmd | 0 .../TestScripts/cryptest-android-mk.sh | 0 .../cryptopp/TestScripts/cryptest-android.sh | 0 .../TestScripts/cryptest-autotools.sh | 0 .../cryptopp/TestScripts/cryptest-coverage.sh | 0 .../cryptopp/TestScripts/cryptest-ios.sh | 0 .../cryptopp/TestScripts/cryptest-pem.sh | 0 .../cryptopp/TestScripts/cryptest-symbols.sh | 0 .../cryptopp/TestScripts/cryptest-tidy.sh | 0 externals/cryptopp/TestScripts/cryptest.sh | 0 externals/cryptopp/TestScripts/governor.sh | 0 externals/cryptopp/TestScripts/install-ndk.sh | 0 .../cryptopp/TestScripts/make-benchmarks.sh | 0 externals/cryptopp/TestScripts/reset-fork.sh | 0 .../cryptopp/TestScripts/setenv-android.sh | 0 .../cryptopp/TestScripts/setenv-embedded.sh | 0 externals/cryptopp/TestScripts/setenv-ios.sh | 0 .../cryptopp/TestScripts/setenv-macos.sh | 0 .../cmake/sanitizers-cmake/cmake/asan-wrapper | 0 .../googlemock/test/gmock_leak_test.py | 0 .../googlemock/test/gmock_output_test.py | 0 .../googlemock/test/gmock_test_utils.py | 0 .../googletest-break-on-failure-unittest.py | 0 .../test/googletest-catch-exceptions-test.py | 0 .../googletest/test/googletest-color-test.py | 0 .../test/googletest-env-var-test.py | 0 .../test/googletest-failfast-unittest.py | 0 .../test/googletest-filter-unittest.py | 0 .../test/googletest-list-tests-unittest.py | 0 .../googletest/test/googletest-output-test.py | 0 .../test/googletest-setuptestsuite-test.py | 0 .../test/googletest-shuffle-test.py | 0 .../test/googletest-throw-on-failure-test.py | 0 .../test/googletest-uninitialized-test.py | 0 .../googletest/test/gtest_help_test.py | 0 .../test/gtest_skip_check_output_test.py | 0 ...test_skip_environment_check_output_test.py | 0 .../googletest/test/gtest_test_utils.py | 0 .../googletest/test/gtest_testbridge_test.py | 0 .../test/gtest_xml_outfiles_test.py | 0 .../test/gtest_xml_output_unittest.py | 0 .../googletest/test/gtest_xml_test_utils.py | 0 externals/cubeb/scan-build-install.sh | 0 externals/discord-rpc/build.py | 0 .../externals/catch/CMake/llvm-cov-wrapper | 0 .../externals/catch/fuzzing/build_fuzzers.sh | 0 .../tests/TestScripts/testBazelSharding.py | 0 .../TestScripts/testPartialTestCaseEvent.py | 0 .../tests/TestScripts/testRandomOrder.py | 0 .../catch/tests/TestScripts/testSharding.py | 0 .../catch/tools/scripts/approvalTests.py | 0 .../externals/catch/tools/scripts/approve.py | 0 .../catch/tools/scripts/buildAndTest.sh | 0 .../tools/scripts/checkConvenienceHeaders.py | 0 .../tools/scripts/checkDuplicateFilenames.py | 0 .../catch/tools/scripts/checkLicense.py | 0 .../catch/tools/scripts/developBuild.py | 0 .../catch/tools/scripts/fixWhitespace.py | 0 .../tools/scripts/generateAmalgamatedFiles.py | 0 .../catch/tools/scripts/majorRelease.py | 0 .../catch/tools/scripts/minorRelease.py | 0 .../catch/tools/scripts/patchRelease.py | 0 .../tools/scripts/updateDocumentSnippets.py | 0 .../catch/tools/scripts/updateDocumentToC.py | 0 externals/dynarmic/externals/fmt/doc/build.py | 0 .../externals/fmt/support/build-docs.py | 0 .../externals/fmt/support/compute-powers.py | 0 .../dynarmic/externals/fmt/support/manage.py | 0 .../externals/fmt/support/printable.py | 0 .../dynarmic/externals/fmt/support/rst2md.py | 0 .../externals/fmt/test/fuzzing/build.sh | 0 externals/dynarmic/externals/xbyak/Makefile | 24 + .../dynarmic/externals/xbyak/gen/Makefile | 44 ++ .../dynarmic/externals/xbyak/sample/Makefile | 140 ++++++ .../externals/xbyak/sample/cpuid/cpuid.sh | 0 .../dynarmic/externals/xbyak/test/Makefile | 121 +++++ .../externals/xbyak/test/test_address.sh | 0 .../dynarmic/externals/xbyak/test/test_avx.sh | 0 .../externals/xbyak/test/test_avx512.sh | 0 .../dynarmic/externals/xbyak/test/test_nm.sh | 0 externals/dynarmic/externals/zydis/Makefile | 39 ++ .../externals/zydis/assets/amalgamate.py | 0 .../zydis/assets/screenshots/ZydisInfo.png | Bin .../externals/zydis/tests/regression.py | 0 .../zydis/tests/regression_encoder.py | 0 externals/fmt/doc/build.py | 0 externals/fmt/support/build-docs.py | 0 externals/fmt/support/compute-powers.py | 0 externals/fmt/support/manage.py | 0 externals/fmt/support/printable.py | 0 externals/fmt/test/fuzzing/build.sh | 0 externals/glslang/SPIRV/GlslangToSpv.cpp | 0 externals/glslang/SPIRV/doc.cpp | 0 ...link.vk.inconsistentGLPerVertex.0.vert.out | 0 .../Test/baseResults/spv.nullInit.comp.out | 0 .../Test/baseResults/spv.terminate.frag.out | 0 .../Test/baseResults/terminate.frag.out | 0 .../Test/baseResults/terminate.vert.out | 0 .../baseResults/vk.relaxed.changeSet.vert.out | 0 .../vk.relaxed.stagelink.0.0.vert.out | 0 externals/glslang/Test/bump | 0 externals/glslang/Test/glslangValidator | 0 .../link.vk.inconsistentGLPerVertex.0.geom | 0 .../link.vk.inconsistentGLPerVertex.0.vert | 0 externals/glslang/Test/runtests | 0 .../glslang/Test/spv.ext.AnyHitShader.rahit | 0 .../Test/spv.ext.ClosestHitShader.rchit | 0 externals/glslang/Test/validate-shaders.sh | 0 .../glslang/Test/vk.relaxed.changeSet.frag | 0 .../glslang/Test/vk.relaxed.changeSet.vert | 0 .../Test/vk.relaxed.stagelink.0.0.frag | 0 .../Test/vk.relaxed.stagelink.0.0.vert | 0 .../Test/vk.relaxed.stagelink.0.1.frag | 0 .../Test/vk.relaxed.stagelink.0.1.vert | 0 .../Test/vk.relaxed.stagelink.0.2.frag | 0 .../Test/vk.relaxed.stagelink.0.2.vert | 0 externals/glslang/Test/web.runtests | 0 externals/glslang/build_info.py | 0 externals/glslang/gen_extension_headers.py | 0 externals/glslang/glslang/Include/BaseTypes.h | 0 .../glslang/MachineIndependent/Initialize.cpp | 0 .../glslang/MachineIndependent/Versions.h | 0 externals/glslang/glslang/updateGrammar | 0 .../kokoro/android-ndk-build/build-docker.sh | 0 .../glslang/kokoro/android-ndk-build/build.sh | 0 .../kokoro/license-check/build-docker.sh | 0 .../glslang/kokoro/license-check/build.sh | 0 .../kokoro/linux-clang-cmake/build-docker.sh | 0 .../glslang/kokoro/linux-clang-cmake/build.sh | 0 .../kokoro/linux-clang-gn/build-docker.sh | 0 .../glslang/kokoro/linux-clang-gn/build.sh | 0 .../kokoro/linux-gcc-cmake/build-docker.sh | 0 .../glslang/kokoro/linux-gcc-cmake/build.sh | 0 externals/glslang/update_glslang_sources.py | 0 externals/inih/inih/examples/cpptest.sh | 0 externals/inih/inih/fuzzing/build.sh | 0 externals/inih/inih/fuzzing/fuzz.sh | 0 externals/inih/inih/tests/unittest.sh | 0 externals/libadrenotools/build_asm.sh | 0 .../libadrenotools/tools/blob-patcher.py | 0 externals/libressl/include/compat/pthread.h | 0 .../libusb/libusb/.private/appveyor_build.sh | 0 externals/libusb/libusb/.private/bm.sh | 0 externals/libusb/libusb/.private/ci-build.sh | 0 .../libusb/.private/ci-container-build.sh | 0 .../libusb/libusb/.private/post-rewrite.sh | 0 .../libusb/libusb/.private/pre-commit.sh | 0 externals/libusb/libusb/autogen.sh | 0 externals/libusb/libusb/bootstrap.sh | 0 externals/libyuv/cleanup_links.py | 0 externals/libyuv/infra/config/main.star | 0 externals/libyuv/source/test.sh | 0 .../tools_libyuv/autoroller/roll_deps.py | 0 .../autoroller/unittests/roll_deps_test.py | 0 .../libyuv/tools_libyuv/get_landmines.py | 0 externals/libyuv/util/Makefile | 9 + externals/lodepng/lodepng/Makefile | 34 ++ .../nihstro/examples/assembler/cube/Makefile | 173 +++++++ .../examples/assembler/cube_lighting/Makefile | 173 +++++++ externals/sdl2/SDL/VisualC-GDK/clean.sh | 0 externals/sdl2/SDL/VisualC/clean.sh | 0 externals/sdl2/SDL/android-project/gradlew | 0 externals/sdl2/SDL/autogen.sh | 0 .../sdl2/SDL/build-scripts/android-prefab.sh | 0 .../sdl2/SDL/build-scripts/androidbuild.sh | 0 .../SDL/build-scripts/androidbuildlibs.sh | 0 .../SDL/build-scripts/checker-buildbot.sh | 0 .../sdl2/SDL/build-scripts/clang++-fat.sh | 0 externals/sdl2/SDL/build-scripts/clang-fat.sh | 0 .../SDL/build-scripts/codechecker-buildbot.sh | 0 externals/sdl2/SDL/build-scripts/config.guess | 0 externals/sdl2/SDL/build-scripts/config.sub | 0 .../SDL/build-scripts/emscripten-buildbot.sh | 0 externals/sdl2/SDL/build-scripts/fnsince.pl | 0 .../SDL/build-scripts/git-pre-push-hook.pl | 0 externals/sdl2/SDL/build-scripts/install-sh | 0 .../sdl2/SDL/build-scripts/mkinstalldirs | 0 .../sdl2/SDL/build-scripts/nacl-buildbot.sh | 0 externals/sdl2/SDL/build-scripts/naclbuild.sh | 0 .../SDL/build-scripts/raspberrypi-buildbot.sh | 0 externals/sdl2/SDL/build-scripts/showrev.sh | 0 .../sdl2/SDL/build-scripts/strip_fPIC.sh | 0 .../sdl2/SDL/build-scripts/test-versioning.sh | 0 .../SDL/build-scripts/update-copyright.sh | 0 .../sdl2/SDL/build-scripts/update-version.sh | 0 externals/sdl2/SDL/build-scripts/updaterev.sh | 0 .../sdl2/SDL/build-scripts/wikiheaders.pl | 0 .../sdl2/SDL/cmake/test/test_pkgconfig.sh | 0 .../sdl2/SDL/cmake/test/test_sdlconfig.sh | 0 externals/sdl2/SDL/configure | 0 externals/sdl2/SDL/src/dynapi/gendynapi.pl | 0 externals/sdl2/SDL/src/hidapi/bootstrap | 0 .../SDL/src/hidapi/testgui/copy_to_bundle.sh | 0 .../sdl2/SDL/src/hidapi/testgui/start.sh | 0 .../sdl2/SDL/src/joystick/check_8bitdo.sh | 0 .../sdl2/SDL/src/joystick/sort_controllers.py | 0 .../src/render/metal/build-metal-shaders.sh | 0 externals/sdl2/SDL/src/video/sdlgenblit.pl | 0 externals/sdl2/SDL/test/autogen.sh | 0 externals/sdl2/SDL/test/configure | 0 externals/sdl2/SDL/visualtest/autogen.sh | 0 externals/sdl2/SDL/visualtest/configure | 0 .../sdl2/SDL/visualtest/launch_harness.sh | 0 .../bin/generate_language_headers.py | 0 .../buildHeaders/bin/makeExtinstHeaders.py | 0 .../tools/buildHeaders/bin/makeHeaders | 0 externals/soundtouch/bootstrap | 0 externals/soundtouch/createsrcpack | 0 .../soundtouch/source/Android-lib/gradlew | 0 .../source/SoundTouchDLL/make-gnu-dll.sh | 0 externals/teakra/.travis/linux-build.sh | 0 externals/teakra/.travis/macos-build.sh | 0 externals/teakra/.travis/windows-build.sh | 0 .../teakra/hwtest/dspapbptester/Makefile | 171 +++++++ externals/teakra/hwtest/dspapbptester/rsf.rsf | 0 externals/teakra/hwtest/dspapbptester/send.py | 0 .../teakra/hwtest/dspmemorytester/Makefile | 171 +++++++ .../teakra/hwtest/dspmemorytester/rsf.rsf | 0 .../teakra/hwtest/dspmemorytester/send.py | 0 externals/teakra/hwtest/dsptester/Makefile | 171 +++++++ externals/teakra/hwtest/dsptester/rsf.rsf | 0 .../teakra/hwtest/dsptester/send-program.py | 0 externals/teakra/hwtest/dspvictester/Makefile | 171 +++++++ externals/teakra/hwtest/dspvictester/rsf.rsf | 0 externals/teakra/hwtest/dspvictester/send.py | 0 .../registry/parse_dependency.py | 0 externals/vulkan-headers/registry/stripAPI.py | 0 externals/vulkan-headers/registry/vk.xml | 0 .../vulkan-headers/registry/vkconventions.py | 0 externals/xbyak/Makefile | 24 + externals/xbyak/gen/Makefile | 39 ++ externals/xbyak/sample/Makefile | 128 +++++ externals/xbyak/sample/cpuid/cpuid.sh | 0 externals/xbyak/sample/cpuid/update-txt.sh | 0 externals/xbyak/test/Makefile | 114 +++++ externals/xbyak/test/test_address.sh | 0 externals/xbyak/test/test_avx.sh | 0 externals/xbyak/test/test_avx512.sh | 0 externals/xbyak/test/test_nm.sh | 0 externals/zstd/Makefile | 443 +++++++++++++++++ externals/zstd/contrib/cleanTabs | 0 .../zstd/contrib/diagnose_corruption/Makefile | 35 ++ .../contrib/externalSequenceProducer/Makefile | 40 ++ .../contrib/freestanding_lib/freestanding.py | 0 externals/zstd/contrib/gen_html/Makefile | 51 ++ .../zstd/contrib/gen_html/gen-zstd-manual.sh | 0 externals/zstd/contrib/largeNbDicts/Makefile | 58 +++ externals/zstd/contrib/linux-kernel/Makefile | 108 ++++ .../contrib/linux-kernel/btrfs-benchmark.sh | 0 .../linux-kernel/btrfs-extract-benchmark.sh | 0 .../linux-kernel/squashfs-benchmark.sh | 0 .../zstd/contrib/linux-kernel/test/Makefile | 49 ++ .../contrib/linux-kernel/test/macro-test.sh | 0 externals/zstd/contrib/pzstd/Makefile | 268 ++++++++++ externals/zstd/contrib/recovery/Makefile | 35 ++ .../contrib/seekable_format/examples/Makefile | 53 ++ .../contrib/seekable_format/tests/Makefile | 38 ++ externals/zstd/contrib/seqBench/Makefile | 58 +++ .../zstd/doc/educational_decoder/Makefile | 62 +++ externals/zstd/examples/Makefile | 93 ++++ externals/zstd/lib/Makefile | 357 +++++++++++++ externals/zstd/lib/dll/example/Makefile | 48 ++ externals/zstd/programs/Makefile | 446 +++++++++++++++++ externals/zstd/programs/zstdgrep | 0 externals/zstd/programs/zstdless | 0 .../zstd/tests/DEPRECATED-test-zstd-speed.py | 0 externals/zstd/tests/Makefile | 468 ++++++++++++++++++ externals/zstd/tests/check_size.py | 0 externals/zstd/tests/cli-tests/basic/help.sh | 0 .../zstd/tests/cli-tests/basic/memlimit.sh | 0 .../zstd/tests/cli-tests/basic/output_dir.sh | 0 .../zstd/tests/cli-tests/basic/version.sh | 0 externals/zstd/tests/cli-tests/bin/cmp_size | 0 externals/zstd/tests/cli-tests/bin/datagen | 0 externals/zstd/tests/cli-tests/bin/die | 0 externals/zstd/tests/cli-tests/bin/println | 0 externals/zstd/tests/cli-tests/bin/zstd | 0 externals/zstd/tests/cli-tests/bin/zstdgrep | 0 externals/zstd/tests/cli-tests/bin/zstdless | 0 externals/zstd/tests/cli-tests/cltools/setup | 0 .../zstd/tests/cli-tests/cltools/zstdgrep.sh | 0 .../zstd/tests/cli-tests/cltools/zstdless.sh | 0 .../zstd/tests/cli-tests/compression/adapt.sh | 0 .../zstd/tests/cli-tests/compression/basic.sh | 0 .../compression/compress-literals.sh | 0 .../tests/cli-tests/compression/format.sh | 0 .../tests/cli-tests/compression/golden.sh | 0 .../cli-tests/compression/gzip-compat.sh | 0 .../tests/cli-tests/compression/levels.sh | 0 .../compression/long-distance-matcher.sh | 0 .../cli-tests/compression/multi-threaded.sh | 0 .../cli-tests/compression/multiple-files.sh | 0 .../cli-tests/compression/row-match-finder.sh | 0 .../zstd/tests/cli-tests/compression/setup | 0 .../cli-tests/compression/stream-size.sh | 0 .../cli-tests/compression/verbose-wlog.sh | 0 .../cli-tests/compression/window-resize.sh | 0 .../tests/cli-tests/decompression/golden.sh | 0 .../cli-tests/decompression/pass-through.sh | 0 .../cli-tests/dict-builder/empty-input.sh | 0 .../tests/cli-tests/dict-builder/no-inputs.sh | 0 .../dictionaries/dictionary-mismatch.sh | 0 .../tests/cli-tests/dictionaries/golden.sh | 0 .../zstd/tests/cli-tests/dictionaries/setup | 0 .../tests/cli-tests/dictionaries/setup_once | 0 ...compress-file-to-dir-without-write-perm.sh | 0 .../file-stat/compress-file-to-file.sh | 0 .../file-stat/compress-file-to-stdout.sh | 0 .../file-stat/compress-stdin-to-file.sh | 0 .../file-stat/compress-stdin-to-stdout.sh | 0 .../file-stat/decompress-file-to-file.sh | 0 .../file-stat/decompress-file-to-stdout.sh | 0 .../file-stat/decompress-stdin-to-file.sh | 0 .../file-stat/decompress-stdin-to-stdout.sh | 0 .../tests/cli-tests/progress/no-progress.sh | 0 .../zstd/tests/cli-tests/progress/progress.sh | 0 externals/zstd/tests/cli-tests/run.py | 0 .../zstd/tests/cli-tests/zstd-symlinks/setup | 0 .../tests/cli-tests/zstd-symlinks/zstdcat.sh | 0 externals/zstd/tests/fuzz/Makefile | 270 ++++++++++ externals/zstd/tests/fuzz/fuzz.py | 0 .../tests/fuzz/seq_prod_fuzz_example/Makefile | 16 + externals/zstd/tests/gzip/Makefile | 45 ++ externals/zstd/tests/gzip/gzip-env.sh | 0 externals/zstd/tests/libzstd_builds.sh | 0 externals/zstd/tests/playTests.sh | 0 externals/zstd/tests/rateLimiter.py | 0 externals/zstd/tests/regression/Makefile | 60 +++ externals/zstd/tests/test-license.py | 0 externals/zstd/tests/test-variants.sh | 0 externals/zstd/tests/test-zstd-versions.py | 0 externals/zstd/zlibWrapper/Makefile | 120 +++++ hooks/pre-commit | 0 src/android/gradlew | 0 src/input_common/analog_from_button.cpp | 0 src/input_common/analog_from_button.h | 0 387 files changed, 5651 insertions(+), 27 deletions(-) create mode 100755 .ci/android.sh create mode 100755 .ci/clang-format.sh create mode 100755 .ci/ios.sh create mode 100755 .ci/linux.sh create mode 100755 .ci/macos-universal.sh create mode 100755 .ci/macos.sh create mode 100755 .ci/pack.sh create mode 100755 .ci/source.sh create mode 100755 .ci/transifex.sh create mode 100644 .ci/windows.sh create mode 100644 .gitattributes create mode 100644 .gitmodules create mode 100644 .history/.gitmodules_20250207123101 create mode 100644 .history/.gitmodules_20250207123201 mode change 100644 => 100755 externals/catch2/CMake/llvm-cov-wrapper mode change 100644 => 100755 externals/catch2/fuzzing/build_fuzzers.sh mode change 100644 => 100755 externals/catch2/tests/TestScripts/testBazelSharding.py mode change 100644 => 100755 externals/catch2/tests/TestScripts/testPartialTestCaseEvent.py mode change 100644 => 100755 externals/catch2/tests/TestScripts/testRandomOrder.py mode change 100644 => 100755 externals/catch2/tests/TestScripts/testSharding.py mode change 100644 => 100755 externals/catch2/tools/scripts/approvalTests.py mode change 100644 => 100755 externals/catch2/tools/scripts/approve.py mode change 100644 => 100755 externals/catch2/tools/scripts/buildAndTest.sh mode change 100644 => 100755 externals/catch2/tools/scripts/checkConvenienceHeaders.py mode change 100644 => 100755 externals/catch2/tools/scripts/checkDuplicateFilenames.py mode change 100644 => 100755 externals/catch2/tools/scripts/checkLicense.py mode change 100644 => 100755 externals/catch2/tools/scripts/developBuild.py mode change 100644 => 100755 externals/catch2/tools/scripts/fixWhitespace.py mode change 100644 => 100755 externals/catch2/tools/scripts/generateAmalgamatedFiles.py mode change 100644 => 100755 externals/catch2/tools/scripts/majorRelease.py mode change 100644 => 100755 externals/catch2/tools/scripts/minorRelease.py mode change 100644 => 100755 externals/catch2/tools/scripts/patchRelease.py mode change 100644 => 100755 externals/catch2/tools/scripts/updateDocumentSnippets.py mode change 100644 => 100755 externals/catch2/tools/scripts/updateDocumentToC.py create mode 100644 externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake create mode 100644 externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/cmake_clean.cmake create mode 100644 externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/progress.make mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_base64 mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_hmac mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_jwt_decode mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_jwt_header mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_jwt_object mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_jwt_payload mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_jwt_signature mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_rsa mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_stack_alloc mode change 100644 => 100755 externals/cpp-jwt/include/jwt/test/test_sv mode change 100644 => 100755 externals/cryptopp/TestScripts/change-version.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/configure.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptdll-windows.cmd mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-android-mk.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-android.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-autotools.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-coverage.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-ios.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-pem.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-symbols.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest-tidy.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/cryptest.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/governor.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/install-ndk.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/make-benchmarks.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/reset-fork.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/setenv-android.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/setenv-embedded.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/setenv-ios.sh mode change 100644 => 100755 externals/cryptopp/TestScripts/setenv-macos.sh mode change 100644 => 100755 externals/cubeb/cmake/sanitizers-cmake/cmake/asan-wrapper mode change 100644 => 100755 externals/cubeb/googletest/googlemock/test/gmock_leak_test.py mode change 100644 => 100755 externals/cubeb/googletest/googlemock/test/gmock_output_test.py mode change 100644 => 100755 externals/cubeb/googletest/googlemock/test/gmock_test_utils.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-break-on-failure-unittest.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-catch-exceptions-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-color-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-env-var-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-failfast-unittest.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-filter-unittest.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-list-tests-unittest.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-output-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-setuptestsuite-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-shuffle-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-throw-on-failure-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/googletest-uninitialized-test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_help_test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_skip_check_output_test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_skip_environment_check_output_test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_test_utils.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_testbridge_test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_xml_outfiles_test.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_xml_output_unittest.py mode change 100644 => 100755 externals/cubeb/googletest/googletest/test/gtest_xml_test_utils.py mode change 100644 => 100755 externals/cubeb/scan-build-install.sh mode change 100644 => 100755 externals/discord-rpc/build.py mode change 100644 => 100755 externals/dynarmic/externals/catch/CMake/llvm-cov-wrapper mode change 100644 => 100755 externals/dynarmic/externals/catch/fuzzing/build_fuzzers.sh mode change 100644 => 100755 externals/dynarmic/externals/catch/tests/TestScripts/testBazelSharding.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tests/TestScripts/testPartialTestCaseEvent.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tests/TestScripts/testRandomOrder.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tests/TestScripts/testSharding.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/approvalTests.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/approve.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/buildAndTest.sh mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/checkConvenienceHeaders.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/checkDuplicateFilenames.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/checkLicense.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/developBuild.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/fixWhitespace.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/generateAmalgamatedFiles.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/majorRelease.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/minorRelease.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/patchRelease.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/updateDocumentSnippets.py mode change 100644 => 100755 externals/dynarmic/externals/catch/tools/scripts/updateDocumentToC.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/doc/build.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/support/build-docs.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/support/compute-powers.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/support/manage.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/support/printable.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/support/rst2md.py mode change 100644 => 100755 externals/dynarmic/externals/fmt/test/fuzzing/build.sh create mode 100644 externals/dynarmic/externals/xbyak/Makefile create mode 100644 externals/dynarmic/externals/xbyak/gen/Makefile create mode 100644 externals/dynarmic/externals/xbyak/sample/Makefile mode change 100644 => 100755 externals/dynarmic/externals/xbyak/sample/cpuid/cpuid.sh create mode 100644 externals/dynarmic/externals/xbyak/test/Makefile mode change 100644 => 100755 externals/dynarmic/externals/xbyak/test/test_address.sh mode change 100644 => 100755 externals/dynarmic/externals/xbyak/test/test_avx.sh mode change 100644 => 100755 externals/dynarmic/externals/xbyak/test/test_avx512.sh mode change 100644 => 100755 externals/dynarmic/externals/xbyak/test/test_nm.sh create mode 100644 externals/dynarmic/externals/zydis/Makefile mode change 100644 => 100755 externals/dynarmic/externals/zydis/assets/amalgamate.py mode change 100644 => 100755 externals/dynarmic/externals/zydis/assets/screenshots/ZydisInfo.png mode change 100644 => 100755 externals/dynarmic/externals/zydis/tests/regression.py mode change 100644 => 100755 externals/dynarmic/externals/zydis/tests/regression_encoder.py mode change 100644 => 100755 externals/fmt/doc/build.py mode change 100644 => 100755 externals/fmt/support/build-docs.py mode change 100644 => 100755 externals/fmt/support/compute-powers.py mode change 100644 => 100755 externals/fmt/support/manage.py mode change 100644 => 100755 externals/fmt/support/printable.py mode change 100644 => 100755 externals/fmt/test/fuzzing/build.sh mode change 100644 => 100755 externals/glslang/SPIRV/GlslangToSpv.cpp mode change 100644 => 100755 externals/glslang/SPIRV/doc.cpp mode change 100644 => 100755 externals/glslang/Test/baseResults/link.vk.inconsistentGLPerVertex.0.vert.out mode change 100644 => 100755 externals/glslang/Test/baseResults/spv.nullInit.comp.out mode change 100644 => 100755 externals/glslang/Test/baseResults/spv.terminate.frag.out mode change 100644 => 100755 externals/glslang/Test/baseResults/terminate.frag.out mode change 100644 => 100755 externals/glslang/Test/baseResults/terminate.vert.out mode change 100644 => 100755 externals/glslang/Test/baseResults/vk.relaxed.changeSet.vert.out mode change 100644 => 100755 externals/glslang/Test/baseResults/vk.relaxed.stagelink.0.0.vert.out mode change 100644 => 100755 externals/glslang/Test/bump mode change 100644 => 100755 externals/glslang/Test/glslangValidator mode change 100644 => 100755 externals/glslang/Test/link.vk.inconsistentGLPerVertex.0.geom mode change 100644 => 100755 externals/glslang/Test/link.vk.inconsistentGLPerVertex.0.vert mode change 100644 => 100755 externals/glslang/Test/runtests mode change 100644 => 100755 externals/glslang/Test/spv.ext.AnyHitShader.rahit mode change 100644 => 100755 externals/glslang/Test/spv.ext.ClosestHitShader.rchit mode change 100644 => 100755 externals/glslang/Test/validate-shaders.sh mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.changeSet.frag mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.changeSet.vert mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.stagelink.0.0.frag mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.stagelink.0.0.vert mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.stagelink.0.1.frag mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.stagelink.0.1.vert mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.stagelink.0.2.frag mode change 100644 => 100755 externals/glslang/Test/vk.relaxed.stagelink.0.2.vert mode change 100644 => 100755 externals/glslang/Test/web.runtests mode change 100644 => 100755 externals/glslang/build_info.py mode change 100644 => 100755 externals/glslang/gen_extension_headers.py mode change 100644 => 100755 externals/glslang/glslang/Include/BaseTypes.h mode change 100644 => 100755 externals/glslang/glslang/MachineIndependent/Initialize.cpp mode change 100644 => 100755 externals/glslang/glslang/MachineIndependent/Versions.h mode change 100644 => 100755 externals/glslang/glslang/updateGrammar mode change 100644 => 100755 externals/glslang/kokoro/android-ndk-build/build-docker.sh mode change 100644 => 100755 externals/glslang/kokoro/android-ndk-build/build.sh mode change 100644 => 100755 externals/glslang/kokoro/license-check/build-docker.sh mode change 100644 => 100755 externals/glslang/kokoro/license-check/build.sh mode change 100644 => 100755 externals/glslang/kokoro/linux-clang-cmake/build-docker.sh mode change 100644 => 100755 externals/glslang/kokoro/linux-clang-cmake/build.sh mode change 100644 => 100755 externals/glslang/kokoro/linux-clang-gn/build-docker.sh mode change 100644 => 100755 externals/glslang/kokoro/linux-clang-gn/build.sh mode change 100644 => 100755 externals/glslang/kokoro/linux-gcc-cmake/build-docker.sh mode change 100644 => 100755 externals/glslang/kokoro/linux-gcc-cmake/build.sh mode change 100644 => 100755 externals/glslang/update_glslang_sources.py mode change 100644 => 100755 externals/inih/inih/examples/cpptest.sh mode change 100644 => 100755 externals/inih/inih/fuzzing/build.sh mode change 100644 => 100755 externals/inih/inih/fuzzing/fuzz.sh mode change 100644 => 100755 externals/inih/inih/tests/unittest.sh mode change 100644 => 100755 externals/libadrenotools/build_asm.sh mode change 100644 => 100755 externals/libadrenotools/tools/blob-patcher.py mode change 100644 => 100755 externals/libressl/include/compat/pthread.h mode change 100644 => 100755 externals/libusb/libusb/.private/appveyor_build.sh mode change 100644 => 100755 externals/libusb/libusb/.private/bm.sh mode change 100644 => 100755 externals/libusb/libusb/.private/ci-build.sh mode change 100644 => 100755 externals/libusb/libusb/.private/ci-container-build.sh mode change 100644 => 100755 externals/libusb/libusb/.private/post-rewrite.sh mode change 100644 => 100755 externals/libusb/libusb/.private/pre-commit.sh mode change 100644 => 100755 externals/libusb/libusb/autogen.sh mode change 100644 => 100755 externals/libusb/libusb/bootstrap.sh mode change 100644 => 100755 externals/libyuv/cleanup_links.py mode change 100644 => 100755 externals/libyuv/infra/config/main.star mode change 100644 => 100755 externals/libyuv/source/test.sh mode change 100644 => 100755 externals/libyuv/tools_libyuv/autoroller/roll_deps.py mode change 100644 => 100755 externals/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py mode change 100644 => 100755 externals/libyuv/tools_libyuv/get_landmines.py create mode 100644 externals/libyuv/util/Makefile create mode 100644 externals/lodepng/lodepng/Makefile create mode 100644 externals/nihstro/examples/assembler/cube/Makefile create mode 100644 externals/nihstro/examples/assembler/cube_lighting/Makefile mode change 100644 => 100755 externals/sdl2/SDL/VisualC-GDK/clean.sh mode change 100644 => 100755 externals/sdl2/SDL/VisualC/clean.sh mode change 100644 => 100755 externals/sdl2/SDL/android-project/gradlew mode change 100644 => 100755 externals/sdl2/SDL/autogen.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/android-prefab.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/androidbuild.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/androidbuildlibs.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/checker-buildbot.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/clang++-fat.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/clang-fat.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/codechecker-buildbot.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/config.guess mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/config.sub mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/emscripten-buildbot.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/fnsince.pl mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/git-pre-push-hook.pl mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/install-sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/mkinstalldirs mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/nacl-buildbot.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/naclbuild.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/raspberrypi-buildbot.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/showrev.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/strip_fPIC.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/test-versioning.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/update-copyright.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/update-version.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/updaterev.sh mode change 100644 => 100755 externals/sdl2/SDL/build-scripts/wikiheaders.pl mode change 100644 => 100755 externals/sdl2/SDL/cmake/test/test_pkgconfig.sh mode change 100644 => 100755 externals/sdl2/SDL/cmake/test/test_sdlconfig.sh mode change 100644 => 100755 externals/sdl2/SDL/configure mode change 100644 => 100755 externals/sdl2/SDL/src/dynapi/gendynapi.pl mode change 100644 => 100755 externals/sdl2/SDL/src/hidapi/bootstrap mode change 100644 => 100755 externals/sdl2/SDL/src/hidapi/testgui/copy_to_bundle.sh mode change 100644 => 100755 externals/sdl2/SDL/src/hidapi/testgui/start.sh mode change 100644 => 100755 externals/sdl2/SDL/src/joystick/check_8bitdo.sh mode change 100644 => 100755 externals/sdl2/SDL/src/joystick/sort_controllers.py mode change 100644 => 100755 externals/sdl2/SDL/src/render/metal/build-metal-shaders.sh mode change 100644 => 100755 externals/sdl2/SDL/src/video/sdlgenblit.pl mode change 100644 => 100755 externals/sdl2/SDL/test/autogen.sh mode change 100644 => 100755 externals/sdl2/SDL/test/configure mode change 100644 => 100755 externals/sdl2/SDL/visualtest/autogen.sh mode change 100644 => 100755 externals/sdl2/SDL/visualtest/configure mode change 100644 => 100755 externals/sdl2/SDL/visualtest/launch_harness.sh mode change 100644 => 100755 externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py mode change 100644 => 100755 externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py mode change 100644 => 100755 externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/makeHeaders mode change 100644 => 100755 externals/soundtouch/bootstrap mode change 100644 => 100755 externals/soundtouch/createsrcpack mode change 100644 => 100755 externals/soundtouch/source/Android-lib/gradlew mode change 100644 => 100755 externals/soundtouch/source/SoundTouchDLL/make-gnu-dll.sh mode change 100644 => 100755 externals/teakra/.travis/linux-build.sh mode change 100644 => 100755 externals/teakra/.travis/macos-build.sh mode change 100644 => 100755 externals/teakra/.travis/windows-build.sh create mode 100644 externals/teakra/hwtest/dspapbptester/Makefile mode change 100644 => 100755 externals/teakra/hwtest/dspapbptester/rsf.rsf mode change 100644 => 100755 externals/teakra/hwtest/dspapbptester/send.py create mode 100644 externals/teakra/hwtest/dspmemorytester/Makefile mode change 100644 => 100755 externals/teakra/hwtest/dspmemorytester/rsf.rsf mode change 100644 => 100755 externals/teakra/hwtest/dspmemorytester/send.py create mode 100644 externals/teakra/hwtest/dsptester/Makefile mode change 100644 => 100755 externals/teakra/hwtest/dsptester/rsf.rsf mode change 100644 => 100755 externals/teakra/hwtest/dsptester/send-program.py create mode 100644 externals/teakra/hwtest/dspvictester/Makefile mode change 100644 => 100755 externals/teakra/hwtest/dspvictester/rsf.rsf mode change 100644 => 100755 externals/teakra/hwtest/dspvictester/send.py mode change 100644 => 100755 externals/vulkan-headers/registry/parse_dependency.py mode change 100644 => 100755 externals/vulkan-headers/registry/stripAPI.py mode change 100644 => 100755 externals/vulkan-headers/registry/vk.xml mode change 100644 => 100755 externals/vulkan-headers/registry/vkconventions.py create mode 100644 externals/xbyak/Makefile create mode 100644 externals/xbyak/gen/Makefile create mode 100644 externals/xbyak/sample/Makefile mode change 100644 => 100755 externals/xbyak/sample/cpuid/cpuid.sh mode change 100644 => 100755 externals/xbyak/sample/cpuid/update-txt.sh create mode 100644 externals/xbyak/test/Makefile mode change 100644 => 100755 externals/xbyak/test/test_address.sh mode change 100644 => 100755 externals/xbyak/test/test_avx.sh mode change 100644 => 100755 externals/xbyak/test/test_avx512.sh mode change 100644 => 100755 externals/xbyak/test/test_nm.sh create mode 100644 externals/zstd/Makefile mode change 100644 => 100755 externals/zstd/contrib/cleanTabs create mode 100644 externals/zstd/contrib/diagnose_corruption/Makefile create mode 100644 externals/zstd/contrib/externalSequenceProducer/Makefile mode change 100644 => 100755 externals/zstd/contrib/freestanding_lib/freestanding.py create mode 100644 externals/zstd/contrib/gen_html/Makefile mode change 100644 => 100755 externals/zstd/contrib/gen_html/gen-zstd-manual.sh create mode 100644 externals/zstd/contrib/largeNbDicts/Makefile create mode 100644 externals/zstd/contrib/linux-kernel/Makefile mode change 100644 => 100755 externals/zstd/contrib/linux-kernel/btrfs-benchmark.sh mode change 100644 => 100755 externals/zstd/contrib/linux-kernel/btrfs-extract-benchmark.sh mode change 100644 => 100755 externals/zstd/contrib/linux-kernel/squashfs-benchmark.sh create mode 100644 externals/zstd/contrib/linux-kernel/test/Makefile mode change 100644 => 100755 externals/zstd/contrib/linux-kernel/test/macro-test.sh create mode 100644 externals/zstd/contrib/pzstd/Makefile create mode 100644 externals/zstd/contrib/recovery/Makefile create mode 100644 externals/zstd/contrib/seekable_format/examples/Makefile create mode 100644 externals/zstd/contrib/seekable_format/tests/Makefile create mode 100644 externals/zstd/contrib/seqBench/Makefile create mode 100644 externals/zstd/doc/educational_decoder/Makefile create mode 100644 externals/zstd/examples/Makefile create mode 100644 externals/zstd/lib/Makefile create mode 100644 externals/zstd/lib/dll/example/Makefile create mode 100644 externals/zstd/programs/Makefile mode change 100644 => 100755 externals/zstd/programs/zstdgrep mode change 100644 => 100755 externals/zstd/programs/zstdless mode change 100644 => 100755 externals/zstd/tests/DEPRECATED-test-zstd-speed.py create mode 100644 externals/zstd/tests/Makefile mode change 100644 => 100755 externals/zstd/tests/check_size.py mode change 100644 => 100755 externals/zstd/tests/cli-tests/basic/help.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/basic/memlimit.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/basic/output_dir.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/basic/version.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/cmp_size mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/datagen mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/die mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/println mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/zstd mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/zstdgrep mode change 100644 => 100755 externals/zstd/tests/cli-tests/bin/zstdless mode change 100644 => 100755 externals/zstd/tests/cli-tests/cltools/setup mode change 100644 => 100755 externals/zstd/tests/cli-tests/cltools/zstdgrep.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/cltools/zstdless.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/adapt.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/basic.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/compress-literals.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/format.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/golden.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/gzip-compat.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/levels.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/long-distance-matcher.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/multi-threaded.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/multiple-files.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/row-match-finder.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/setup mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/stream-size.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/verbose-wlog.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/compression/window-resize.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/decompression/golden.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/decompression/pass-through.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/dict-builder/empty-input.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/dict-builder/no-inputs.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/dictionaries/golden.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/dictionaries/setup mode change 100644 => 100755 externals/zstd/tests/cli-tests/dictionaries/setup_once mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/progress/no-progress.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/progress/progress.sh mode change 100644 => 100755 externals/zstd/tests/cli-tests/run.py mode change 100644 => 100755 externals/zstd/tests/cli-tests/zstd-symlinks/setup mode change 100644 => 100755 externals/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh create mode 100644 externals/zstd/tests/fuzz/Makefile mode change 100644 => 100755 externals/zstd/tests/fuzz/fuzz.py create mode 100644 externals/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile create mode 100644 externals/zstd/tests/gzip/Makefile mode change 100644 => 100755 externals/zstd/tests/gzip/gzip-env.sh mode change 100644 => 100755 externals/zstd/tests/libzstd_builds.sh mode change 100644 => 100755 externals/zstd/tests/playTests.sh mode change 100644 => 100755 externals/zstd/tests/rateLimiter.py create mode 100644 externals/zstd/tests/regression/Makefile mode change 100644 => 100755 externals/zstd/tests/test-license.py mode change 100644 => 100755 externals/zstd/tests/test-variants.sh mode change 100644 => 100755 externals/zstd/tests/test-zstd-versions.py create mode 100644 externals/zstd/zlibWrapper/Makefile mode change 100644 => 100755 hooks/pre-commit mode change 100644 => 100755 src/android/gradlew mode change 100644 => 100755 src/input_common/analog_from_button.cpp mode change 100644 => 100755 src/input_common/analog_from_button.h diff --git a/.ci/android.sh b/.ci/android.sh new file mode 100755 index 00000000..3cfa902f --- /dev/null +++ b/.ci/android.sh @@ -0,0 +1,22 @@ +#!/bin/bash -ex + +export NDK_CCACHE=$(which ccache) +[ "$GITHUB_REPOSITORY" = "citra-emu/citra-canary" ] && + BUILD_FLAVOR=canary || + BUILD_FLAVOR=nightly + +if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then + export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks" + base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}" +fi + +cd src/android +chmod +x ./gradlew +./gradlew assemble${BUILD_FLAVOR}Release +./gradlew bundle${BUILD_FLAVOR}Release + +ccache -s -v + +if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then + rm "${ANDROID_KEYSTORE_FILE}" +fi diff --git a/.ci/clang-format.sh b/.ci/clang-format.sh new file mode 100755 index 00000000..8aa078f0 --- /dev/null +++ b/.ci/clang-format.sh @@ -0,0 +1,37 @@ +#!/bin/bash -ex + +if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \ + dist/*.svg dist/*.xml; then + echo Trailing whitespace found, aborting + exit 1 +fi + +# Default clang-format points to default 3.5 version one +CLANG_FORMAT=clang-format-15 +$CLANG_FORMAT --version + +if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then + # Get list of every file modified in this pull request + files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)" +else + # Check everything for branch pushes + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" +fi + +# Turn off tracing for this because it's too verbose +set +x + +for f in $files_to_lint; do + d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true) + if ! [ -z "$d" ]; then + echo "!!! $f not compliant to coding style, here is the fix:" + echo "$d" + fail=1 + fi +done + +set -x + +if [ "$fail" = 1 ]; then + exit 1 +fi diff --git a/.ci/ios.sh b/.ci/ios.sh new file mode 100755 index 00000000..92e1776c --- /dev/null +++ b/.ci/ios.sh @@ -0,0 +1,15 @@ +#!/bin/bash -ex + +mkdir build && cd build +cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SYSTEM_NAME=iOS \ + -DCMAKE_OSX_ARCHITECTURES=arm64 \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DENABLE_QT_TRANSLATION=ON \ + -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON +ninja + +ccache -s -v diff --git a/.ci/linux.sh b/.ci/linux.sh new file mode 100755 index 00000000..2ef48bb4 --- /dev/null +++ b/.ci/linux.sh @@ -0,0 +1,34 @@ +#!/bin/bash -ex + +if [ "$TARGET" = "appimage" ]; then + # Compile the AppImage we distribute with Clang. + export EXTRA_CMAKE_FLAGS=(-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=/etc/bin/ld.lld) + # Bundle required QT wayland libraries + export EXTRA_QT_PLUGINS="waylandcompositor" + export EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so" +else + # For the linux-fresh verification target, verify compilation without PCH as well. + export EXTRA_CMAKE_FLAGS=(-DCITRA_USE_PRECOMPILED_HEADERS=OFF) +fi + +mkdir build && cd build +cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + "${EXTRA_CMAKE_FLAGS[@]}" \ + -DENABLE_QT_TRANSLATION=ON \ + -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ + -DUSE_DISCORD_PRESENCE=ON +ninja + +if [ "$TARGET" = "appimage" ]; then + ninja bundle + # TODO: Our AppImage environment currently uses an older ccache version without the verbose flag. + ccache -s +else + ccache -s -v +fi + +ctest -VV -C Release diff --git a/.ci/macos-universal.sh b/.ci/macos-universal.sh new file mode 100755 index 00000000..57a0a60a --- /dev/null +++ b/.ci/macos-universal.sh @@ -0,0 +1,43 @@ +#!/bin/bash -ex + +ARTIFACTS_LIST=($ARTIFACTS) + +BUNDLE_DIR=build/bundle +mkdir build + +# Set up the base artifact to combine into. +BASE_ARTIFACT=${ARTIFACTS_LIST[0]} +BASE_ARTIFACT_ARCH="${BASE_ARTIFACT##*-}" +mv $BASE_ARTIFACT $BUNDLE_DIR + +# Executable binary paths that need to be combined. +BIN_PATHS=(citra citra-room citra-qt.app/Contents/MacOS/citra-qt) + +# Dylib paths that need to be combined. +IFS=$'\n' +DYLIB_PATHS=($(cd $BUNDLE_DIR && find . -name '*.dylib')) +unset IFS + +# Combine all of the executable binaries and dylibs. +for OTHER_ARTIFACT in "${ARTIFACTS_LIST[@]:1}"; do + OTHER_ARTIFACT_ARCH="${OTHER_ARTIFACT##*-}" + + for BIN_PATH in "${BIN_PATHS[@]}"; do + lipo -create -output $BUNDLE_DIR/$BIN_PATH $BUNDLE_DIR/$BIN_PATH $OTHER_ARTIFACT/$BIN_PATH + done + + for DYLIB_PATH in "${DYLIB_PATHS[@]}"; do + # Only merge if the libraries do not have conflicting arches, otherwise it will fail. + DYLIB_INFO=`file $BUNDLE_DIR/$DYLIB_PATH` + OTHER_DYLIB_INFO=`file $OTHER_ARTIFACT/$DYLIB_PATH` + if ! [[ "$DYLIB_INFO" =~ "$OTHER_ARTIFACT_ARCH" ]] && ! [[ "$OTHER_DYLIB_INFO" =~ "$BASE_ARTIFACT_ARCH" ]]; then + lipo -create -output $BUNDLE_DIR/$DYLIB_PATH $BUNDLE_DIR/$DYLIB_PATH $OTHER_ARTIFACT/$DYLIB_PATH + fi + done +done + +# Re-sign executables and bundles after combining. +APP_PATHS=(citra citra-room citra-qt.app) +for APP_PATH in "${APP_PATHS[@]}"; do + codesign --deep -fs - $BUNDLE_DIR/$APP_PATH +done diff --git a/.ci/macos.sh b/.ci/macos.sh new file mode 100755 index 00000000..c4e2a284 --- /dev/null +++ b/.ci/macos.sh @@ -0,0 +1,21 @@ +#!/bin/bash -ex + +mkdir build && cd build +cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_OSX_ARCHITECTURES="$TARGET" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DENABLE_QT_TRANSLATION=ON \ + -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ + -DUSE_DISCORD_PRESENCE=ON +ninja +ninja bundle + +ccache -s -v + +CURRENT_ARCH=`arch` +if [ "$TARGET" = "$CURRENT_ARCH" ]; then + ctest -VV -C Release +fi diff --git a/.ci/pack.sh b/.ci/pack.sh new file mode 100755 index 00000000..67275954 --- /dev/null +++ b/.ci/pack.sh @@ -0,0 +1,80 @@ +#!/bin/bash -ex + +# Determine the full revision name. +GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" +GITREV="`git show -s --format='%h'`" +REV_NAME="citra-$OS-$TARGET-$GITDATE-$GITREV" + +# Determine the name of the release being built. +if [[ "$GITHUB_REF_NAME" =~ ^canary- ]] || [[ "$GITHUB_REF_NAME" =~ ^nightly- ]]; then + RELEASE_NAME=$(echo $GITHUB_REF_NAME | cut -d- -f1) +else + RELEASE_NAME=head +fi + +# Archive and upload the artifacts. +mkdir artifacts + +function pack_artifacts() { + ARTIFACTS_PATH="$1" + + # Set up root directory for archive. + mkdir "$REV_NAME" + if [ -f "$ARTIFACTS_PATH" ]; then + mv "$ARTIFACTS_PATH" "$REV_NAME" + + # Use file extension to differentiate archives. + FILENAME=$(basename "$ARTIFACT") + EXTENSION="${FILENAME##*.}" + ARCHIVE_NAME="$REV_NAME.$EXTENSION" + else + mv "$ARTIFACTS_PATH"/* "$REV_NAME" + + ARCHIVE_NAME="$REV_NAME" + fi + + # Create .zip/.tar.gz + if [ "$OS" = "windows" ]; then + ARCHIVE_FULL_NAME="$ARCHIVE_NAME.zip" + powershell Compress-Archive "$REV_NAME" "$ARCHIVE_FULL_NAME" + elif [ "$OS" = "android" ]; then + ARCHIVE_FULL_NAME="$ARCHIVE_NAME.zip" + zip -r "$ARCHIVE_FULL_NAME" "$REV_NAME" + else + ARCHIVE_FULL_NAME="$ARCHIVE_NAME.tar.gz" + tar czvf "$ARCHIVE_FULL_NAME" "$REV_NAME" + fi + mv "$ARCHIVE_FULL_NAME" artifacts/ + + if [ -z "$SKIP_7Z" ]; then + # Create .7z + ARCHIVE_FULL_NAME="$ARCHIVE_NAME.7z" + mv "$REV_NAME" "$RELEASE_NAME" + 7z a "$ARCHIVE_FULL_NAME" "$RELEASE_NAME" + mv "$ARCHIVE_FULL_NAME" artifacts/ + + # Clean up created release artifacts directory. + rm -rf "$RELEASE_NAME" + else + # Clean up created rev artifacts directory. + rm -rf "$REV_NAME" + fi +} + +if [ -n "$UNPACKED" ]; then + # Copy the artifacts to be uploaded unpacked. + for ARTIFACT in build/bundle/*; do + FILENAME=$(basename "$ARTIFACT") + EXTENSION="${FILENAME##*.}" + + mv "$ARTIFACT" "artifacts/$REV_NAME.$EXTENSION" + done +elif [ -n "$PACK_INDIVIDUALLY" ]; then + # Pack and upload the artifacts one-by-one. + for ARTIFACT in build/bundle/*; do + pack_artifacts "$ARTIFACT" + done +else + # Pack all of the artifacts into a single archive. + pack_artifacts build/bundle +fi diff --git a/.ci/source.sh b/.ci/source.sh new file mode 100755 index 00000000..76f92f10 --- /dev/null +++ b/.ci/source.sh @@ -0,0 +1,20 @@ +#!/bin/bash -ex + +GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" +GITREV="`git show -s --format='%h'`" +REV_NAME="citra-unified-source-${GITDATE}-${GITREV}" + +COMPAT_LIST='dist/compatibility_list/compatibility_list.json' + +mkdir artifacts + +pip3 install git-archive-all +touch "${COMPAT_LIST}" +git describe --abbrev=0 --always HEAD > GIT-COMMIT +git describe --tags HEAD > GIT-TAG || echo 'unknown' > GIT-TAG +git archive-all --include "${COMPAT_LIST}" --include GIT-COMMIT --include GIT-TAG --force-submodules artifacts/"${REV_NAME}.tar" + +cd artifacts/ +xz -T0 -9 "${REV_NAME}.tar" +sha256sum "${REV_NAME}.tar.xz" > "${REV_NAME}.tar.xz.sha256sum" +cd .. diff --git a/.ci/transifex.sh b/.ci/transifex.sh new file mode 100755 index 00000000..c51af2d2 --- /dev/null +++ b/.ci/transifex.sh @@ -0,0 +1,14 @@ +#!/bin/bash -ex + +echo -e "\e[1m\e[33mBuild tools information:\e[0m" +cmake --version +gcc -v +tx --version + +mkdir build && cd build +cmake .. -DENABLE_QT_TRANSLATION=ON -DGENERATE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF +make translation +cd .. + +cd dist/languages +tx push -s diff --git a/.ci/windows.sh b/.ci/windows.sh new file mode 100644 index 00000000..825f6ca4 --- /dev/null +++ b/.ci/windows.sh @@ -0,0 +1,17 @@ +#!/bin/sh -ex + +mkdir build && cd build +cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DENABLE_QT_TRANSLATION=ON \ + -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ + -DUSE_DISCORD_PRESENCE=ON +ninja +ninja bundle + +ccache -s -v + +ctest -VV -C Release || echo "::error ::Test error occurred on Windows build" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ab861a39 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +dist/languages/* linguist-vendored +dist/qt_themes/* linguist-vendored +externals/* linguist-vendored +*.h linguist-language=cpp diff --git a/.gitignore b/.gitignore index af068662..062c7ce8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,50 @@ -# ---> CMake -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps -build +# Build directory +[Bb]uild*/ +doc-build/ +build-*/ +# Generated source files +src/common/scm_rev.cpp +.travis.descriptor.json + +# Project/editor files +*.swp +*.kdev4 +.idea/ +.vs/ +.vscode/ +.cache/ +.kdev4/ +cmake-build-debug/ +cmake-build-release/ +CMakeLists.txt.user* + +# *nix related +# Common convention for backup or temporary files +*~ + +# Visual Studio CMake settings +CMakeSettings.json + +# OSX global filetypes +# Created by Finder or Spotlight in directories for various OS functionality (indexing, etc) +.DS_Store +.AppleDouble +.LSOverride +.Spotlight-V100 +.Trashes + +# Windows global filetypes +Thumbs.db + +# Python files +*.pyc + +# Flatpak generated files +.flatpak-builder/ +repo/ + +# GitHub Actions generated files +.ccache/ +node_modules/ +VULKAN_SDK/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..ec51ef44 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,93 @@ +[submodule "boost"] + path = externals/boost + url = https://github.com/PabloMK7/ext-boost.git +[submodule "nihstro"] + path = externals/nihstro + url = https://github.com/neobrain/nihstro.git +[submodule "soundtouch"] + path = externals/soundtouch + url = https://codeberg.org/soundtouch/soundtouch.git +[submodule "catch2"] + path = externals/catch2 + url = https://github.com/catchorg/Catch2 +[submodule "dynarmic"] + path = externals/dynarmic + url = https://github.com/PabloMK7/dynarmic.git +[submodule "xbyak"] + path = externals/xbyak + url = https://github.com/herumi/xbyak.git +[submodule "fmt"] + path = externals/fmt + url = https://github.com/fmtlib/fmt.git +[submodule "enet"] + path = externals/enet + url = https://github.com/lsalzman/enet.git +[submodule "inih"] + path = externals/inih/inih + url = https://github.com/benhoyt/inih.git +[submodule "libressl"] + path = externals/libressl + url = https://github.com/PabloMK7/ext-libressl-portable.git +[submodule "libusb"] + path = externals/libusb/libusb + url = https://github.com/libusb/libusb.git +[submodule "cubeb"] + path = externals/cubeb + url = https://github.com/mozilla/cubeb +[submodule "discord-rpc"] + path = externals/discord-rpc + url = https://github.com/PabloMK7/discord-rpc.git +[submodule "cpp-jwt"] + path = externals/cpp-jwt + url = https://github.com/arun11299/cpp-jwt.git +[submodule "teakra"] + path = externals/teakra + url = https://github.com/wwylele/teakra.git +[submodule "lodepng"] + path = externals/lodepng/lodepng + url = https://github.com/lvandeve/lodepng.git +[submodule "zstd"] + path = externals/zstd + url = https://github.com/facebook/zstd.git +[submodule "libyuv"] + path = externals/libyuv + url = https://github.com/lemenkov/libyuv.git +[submodule "sdl2"] + path = externals/sdl2/SDL + url = https://github.com/libsdl-org/SDL +[submodule "cryptopp-cmake"] + path = externals/cryptopp-cmake + url = https://github.com/abdes/cryptopp-cmake.git +[submodule "cryptopp"] + path = externals/cryptopp + url = https://github.com/weidai11/cryptopp.git +[submodule "dds-ktx"] + path = externals/dds-ktx + url = https://github.com/septag/dds-ktx +[submodule "openal-soft"] + path = externals/openal-soft + url = https://github.com/kcat/openal-soft +[submodule "glslang"] + path = externals/glslang + url = https://github.com/KhronosGroup/glslang +[submodule "vma"] + path = externals/vma + url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator +[submodule "vulkan-headers"] + path = externals/vulkan-headers + url = https://github.com/KhronosGroup/Vulkan-Headers +[submodule "sirit"] + path = externals/sirit + url = https://github.com/PabloMK7/sirit +[submodule "faad2"] + path = externals/faad2/faad2 + url = https://github.com/knik0/faad2 +[submodule "library-headers"] + path = externals/library-headers + url = https://github.com/PabloMK7/ext-library-headers.git +[submodule "libadrenotools"] + path = externals/libadrenotools + url = https://github.com/bylaws/libadrenotools +[submodule "oaknut"] + path = externals/oaknut + url = https://github.com/merryhime/oaknut.git diff --git a/.history/.gitmodules_20250207123101 b/.history/.gitmodules_20250207123101 new file mode 100644 index 00000000..c039794e --- /dev/null +++ b/.history/.gitmodules_20250207123101 @@ -0,0 +1,93 @@ +[submodule "boost"] + path = externals/boost + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "nihstro"] + path = externals/nihstro + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "soundtouch"] + path = externals/soundtouch + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "catch2"] + path = externals/catch2 + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "dynarmic"] + path = externals/dynarmic + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "xbyak"] + path = externals/xbyak + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "fmt"] + path = externals/fmt + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "enet"] + path = externals/enet + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "inih"] + path = externals/inih/inih + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libressl"] + path = externals/libressl + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libusb"] + path = externals/libusb/libusb + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cubeb"] + path = externals/cubeb + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "discord-rpc"] + path = externals/discord-rpc + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cpp-jwt"] + path = externals/cpp-jwt + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "teakra"] + path = externals/teakra + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "lodepng"] + path = externals/lodepng/lodepng + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "zstd"] + path = externals/zstd + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libyuv"] + path = externals/libyuv + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "sdl2"] + path = externals/sdl2/SDL + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cryptopp-cmake"] + path = externals/cryptopp-cmake + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cryptopp"] + path = externals/cryptopp + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "dds-ktx"] + path = externals/dds-ktx + url = https://github.com/septag/dds-ktx +[submodule "openal-soft"] + path = externals/openal-soft + url = https://github.com/kcat/openal-soft +[submodule "glslang"] + path = externals/glslang + url = https://github.com/KhronosGroup/glslang +[submodule "vma"] + path = externals/vma + url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator +[submodule "vulkan-headers"] + path = externals/vulkan-headers + url = https://github.com/KhronosGroup/Vulkan-Headers +[submodule "sirit"] + path = externals/sirit + url = https://github.com/PabloMK7/sirit +[submodule "faad2"] + path = externals/faad2/faad2 + url = https://github.com/knik0/faad2 +[submodule "library-headers"] + path = externals/library-headers + url = https://github.com/PabloMK7/ext-library-headers.git +[submodule "libadrenotools"] + path = externals/libadrenotools + url = https://github.com/bylaws/libadrenotools +[submodule "oaknut"] + path = externals/oaknut + url = https://github.com/merryhime/oaknut.git diff --git a/.history/.gitmodules_20250207123201 b/.history/.gitmodules_20250207123201 new file mode 100644 index 00000000..00cd86ec --- /dev/null +++ b/.history/.gitmodules_20250207123201 @@ -0,0 +1,93 @@ +[submodule "boost"] + path = externals/boost + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "nihstro"] + path = externals/nihstro + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "soundtouch"] + path = externals/soundtouch + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "catch2"] + path = externals/catch2 + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "dynarmic"] + path = externals/dynarmic + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "xbyak"] + path = externals/xbyak + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "fmt"] + path = externals/fmt + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "enet"] + path = externals/enet + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "inih"] + path = externals/inih/inih + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libressl"] + path = externals/libressl + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libusb"] + path = externals/libusb/libusb + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cubeb"] + path = externals/cubeb + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "discord-rpc"] + path = externals/discord-rpc + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cpp-jwt"] + path = externals/cpp-jwt + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "teakra"] + path = externals/teakra + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "lodepng"] + path = externals/lodepng/lodepng + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "zstd"] + path = externals/zstd + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libyuv"] + path = externals/libyuv + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "sdl2"] + path = externals/sdl2/SDL + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cryptopp-cmake"] + path = externals/cryptopp-cmake + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "cryptopp"] + path = externals/cryptopp + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "dds-ktx"] + path = externals/dds-ktx + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "openal-soft"] + path = externals/openal-soft + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "glslang"] + path = externals/glslang + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "vma"] + path = externals/vma + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "vulkan-headers"] + path = externals/vulkan-headers + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "sirit"] + path = externals/sirit + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "faad2"] + path = externals/faad2/faad2 + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "library-headers"] + path = externals/library-headers + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "libadrenotools"] + path = externals/libadrenotools + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS +[submodule "oaknut"] + path = externals/oaknut + url = http://rocky.hifuu.ink:3000/gh0s7/Lucina3DS diff --git a/CMakeLists.txt b/CMakeLists.txt index f932f8a4..2c227f06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,21 +136,21 @@ endif() # Sanity check : Check that all submodules are present # ======================================================================= -function(check_submodules_present) - file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules) - string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules}) - foreach(module ${gitmodules}) - string(REGEX REPLACE "path *= *" "" module ${module}) - if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git") - message(SEND_ERROR "Git submodule ${module} not found." - "Please run: git submodule update --init --recursive") - endif() - endforeach() -endfunction() -if (EXISTS "${PROJECT_SOURCE_DIR}/.git/objects") +#function(check_submodules_present) +# file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules) +# string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules}) +# foreach(module ${gitmodules}) +# string(REGEX REPLACE "path *= *" "" module ${module}) +# if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git") +# message(SEND_ERROR "Git submodule ${module} not found." +# "Please run: git submodule update --init --recursive") +# endif() +# endforeach() +#endfunction() +#if (EXISTS "${PROJECT_SOURCE_DIR}/.git/objects") # only check submodules when source is obtained via Git - check_submodules_present() -endif() +# check_submodules_present() +#endif() configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc diff --git a/externals/catch2/CMake/llvm-cov-wrapper b/externals/catch2/CMake/llvm-cov-wrapper old mode 100644 new mode 100755 diff --git a/externals/catch2/fuzzing/build_fuzzers.sh b/externals/catch2/fuzzing/build_fuzzers.sh old mode 100644 new mode 100755 diff --git a/externals/catch2/tests/TestScripts/testBazelSharding.py b/externals/catch2/tests/TestScripts/testBazelSharding.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tests/TestScripts/testPartialTestCaseEvent.py b/externals/catch2/tests/TestScripts/testPartialTestCaseEvent.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tests/TestScripts/testRandomOrder.py b/externals/catch2/tests/TestScripts/testRandomOrder.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tests/TestScripts/testSharding.py b/externals/catch2/tests/TestScripts/testSharding.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/approvalTests.py b/externals/catch2/tools/scripts/approvalTests.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/approve.py b/externals/catch2/tools/scripts/approve.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/buildAndTest.sh b/externals/catch2/tools/scripts/buildAndTest.sh old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/checkConvenienceHeaders.py b/externals/catch2/tools/scripts/checkConvenienceHeaders.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/checkDuplicateFilenames.py b/externals/catch2/tools/scripts/checkDuplicateFilenames.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/checkLicense.py b/externals/catch2/tools/scripts/checkLicense.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/developBuild.py b/externals/catch2/tools/scripts/developBuild.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/fixWhitespace.py b/externals/catch2/tools/scripts/fixWhitespace.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/generateAmalgamatedFiles.py b/externals/catch2/tools/scripts/generateAmalgamatedFiles.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/majorRelease.py b/externals/catch2/tools/scripts/majorRelease.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/minorRelease.py b/externals/catch2/tools/scripts/minorRelease.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/patchRelease.py b/externals/catch2/tools/scripts/patchRelease.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/updateDocumentSnippets.py b/externals/catch2/tools/scripts/updateDocumentSnippets.py old mode 100644 new mode 100755 diff --git a/externals/catch2/tools/scripts/updateDocumentToC.py b/externals/catch2/tools/scripts/updateDocumentToC.py old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake b/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake new file mode 100644 index 00000000..36fabdc1 --- /dev/null +++ b/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake @@ -0,0 +1,22 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc" "/Users/amuralid/dev_test/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o" + ) +set(CMAKE_CXX_COMPILER_ID "Clang") + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "include" + "/usr/local/Cellar/openssl/1.0.2j/include" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/cmake_clean.cmake b/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/cmake_clean.cmake new file mode 100644 index 00000000..e7508845 --- /dev/null +++ b/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/simple_ex1.dir/simple_ex1.cc.o" + "simple_ex1.pdb" + "simple_ex1" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/simple_ex1.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/progress.make b/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/progress.make new file mode 100644 index 00000000..abadeb0c --- /dev/null +++ b/externals/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 + diff --git a/externals/cpp-jwt/include/jwt/test/test_base64 b/externals/cpp-jwt/include/jwt/test/test_base64 old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_hmac b/externals/cpp-jwt/include/jwt/test/test_hmac old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_jwt_decode b/externals/cpp-jwt/include/jwt/test/test_jwt_decode old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_jwt_header b/externals/cpp-jwt/include/jwt/test/test_jwt_header old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_jwt_object b/externals/cpp-jwt/include/jwt/test/test_jwt_object old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_jwt_payload b/externals/cpp-jwt/include/jwt/test/test_jwt_payload old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_jwt_signature b/externals/cpp-jwt/include/jwt/test/test_jwt_signature old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_rsa b/externals/cpp-jwt/include/jwt/test/test_rsa old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_stack_alloc b/externals/cpp-jwt/include/jwt/test/test_stack_alloc old mode 100644 new mode 100755 diff --git a/externals/cpp-jwt/include/jwt/test/test_sv b/externals/cpp-jwt/include/jwt/test/test_sv old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/change-version.sh b/externals/cryptopp/TestScripts/change-version.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/configure.sh b/externals/cryptopp/TestScripts/configure.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptdll-windows.cmd b/externals/cryptopp/TestScripts/cryptdll-windows.cmd old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-android-mk.sh b/externals/cryptopp/TestScripts/cryptest-android-mk.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-android.sh b/externals/cryptopp/TestScripts/cryptest-android.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-autotools.sh b/externals/cryptopp/TestScripts/cryptest-autotools.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-coverage.sh b/externals/cryptopp/TestScripts/cryptest-coverage.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-ios.sh b/externals/cryptopp/TestScripts/cryptest-ios.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-pem.sh b/externals/cryptopp/TestScripts/cryptest-pem.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-symbols.sh b/externals/cryptopp/TestScripts/cryptest-symbols.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest-tidy.sh b/externals/cryptopp/TestScripts/cryptest-tidy.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/cryptest.sh b/externals/cryptopp/TestScripts/cryptest.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/governor.sh b/externals/cryptopp/TestScripts/governor.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/install-ndk.sh b/externals/cryptopp/TestScripts/install-ndk.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/make-benchmarks.sh b/externals/cryptopp/TestScripts/make-benchmarks.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/reset-fork.sh b/externals/cryptopp/TestScripts/reset-fork.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/setenv-android.sh b/externals/cryptopp/TestScripts/setenv-android.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/setenv-embedded.sh b/externals/cryptopp/TestScripts/setenv-embedded.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/setenv-ios.sh b/externals/cryptopp/TestScripts/setenv-ios.sh old mode 100644 new mode 100755 diff --git a/externals/cryptopp/TestScripts/setenv-macos.sh b/externals/cryptopp/TestScripts/setenv-macos.sh old mode 100644 new mode 100755 diff --git a/externals/cubeb/cmake/sanitizers-cmake/cmake/asan-wrapper b/externals/cubeb/cmake/sanitizers-cmake/cmake/asan-wrapper old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googlemock/test/gmock_leak_test.py b/externals/cubeb/googletest/googlemock/test/gmock_leak_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googlemock/test/gmock_output_test.py b/externals/cubeb/googletest/googlemock/test/gmock_output_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googlemock/test/gmock_test_utils.py b/externals/cubeb/googletest/googlemock/test/gmock_test_utils.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-break-on-failure-unittest.py b/externals/cubeb/googletest/googletest/test/googletest-break-on-failure-unittest.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-catch-exceptions-test.py b/externals/cubeb/googletest/googletest/test/googletest-catch-exceptions-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-color-test.py b/externals/cubeb/googletest/googletest/test/googletest-color-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-env-var-test.py b/externals/cubeb/googletest/googletest/test/googletest-env-var-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-failfast-unittest.py b/externals/cubeb/googletest/googletest/test/googletest-failfast-unittest.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-filter-unittest.py b/externals/cubeb/googletest/googletest/test/googletest-filter-unittest.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-list-tests-unittest.py b/externals/cubeb/googletest/googletest/test/googletest-list-tests-unittest.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-output-test.py b/externals/cubeb/googletest/googletest/test/googletest-output-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-setuptestsuite-test.py b/externals/cubeb/googletest/googletest/test/googletest-setuptestsuite-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-shuffle-test.py b/externals/cubeb/googletest/googletest/test/googletest-shuffle-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-throw-on-failure-test.py b/externals/cubeb/googletest/googletest/test/googletest-throw-on-failure-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/googletest-uninitialized-test.py b/externals/cubeb/googletest/googletest/test/googletest-uninitialized-test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_help_test.py b/externals/cubeb/googletest/googletest/test/gtest_help_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_skip_check_output_test.py b/externals/cubeb/googletest/googletest/test/gtest_skip_check_output_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_skip_environment_check_output_test.py b/externals/cubeb/googletest/googletest/test/gtest_skip_environment_check_output_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_test_utils.py b/externals/cubeb/googletest/googletest/test/gtest_test_utils.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_testbridge_test.py b/externals/cubeb/googletest/googletest/test/gtest_testbridge_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_xml_outfiles_test.py b/externals/cubeb/googletest/googletest/test/gtest_xml_outfiles_test.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_xml_output_unittest.py b/externals/cubeb/googletest/googletest/test/gtest_xml_output_unittest.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/googletest/googletest/test/gtest_xml_test_utils.py b/externals/cubeb/googletest/googletest/test/gtest_xml_test_utils.py old mode 100644 new mode 100755 diff --git a/externals/cubeb/scan-build-install.sh b/externals/cubeb/scan-build-install.sh old mode 100644 new mode 100755 diff --git a/externals/discord-rpc/build.py b/externals/discord-rpc/build.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/CMake/llvm-cov-wrapper b/externals/dynarmic/externals/catch/CMake/llvm-cov-wrapper old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/fuzzing/build_fuzzers.sh b/externals/dynarmic/externals/catch/fuzzing/build_fuzzers.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tests/TestScripts/testBazelSharding.py b/externals/dynarmic/externals/catch/tests/TestScripts/testBazelSharding.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tests/TestScripts/testPartialTestCaseEvent.py b/externals/dynarmic/externals/catch/tests/TestScripts/testPartialTestCaseEvent.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tests/TestScripts/testRandomOrder.py b/externals/dynarmic/externals/catch/tests/TestScripts/testRandomOrder.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tests/TestScripts/testSharding.py b/externals/dynarmic/externals/catch/tests/TestScripts/testSharding.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/approvalTests.py b/externals/dynarmic/externals/catch/tools/scripts/approvalTests.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/approve.py b/externals/dynarmic/externals/catch/tools/scripts/approve.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/buildAndTest.sh b/externals/dynarmic/externals/catch/tools/scripts/buildAndTest.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/checkConvenienceHeaders.py b/externals/dynarmic/externals/catch/tools/scripts/checkConvenienceHeaders.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/checkDuplicateFilenames.py b/externals/dynarmic/externals/catch/tools/scripts/checkDuplicateFilenames.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/checkLicense.py b/externals/dynarmic/externals/catch/tools/scripts/checkLicense.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/developBuild.py b/externals/dynarmic/externals/catch/tools/scripts/developBuild.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/fixWhitespace.py b/externals/dynarmic/externals/catch/tools/scripts/fixWhitespace.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/generateAmalgamatedFiles.py b/externals/dynarmic/externals/catch/tools/scripts/generateAmalgamatedFiles.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/majorRelease.py b/externals/dynarmic/externals/catch/tools/scripts/majorRelease.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/minorRelease.py b/externals/dynarmic/externals/catch/tools/scripts/minorRelease.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/patchRelease.py b/externals/dynarmic/externals/catch/tools/scripts/patchRelease.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/updateDocumentSnippets.py b/externals/dynarmic/externals/catch/tools/scripts/updateDocumentSnippets.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/catch/tools/scripts/updateDocumentToC.py b/externals/dynarmic/externals/catch/tools/scripts/updateDocumentToC.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/doc/build.py b/externals/dynarmic/externals/fmt/doc/build.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/support/build-docs.py b/externals/dynarmic/externals/fmt/support/build-docs.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/support/compute-powers.py b/externals/dynarmic/externals/fmt/support/compute-powers.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/support/manage.py b/externals/dynarmic/externals/fmt/support/manage.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/support/printable.py b/externals/dynarmic/externals/fmt/support/printable.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/support/rst2md.py b/externals/dynarmic/externals/fmt/support/rst2md.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/fmt/test/fuzzing/build.sh b/externals/dynarmic/externals/fmt/test/fuzzing/build.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/xbyak/Makefile b/externals/dynarmic/externals/xbyak/Makefile new file mode 100644 index 00000000..f91f6261 --- /dev/null +++ b/externals/dynarmic/externals/xbyak/Makefile @@ -0,0 +1,24 @@ +PREFIX?=/usr/local +INSTALL_DIR=$(PREFIX)/include/xbyak + +all: + $(MAKE) -C sample + +clean: + $(MAKE) -C sample clean + +install: + mkdir -p $(INSTALL_DIR) + cp -pR xbyak/*.h $(INSTALL_DIR) + +uninstall: + rm -i $(INSTALL_DIR)/*.h + rmdir $(INSTALL_DIR) + +update: + $(MAKE) -C gen + +test: + $(MAKE) -C test test + +.PHONY: test update diff --git a/externals/dynarmic/externals/xbyak/gen/Makefile b/externals/dynarmic/externals/xbyak/gen/Makefile new file mode 100644 index 00000000..12bea515 --- /dev/null +++ b/externals/dynarmic/externals/xbyak/gen/Makefile @@ -0,0 +1,44 @@ +TARGET=../xbyak/xbyak_mnemonic.h +BIN=sortline gen_code gen_avx512 +CFLAGS=-I../ -I ./ -Wall -Wextra -Wno-missing-field-initializers $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +all: $(TARGET) ../CMakeLists.txt ../meson.build ../readme.md ../readme.txt + +avx_type_def.h: ../xbyak/xbyak.h + sed -n '/@@@begin of avx_type_def.h/,/@@@end of avx_type_def.h/p' $< > $@ + +avx_type.hpp: avx_type_def.h +sortline: sortline.cpp + $(CXX) $(CFLAGS) $< -o $@ +gen_code: gen_code.cpp avx_type.hpp + $(CXX) $(CFLAGS) $< -o $@ +gen_avx512: gen_avx512.cpp avx_type.hpp + $(CXX) $(CFLAGS) $< -o $@ + +$(TARGET): $(BIN) + ./gen_code | ./sortline > $@ + echo "#ifdef XBYAK_ENABLE_OMITTED_OPERAND" >> $@ + ./gen_code omit | ./sortline >> $@ + echo "#endif" >>$@ + ./gen_code fixed >> $@ + echo "#ifndef XBYAK_DISABLE_AVX512" >> $@ + ./gen_avx512 | ./sortline >> $@ + echo "#ifdef XBYAK64" >> $@ + ./gen_avx512 64 | ./sortline >> $@ + echo "#endif" >> $@ + echo "#endif" >> $@ + +VER=$(shell head -n 1 ../xbyak/xbyak_mnemonic.h|grep -o "[0-9.]*") +../CMakeLists.txt: $(TARGET) + sed -i -e 's/CXX VERSION [0-9.]*/CXX VERSION $(VER)/' $@ + +../meson.build: $(TARGET) + sed -i -e "s/version: '[0-9.]*',/version: '$(VER)',/" $@ + +../readme.md: $(TARGET) + sed -l 2 -i -e "s/# Xbyak [0-9.]*/# Xbyak $(VER)/" $@ + +../readme.txt: $(TARGET) + sed -l 2 -i -e "s/Xbyak [0-9.]*/Xbyak $(VER)/" $@ + +clean: + $(RM) $(BIN) $(TARGET) avx_type_def.h diff --git a/externals/dynarmic/externals/xbyak/sample/Makefile b/externals/dynarmic/externals/xbyak/sample/Makefile new file mode 100644 index 00000000..ff94b3a8 --- /dev/null +++ b/externals/dynarmic/externals/xbyak/sample/Makefile @@ -0,0 +1,140 @@ +XBYAK_INC=../xbyak/xbyak.h +CXX?=g++ + +BOOST_EXIST=$(shell echo "#include " | $(CXX) -x c++ -c - 2>/dev/null && echo 1) +UNAME_M=$(shell uname -m) + +ONLY_64BIT=0 +ifeq ($(shell uname -s),Darwin) + ONLY_64BIT=1 + OS=mac + ifeq ($(UNAME_M),x86_64) + BIT=64 + endif + ifeq ($(UNAME_M),i386) + BIT=32 + endif + ifeq ($(shell sw_vers -productVersion | cut -c1-4 | sed 's/\.//'),105) + ifeq ($(shell sysctl -n hw.cpu64bit_capable),1) + BIT=64 + endif + endif +else + BIT=32 + ifeq ($(UNAME_M),x86_64) + BIT=64 + endif + ifeq ($(UNAME_M),amd64) + BIT=64 + endif +endif + +ifeq ($(BIT),64) +TARGET += test64 bf64 memfunc64 test_util64 jmp_table64 zero_upper ccmp no_flags +ifeq ($(BOOST_EXIST),1) +TARGET += calc64 #calc2_64 +endif +endif + +ifneq ($(OS),mac) +TARGET += static_buf64 +TARGET += memfd +endif + + +ifneq ($(ONLY_64BIT),1) + TARGET += test quantize bf toyvm test_util memfunc static_buf jmp_table +ifeq ($(BOOST_EXIST),1) + TARGET += calc #calc2 +endif +endif + +all: $(TARGET) + +CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith #-pedantic + +CFLAGS=-g -O2 -fomit-frame-pointer -Wall -I../ $(CFLAGS_WARN) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + +test: + $(CXX) $(CFLAGS) test0.cpp -o $@ -m32 + +quantize: + $(CXX) $(CFLAGS) quantize.cpp -o $@ -m32 + +calc: + $(CXX) $(CFLAGS) calc.cpp -o $@ -m32 +calc64: + $(CXX) $(CFLAGS) calc.cpp -o $@ -m64 +calc2: + $(CXX) $(CFLAGS) calc2.cpp -o $@ -m32 +calc2_64: + $(CXX) $(CFLAGS) calc2.cpp -o $@ -m64 + +bf: + $(CXX) $(CFLAGS) bf.cpp -o $@ -m32 +bf64: + $(CXX) $(CFLAGS) bf.cpp -o $@ -m64 + +memfunc: + $(CXX) $(CFLAGS) memfunc.cpp -o $@ -m32 +memfunc64: + $(CXX) $(CFLAGS) memfunc.cpp -o $@ -m64 + +toyvm: + $(CXX) $(CFLAGS) toyvm.cpp -o $@ -m32 + +test64: + $(CXX) $(CFLAGS) test0.cpp -o $@ -m64 +test_util: + $(CXX) $(CFLAGS) test_util.cpp -o $@ -m32 +test_util64: + $(CXX) $(CFLAGS) test_util.cpp -o $@ -m64 +static_buf: + $(CXX) $(CFLAGS) static_buf.cpp -o $@ -m32 +static_buf64: + $(CXX) $(CFLAGS) static_buf.cpp -o $@ -m64 +jmp_table: + $(CXX) $(CFLAGS) jmp_table.cpp -o $@ -m32 +jmp_table64: + $(CXX) $(CFLAGS) jmp_table.cpp -o $@ -m64 +memfd: + $(CXX) $(CFLAGS) memfd.cpp -o $@ -m64 +profiler: profiler.cpp ../xbyak/xbyak_util.h + $(CXX) $(CFLAGS) profiler.cpp -o $@ +profiler-vtune: profiler.cpp ../xbyak/xbyak_util.h + $(CXX) $(CFLAGS) profiler.cpp -o $@ -DXBYAK_USE_VTUNE -I /opt/intel/vtune_amplifier/include/ -L /opt/intel/vtune_amplifier/lib64 -ljitprofiling -ldl +zero_upper: zero_upper.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) zero_upper.cpp -o $@ +test_zero_upper: zero_upper + sde -future -- ./zero_upper +ccmp: ccmp.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) ccmp.cpp -o $@ +test_ccmp: ccmp + sde -future -- ./ccmp +no_flags: no_flags.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) no_flags.cpp -o $@ +test_no_flags: no_flags + sde -future -- ./no_flags + +clean: + rm -rf $(TARGET) profiler profiler-vtune + +test : test0.cpp $(XBYAK_INC) +test64: test0.cpp $(XBYAK_INC) +quantize : quantize.cpp $(XBYAK_INC) +calc : calc.cpp $(XBYAK_INC) +calc64 : calc.cpp $(XBYAK_INC) +calc2 : calc2.cpp $(XBYAK_INC) +calc2_64 : calc2.cpp $(XBYAK_INC) +bf : bf.cpp $(XBYAK_INC) +bf64 : bf.cpp $(XBYAK_INC) +memfunc : memfunc.cpp $(XBYAK_INC) +memfunc64 : memfunc.cpp $(XBYAK_INC) +toyvm : toyvm.cpp $(XBYAK_INC) +static_buf: static_buf.cpp $(XBYAK_INC) +static_buf64: static_buf.cpp $(XBYAK_INC) +test_util : test_util.cpp $(XBYAK_INC) ../xbyak/xbyak_util.h +test_util64 : test_util.cpp $(XBYAK_INC) ../xbyak/xbyak_util.h +jmp_table: jmp_table.cpp $(XBYAK_INC) +jmp_table64: jmp_table.cpp $(XBYAK_INC) +memfd: memfd.cpp $(XBYAK_INC) diff --git a/externals/dynarmic/externals/xbyak/sample/cpuid/cpuid.sh b/externals/dynarmic/externals/xbyak/sample/cpuid/cpuid.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/xbyak/test/Makefile b/externals/dynarmic/externals/xbyak/test/Makefile new file mode 100644 index 00000000..d2d83099 --- /dev/null +++ b/externals/dynarmic/externals/xbyak/test/Makefile @@ -0,0 +1,121 @@ +TARGET = make_nm normalize_prefix bad_address misc cvt_test cvt_test32 noexception misc32 detect_x32 +XBYAK_INC=../xbyak/xbyak.h ../xbyak/xbyak_mnemonic.h +UNAME_S=$(shell uname -s) +ifeq ($(shell ./detect_x32),x32) +X32?=1 +endif +BIT=32 +ifeq ($(shell uname -m),x86_64) +BIT=64 +endif +ONLY_64BIT=0 +ifeq ($(UNAME_S),Darwin) + # 32-bit binary is not supported + ONLY_64BIT=1 +endif +ifeq ($(findstring MINGW64,$(UNAME_S)),MINGW64) + ONLY_64BIT=1 +endif +ifeq ($(ONLY_64BIT),0) + TARGET += jmp address +endif + +ifeq ($(BIT),64) + TARGET += jmp64 address64 apx +endif + +all: $(TARGET) + +CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wwrite-strings -Wfloat-equal -Wpointer-arith + +CFLAGS=-O2 -Wall -I.. -I. $(CFLAGS_WARN) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) #-std=c++0x +make_nm: + $(CXX) $(CFLAGS) make_nm.cpp -o $@ +normalize_prefix: normalize_prefix.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) normalize_prefix.cpp -o $@ +test_mmx: test_mmx.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) test_mmx.cpp -o $@ -lpthread +jmp: jmp.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) jmp.cpp -o $@ -m32 +jmp64: jmp.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) jmp.cpp -o $@ -m64 +address: address.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) address.cpp -o $@ -m32 +address64: address.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) address.cpp -o $@ -m64 +bad_address: bad_address.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) bad_address.cpp -o $@ +misc: misc.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) misc.cpp -o $@ +misc32: misc.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) misc.cpp -o $@ -DXBYAK32 +cvt_test: cvt_test.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) $< -o $@ +cvt_test32: cvt_test.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) $< -o $@ -DXBYAK32 +noexception: noexception.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) $< -o $@ -fno-exceptions +apx: apx.cpp $(XBYAK_INC) + $(CXX) $(CFLAGS) apx.cpp -o $@ + +test_nm: normalize_prefix $(TARGET) + $(MAKE) -C ../gen +ifneq ($(ONLY_64BIT),1) + CXX=$(CXX) ./test_nm.sh + CXX=$(CXX) ./test_nm.sh noexcept + CXX=$(CXX) ./test_nm.sh Y + CXX=$(CXX) ./test_nm.sh avx512 + CXX=$(CXX) ./test_address.sh + ./jmp + ./cvt_test32 +endif + ./bad_address + ./misc + ./misc32 + ./cvt_test +ifeq ($(BIT),64) + CXX=$(CXX) ./test_address.sh 64 +ifneq ($(X32),1) + CXX=$(CXX) ./test_nm.sh 64 + CXX=$(CXX) ./test_nm.sh Y64 +endif + ./jmp64 + ./apx +endif + +test_avx: normalize_prefix +ifneq ($(ONLY_64BIT),0) + CXX=$(CXX) ./test_avx.sh + CXX=$(CXX) ./test_avx.sh Y +endif +ifeq ($(BIT),64) + CXX=$(CXX) ./test_avx.sh 64 +ifneq ($(X32),1) + CXX=$(CXX) ./test_avx.sh Y64 +endif +endif + +test_avx512: normalize_prefix +ifneq ($(ONLY_64BIT),0) + CXX=$(CXX) ./test_avx512.sh +endif +ifeq ($(BIT),64) + CXX=$(CXX) ./test_avx512.sh 64 +endif + +detect_x32: detect_x32.c + $(CC) $< -o $@ + +test: detect_x32 + $(MAKE) test_nm + $(MAKE) test_avx + $(MAKE) test_avx512 + +clean: + $(RM) a.asm *.lst *.obj *.o $(TARGET) lib_run nm.cpp nm_frame make_512 + +lib_run: lib_test.cpp lib_run.cpp lib.h + $(CXX) $(CFLAGS) lib_run.cpp lib_test.cpp -o lib_run +make_nm: make_nm.cpp $(XBYAK_INC) + +.PHONY: test diff --git a/externals/dynarmic/externals/xbyak/test/test_address.sh b/externals/dynarmic/externals/xbyak/test/test_address.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/xbyak/test/test_avx.sh b/externals/dynarmic/externals/xbyak/test/test_avx.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/xbyak/test/test_avx512.sh b/externals/dynarmic/externals/xbyak/test/test_avx512.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/xbyak/test/test_nm.sh b/externals/dynarmic/externals/xbyak/test/test_nm.sh old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/zydis/Makefile b/externals/dynarmic/externals/zydis/Makefile new file mode 100644 index 00000000..eaa84050 --- /dev/null +++ b/externals/dynarmic/externals/zydis/Makefile @@ -0,0 +1,39 @@ +.PHONY: build configure install amalgamate clean test doc doc-plain doc-themed + +BUILD_DIR ?= build +CSS_DIR ?= ../doxygen-awesome-css + +build: configure + cmake --build $(BUILD_DIR) -j$(nproc) + +configure: dependencies/zycore/CMakeLists.txt + @if ! command -v cmake > /dev/null; then \ + echo >&2 "ERROR: cmake is not installed. Please install it first."; \ + fi + cmake -B $(BUILD_DIR) + +install: build + cmake --install $(BUILD_DIR) + +amalgamate: + assets/amalgamate.py + +clean: + rm -rf $(BUILD_DIR) + rm -rf doc + rm -rf amalgamated-dist + +test: build + cd tests && ./regression.py test ../build/ZydisInfo + cd tests && ./regression_encoder.py ../build/Zydis{Fuzz{ReEncoding,Encoder},TestEncoderAbsolute} + +doc: configure + cmake --build $(BUILD_DIR) --target ZydisDoc + +dependencies/zycore/CMakeLists.txt: + @if ! command -v git > /dev/null; then \ + echo >&2 -n "ERROR: git is not installed. Please either manually place all"; \ + echo >&2 "dependencies in their respective paths or install git first."; \ + exit 1; \ + fi + git submodule update --init --recursive diff --git a/externals/dynarmic/externals/zydis/assets/amalgamate.py b/externals/dynarmic/externals/zydis/assets/amalgamate.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/zydis/assets/screenshots/ZydisInfo.png b/externals/dynarmic/externals/zydis/assets/screenshots/ZydisInfo.png old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/zydis/tests/regression.py b/externals/dynarmic/externals/zydis/tests/regression.py old mode 100644 new mode 100755 diff --git a/externals/dynarmic/externals/zydis/tests/regression_encoder.py b/externals/dynarmic/externals/zydis/tests/regression_encoder.py old mode 100644 new mode 100755 diff --git a/externals/fmt/doc/build.py b/externals/fmt/doc/build.py old mode 100644 new mode 100755 diff --git a/externals/fmt/support/build-docs.py b/externals/fmt/support/build-docs.py old mode 100644 new mode 100755 diff --git a/externals/fmt/support/compute-powers.py b/externals/fmt/support/compute-powers.py old mode 100644 new mode 100755 diff --git a/externals/fmt/support/manage.py b/externals/fmt/support/manage.py old mode 100644 new mode 100755 diff --git a/externals/fmt/support/printable.py b/externals/fmt/support/printable.py old mode 100644 new mode 100755 diff --git a/externals/fmt/test/fuzzing/build.sh b/externals/fmt/test/fuzzing/build.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/SPIRV/GlslangToSpv.cpp b/externals/glslang/SPIRV/GlslangToSpv.cpp old mode 100644 new mode 100755 diff --git a/externals/glslang/SPIRV/doc.cpp b/externals/glslang/SPIRV/doc.cpp old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/link.vk.inconsistentGLPerVertex.0.vert.out b/externals/glslang/Test/baseResults/link.vk.inconsistentGLPerVertex.0.vert.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/spv.nullInit.comp.out b/externals/glslang/Test/baseResults/spv.nullInit.comp.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/spv.terminate.frag.out b/externals/glslang/Test/baseResults/spv.terminate.frag.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/terminate.frag.out b/externals/glslang/Test/baseResults/terminate.frag.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/terminate.vert.out b/externals/glslang/Test/baseResults/terminate.vert.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/vk.relaxed.changeSet.vert.out b/externals/glslang/Test/baseResults/vk.relaxed.changeSet.vert.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/baseResults/vk.relaxed.stagelink.0.0.vert.out b/externals/glslang/Test/baseResults/vk.relaxed.stagelink.0.0.vert.out old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/bump b/externals/glslang/Test/bump old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/glslangValidator b/externals/glslang/Test/glslangValidator old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/link.vk.inconsistentGLPerVertex.0.geom b/externals/glslang/Test/link.vk.inconsistentGLPerVertex.0.geom old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/link.vk.inconsistentGLPerVertex.0.vert b/externals/glslang/Test/link.vk.inconsistentGLPerVertex.0.vert old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/runtests b/externals/glslang/Test/runtests old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/spv.ext.AnyHitShader.rahit b/externals/glslang/Test/spv.ext.AnyHitShader.rahit old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/spv.ext.ClosestHitShader.rchit b/externals/glslang/Test/spv.ext.ClosestHitShader.rchit old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/validate-shaders.sh b/externals/glslang/Test/validate-shaders.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.changeSet.frag b/externals/glslang/Test/vk.relaxed.changeSet.frag old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.changeSet.vert b/externals/glslang/Test/vk.relaxed.changeSet.vert old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.stagelink.0.0.frag b/externals/glslang/Test/vk.relaxed.stagelink.0.0.frag old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.stagelink.0.0.vert b/externals/glslang/Test/vk.relaxed.stagelink.0.0.vert old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.stagelink.0.1.frag b/externals/glslang/Test/vk.relaxed.stagelink.0.1.frag old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.stagelink.0.1.vert b/externals/glslang/Test/vk.relaxed.stagelink.0.1.vert old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.stagelink.0.2.frag b/externals/glslang/Test/vk.relaxed.stagelink.0.2.frag old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/vk.relaxed.stagelink.0.2.vert b/externals/glslang/Test/vk.relaxed.stagelink.0.2.vert old mode 100644 new mode 100755 diff --git a/externals/glslang/Test/web.runtests b/externals/glslang/Test/web.runtests old mode 100644 new mode 100755 diff --git a/externals/glslang/build_info.py b/externals/glslang/build_info.py old mode 100644 new mode 100755 diff --git a/externals/glslang/gen_extension_headers.py b/externals/glslang/gen_extension_headers.py old mode 100644 new mode 100755 diff --git a/externals/glslang/glslang/Include/BaseTypes.h b/externals/glslang/glslang/Include/BaseTypes.h old mode 100644 new mode 100755 diff --git a/externals/glslang/glslang/MachineIndependent/Initialize.cpp b/externals/glslang/glslang/MachineIndependent/Initialize.cpp old mode 100644 new mode 100755 diff --git a/externals/glslang/glslang/MachineIndependent/Versions.h b/externals/glslang/glslang/MachineIndependent/Versions.h old mode 100644 new mode 100755 diff --git a/externals/glslang/glslang/updateGrammar b/externals/glslang/glslang/updateGrammar old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/android-ndk-build/build-docker.sh b/externals/glslang/kokoro/android-ndk-build/build-docker.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/android-ndk-build/build.sh b/externals/glslang/kokoro/android-ndk-build/build.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/license-check/build-docker.sh b/externals/glslang/kokoro/license-check/build-docker.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/license-check/build.sh b/externals/glslang/kokoro/license-check/build.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/linux-clang-cmake/build-docker.sh b/externals/glslang/kokoro/linux-clang-cmake/build-docker.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/linux-clang-cmake/build.sh b/externals/glslang/kokoro/linux-clang-cmake/build.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/linux-clang-gn/build-docker.sh b/externals/glslang/kokoro/linux-clang-gn/build-docker.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/linux-clang-gn/build.sh b/externals/glslang/kokoro/linux-clang-gn/build.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/linux-gcc-cmake/build-docker.sh b/externals/glslang/kokoro/linux-gcc-cmake/build-docker.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/kokoro/linux-gcc-cmake/build.sh b/externals/glslang/kokoro/linux-gcc-cmake/build.sh old mode 100644 new mode 100755 diff --git a/externals/glslang/update_glslang_sources.py b/externals/glslang/update_glslang_sources.py old mode 100644 new mode 100755 diff --git a/externals/inih/inih/examples/cpptest.sh b/externals/inih/inih/examples/cpptest.sh old mode 100644 new mode 100755 diff --git a/externals/inih/inih/fuzzing/build.sh b/externals/inih/inih/fuzzing/build.sh old mode 100644 new mode 100755 diff --git a/externals/inih/inih/fuzzing/fuzz.sh b/externals/inih/inih/fuzzing/fuzz.sh old mode 100644 new mode 100755 diff --git a/externals/inih/inih/tests/unittest.sh b/externals/inih/inih/tests/unittest.sh old mode 100644 new mode 100755 diff --git a/externals/libadrenotools/build_asm.sh b/externals/libadrenotools/build_asm.sh old mode 100644 new mode 100755 diff --git a/externals/libadrenotools/tools/blob-patcher.py b/externals/libadrenotools/tools/blob-patcher.py old mode 100644 new mode 100755 diff --git a/externals/libressl/include/compat/pthread.h b/externals/libressl/include/compat/pthread.h old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/.private/appveyor_build.sh b/externals/libusb/libusb/.private/appveyor_build.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/.private/bm.sh b/externals/libusb/libusb/.private/bm.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/.private/ci-build.sh b/externals/libusb/libusb/.private/ci-build.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/.private/ci-container-build.sh b/externals/libusb/libusb/.private/ci-container-build.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/.private/post-rewrite.sh b/externals/libusb/libusb/.private/post-rewrite.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/.private/pre-commit.sh b/externals/libusb/libusb/.private/pre-commit.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/autogen.sh b/externals/libusb/libusb/autogen.sh old mode 100644 new mode 100755 diff --git a/externals/libusb/libusb/bootstrap.sh b/externals/libusb/libusb/bootstrap.sh old mode 100644 new mode 100755 diff --git a/externals/libyuv/cleanup_links.py b/externals/libyuv/cleanup_links.py old mode 100644 new mode 100755 diff --git a/externals/libyuv/infra/config/main.star b/externals/libyuv/infra/config/main.star old mode 100644 new mode 100755 diff --git a/externals/libyuv/source/test.sh b/externals/libyuv/source/test.sh old mode 100644 new mode 100755 diff --git a/externals/libyuv/tools_libyuv/autoroller/roll_deps.py b/externals/libyuv/tools_libyuv/autoroller/roll_deps.py old mode 100644 new mode 100755 diff --git a/externals/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py b/externals/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py old mode 100644 new mode 100755 diff --git a/externals/libyuv/tools_libyuv/get_landmines.py b/externals/libyuv/tools_libyuv/get_landmines.py old mode 100644 new mode 100755 diff --git a/externals/libyuv/util/Makefile b/externals/libyuv/util/Makefile new file mode 100644 index 00000000..40e74b65 --- /dev/null +++ b/externals/libyuv/util/Makefile @@ -0,0 +1,9 @@ +psnr: psnr.cc ssim.cc psnr_main.cc +ifeq ($(CXX),icl) + $(CXX) /arch:SSE2 /Ox /openmp psnr.cc ssim.cc psnr_main.cc +else + $(CXX) -msse2 -O3 -fopenmp -static -o psnr psnr.cc ssim.cc psnr_main.cc -Wl,--strip-all +endif + +# for MacOS +# /usr/local/bin/g++-7 -msse2 -O3 -fopenmp -Bstatic -o psnr psnr.cc ssim.cc psnr_main.cc diff --git a/externals/lodepng/lodepng/Makefile b/externals/lodepng/lodepng/Makefile new file mode 100644 index 00000000..78afa1ba --- /dev/null +++ b/externals/lodepng/lodepng/Makefile @@ -0,0 +1,34 @@ +# This makefile only makes the unit test, benchmark and pngdetail and showpng +# utilities. It does not make the PNG codec itself as shared or static library. +# That is because: +# LodePNG itself has only 1 source file (lodepng.cpp, can be renamed to +# lodepng.c) and is intended to be included as source file in other projects and +# their build system directly. + + +CC ?= gcc +CXX ?= g++ + +override CFLAGS := -W -Wall -Wextra -ansi -pedantic -O3 -Wno-unused-function $(CFLAGS) +override CXXFLAGS := -W -Wall -Wextra -ansi -pedantic -O3 $(CXXFLAGS) + +all: unittest benchmark pngdetail showpng + +%.o: %.cpp + @mkdir -p `dirname $@` + $(CXX) -I ./ $(CXXFLAGS) -c $< -o $@ + +unittest: lodepng.o lodepng_util.o lodepng_unittest.o + $(CXX) $^ $(CXXFLAGS) -o $@ + +benchmark: lodepng.o lodepng_benchmark.o + $(CXX) $^ $(CXXFLAGS) -lSDL2 -o $@ + +pngdetail: lodepng.o lodepng_util.o pngdetail.o + $(CXX) $^ $(CXXFLAGS) -o $@ + +showpng: lodepng.o examples/example_sdl.o + $(CXX) -I ./ $^ $(CXXFLAGS) -lSDL2 -o $@ + +clean: + rm -f unittest benchmark pngdetail showpng lodepng_unittest.o lodepng_benchmark.o lodepng.o lodepng_util.o pngdetail.o examples/example_sdl.o diff --git a/externals/nihstro/examples/assembler/cube/Makefile b/externals/nihstro/examples/assembler/cube/Makefile new file mode 100644 index 00000000..0284372b --- /dev/null +++ b/externals/nihstro/examples/assembler/cube/Makefile @@ -0,0 +1,173 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +ifeq ($(strip $(NIHSTRO)),) +$(error "Please set NIHSTRO in your environment. export NIHSTRO=nihstro-assemble") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITARM)/3ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# +# NO_SMDH: if set to anything, no SMDH file is generated. +# APP_TITLE is the name of the app stored in the SMDH file (Optional) +# APP_DESCRIPTION is the description of the app stored in the SMDH file (Optional) +# APP_AUTHOR is the author of the app stored in the SMDH file (Optional) +# ICON is the filename of the icon (.png), relative to the project folder. +# If not set, it attempts to use one of the following (in this order): +# - .png +# - icon.png +# - /default_icon.png +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard + +CFLAGS := -g -Wall -O2 -mword-relocations \ + -fomit-frame-pointer -ffast-math \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM11 -D_3DS + +CXXFLAGS := $(CFLAGS) -fno-rtti -std=gnu++11 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lctru -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CTRULIB) + + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +ifeq ($(strip $(ICON)),) + icons := $(wildcard *.png) + ifneq (,$(findstring $(TARGET).png,$(icons))) + export APP_ICON := $(TOPDIR)/$(TARGET).png + else + ifneq (,$(findstring icon.png,$(icons))) + export APP_ICON := $(TOPDIR)/icon.png + endif + endif +else + export APP_ICON := $(TOPDIR)/$(ICON) +endif + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf test.vsh.shbin + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +ifeq ($(strip $(NO_SMDH)),) +.PHONY: all +all : $(OUTPUT).3dsx $(OUTPUT).smdh +endif +$(OUTPUT).3dsx : $(OUTPUT).elf +$(OUTPUT).elf : $(OFILES) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +# WARNING: This is not the right way to do this! TODO: Do it right! +#--------------------------------------------------------------------------------- +%.vsh.o : %.vsh +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(NIHSTRO)/nihstro-assemble --output ../$(notdir $<).shbin $< + @bin2s ../$(notdir $<).shbin | $(PREFIX)as -o $@ + @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h + @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h + @echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/externals/nihstro/examples/assembler/cube_lighting/Makefile b/externals/nihstro/examples/assembler/cube_lighting/Makefile new file mode 100644 index 00000000..0284372b --- /dev/null +++ b/externals/nihstro/examples/assembler/cube_lighting/Makefile @@ -0,0 +1,173 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +ifeq ($(strip $(NIHSTRO)),) +$(error "Please set NIHSTRO in your environment. export NIHSTRO=nihstro-assemble") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITARM)/3ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# +# NO_SMDH: if set to anything, no SMDH file is generated. +# APP_TITLE is the name of the app stored in the SMDH file (Optional) +# APP_DESCRIPTION is the description of the app stored in the SMDH file (Optional) +# APP_AUTHOR is the author of the app stored in the SMDH file (Optional) +# ICON is the filename of the icon (.png), relative to the project folder. +# If not set, it attempts to use one of the following (in this order): +# - .png +# - icon.png +# - /default_icon.png +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard + +CFLAGS := -g -Wall -O2 -mword-relocations \ + -fomit-frame-pointer -ffast-math \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM11 -D_3DS + +CXXFLAGS := $(CFLAGS) -fno-rtti -std=gnu++11 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lctru -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CTRULIB) + + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +ifeq ($(strip $(ICON)),) + icons := $(wildcard *.png) + ifneq (,$(findstring $(TARGET).png,$(icons))) + export APP_ICON := $(TOPDIR)/$(TARGET).png + else + ifneq (,$(findstring icon.png,$(icons))) + export APP_ICON := $(TOPDIR)/icon.png + endif + endif +else + export APP_ICON := $(TOPDIR)/$(ICON) +endif + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf test.vsh.shbin + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +ifeq ($(strip $(NO_SMDH)),) +.PHONY: all +all : $(OUTPUT).3dsx $(OUTPUT).smdh +endif +$(OUTPUT).3dsx : $(OUTPUT).elf +$(OUTPUT).elf : $(OFILES) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +# WARNING: This is not the right way to do this! TODO: Do it right! +#--------------------------------------------------------------------------------- +%.vsh.o : %.vsh +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(NIHSTRO)/nihstro-assemble --output ../$(notdir $<).shbin $< + @bin2s ../$(notdir $<).shbin | $(PREFIX)as -o $@ + @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h + @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h + @echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/externals/sdl2/SDL/VisualC-GDK/clean.sh b/externals/sdl2/SDL/VisualC-GDK/clean.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/VisualC/clean.sh b/externals/sdl2/SDL/VisualC/clean.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/android-project/gradlew b/externals/sdl2/SDL/android-project/gradlew old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/autogen.sh b/externals/sdl2/SDL/autogen.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/android-prefab.sh b/externals/sdl2/SDL/build-scripts/android-prefab.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/androidbuild.sh b/externals/sdl2/SDL/build-scripts/androidbuild.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/androidbuildlibs.sh b/externals/sdl2/SDL/build-scripts/androidbuildlibs.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/checker-buildbot.sh b/externals/sdl2/SDL/build-scripts/checker-buildbot.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/clang++-fat.sh b/externals/sdl2/SDL/build-scripts/clang++-fat.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/clang-fat.sh b/externals/sdl2/SDL/build-scripts/clang-fat.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/codechecker-buildbot.sh b/externals/sdl2/SDL/build-scripts/codechecker-buildbot.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/config.guess b/externals/sdl2/SDL/build-scripts/config.guess old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/config.sub b/externals/sdl2/SDL/build-scripts/config.sub old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/emscripten-buildbot.sh b/externals/sdl2/SDL/build-scripts/emscripten-buildbot.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/fnsince.pl b/externals/sdl2/SDL/build-scripts/fnsince.pl old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/git-pre-push-hook.pl b/externals/sdl2/SDL/build-scripts/git-pre-push-hook.pl old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/install-sh b/externals/sdl2/SDL/build-scripts/install-sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/mkinstalldirs b/externals/sdl2/SDL/build-scripts/mkinstalldirs old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/nacl-buildbot.sh b/externals/sdl2/SDL/build-scripts/nacl-buildbot.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/naclbuild.sh b/externals/sdl2/SDL/build-scripts/naclbuild.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/raspberrypi-buildbot.sh b/externals/sdl2/SDL/build-scripts/raspberrypi-buildbot.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/showrev.sh b/externals/sdl2/SDL/build-scripts/showrev.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/strip_fPIC.sh b/externals/sdl2/SDL/build-scripts/strip_fPIC.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/test-versioning.sh b/externals/sdl2/SDL/build-scripts/test-versioning.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/update-copyright.sh b/externals/sdl2/SDL/build-scripts/update-copyright.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/update-version.sh b/externals/sdl2/SDL/build-scripts/update-version.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/updaterev.sh b/externals/sdl2/SDL/build-scripts/updaterev.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/build-scripts/wikiheaders.pl b/externals/sdl2/SDL/build-scripts/wikiheaders.pl old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/cmake/test/test_pkgconfig.sh b/externals/sdl2/SDL/cmake/test/test_pkgconfig.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/cmake/test/test_sdlconfig.sh b/externals/sdl2/SDL/cmake/test/test_sdlconfig.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/configure b/externals/sdl2/SDL/configure old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/dynapi/gendynapi.pl b/externals/sdl2/SDL/src/dynapi/gendynapi.pl old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/hidapi/bootstrap b/externals/sdl2/SDL/src/hidapi/bootstrap old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/hidapi/testgui/copy_to_bundle.sh b/externals/sdl2/SDL/src/hidapi/testgui/copy_to_bundle.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/hidapi/testgui/start.sh b/externals/sdl2/SDL/src/hidapi/testgui/start.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/joystick/check_8bitdo.sh b/externals/sdl2/SDL/src/joystick/check_8bitdo.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/joystick/sort_controllers.py b/externals/sdl2/SDL/src/joystick/sort_controllers.py old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/render/metal/build-metal-shaders.sh b/externals/sdl2/SDL/src/render/metal/build-metal-shaders.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/src/video/sdlgenblit.pl b/externals/sdl2/SDL/src/video/sdlgenblit.pl old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/test/autogen.sh b/externals/sdl2/SDL/test/autogen.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/test/configure b/externals/sdl2/SDL/test/configure old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/visualtest/autogen.sh b/externals/sdl2/SDL/visualtest/autogen.sh old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/visualtest/configure b/externals/sdl2/SDL/visualtest/configure old mode 100644 new mode 100755 diff --git a/externals/sdl2/SDL/visualtest/launch_harness.sh b/externals/sdl2/SDL/visualtest/launch_harness.sh old mode 100644 new mode 100755 diff --git a/externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py b/externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py old mode 100644 new mode 100755 diff --git a/externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py b/externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py old mode 100644 new mode 100755 diff --git a/externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/makeHeaders b/externals/sirit/externals/SPIRV-Headers/tools/buildHeaders/bin/makeHeaders old mode 100644 new mode 100755 diff --git a/externals/soundtouch/bootstrap b/externals/soundtouch/bootstrap old mode 100644 new mode 100755 diff --git a/externals/soundtouch/createsrcpack b/externals/soundtouch/createsrcpack old mode 100644 new mode 100755 diff --git a/externals/soundtouch/source/Android-lib/gradlew b/externals/soundtouch/source/Android-lib/gradlew old mode 100644 new mode 100755 diff --git a/externals/soundtouch/source/SoundTouchDLL/make-gnu-dll.sh b/externals/soundtouch/source/SoundTouchDLL/make-gnu-dll.sh old mode 100644 new mode 100755 diff --git a/externals/teakra/.travis/linux-build.sh b/externals/teakra/.travis/linux-build.sh old mode 100644 new mode 100755 diff --git a/externals/teakra/.travis/macos-build.sh b/externals/teakra/.travis/macos-build.sh old mode 100644 new mode 100755 diff --git a/externals/teakra/.travis/windows-build.sh b/externals/teakra/.travis/windows-build.sh old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dspapbptester/Makefile b/externals/teakra/hwtest/dspapbptester/Makefile new file mode 100644 index 00000000..bf7676b3 --- /dev/null +++ b/externals/teakra/hwtest/dspapbptester/Makefile @@ -0,0 +1,171 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITARM)/3ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# ROMFS is the directory which contains the RomFS, relative to the Makefile (Optional) +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include +#ROMFS := romfs + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft + +CFLAGS := -g -Wall -O2 -mword-relocations \ + -fomit-frame-pointer -ffunction-sections \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM11 -D_3DS + +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lctru -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CTRULIB) + + +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica))) +SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).cxi $(TARGET).cia $(TARGET).elf + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +all: $(OUTPUT).3dsx $(OUTPUT).cia + +ifeq ($(strip $(NO_SMDH)),) +$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh +else +$(OUTPUT).3dsx : $(OUTPUT).elf +endif + +$(OUTPUT).cia : $(OUTPUT).cxi + @makerom -f cia -o $(OUTPUT).cia -target t -i $(OUTPUT).cxi:0:0 + @echo built ... $(OUTPUT).cia + +$(OUTPUT).cxi : $(OUTPUT).elf $(OUTPUT).smdh $(TOPDIR)/rsf.rsf $(TOPDIR)/banner.bnr + @makerom -o $(OUTPUT).cxi -rsf $(TOPDIR)/rsf.rsf -target t -elf $(OUTPUT).elf -icon $(OUTPUT).smdh -banner $(TOPDIR)/banner.bnr + @echo built ... $(OUTPUT).cxi + +$(OUTPUT).elf : $(OFILES) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +#--------------------------------------------------------------------------------- +# rules for assembling GPU shaders +#--------------------------------------------------------------------------------- +define shader-as + $(eval CURBIN := $(patsubst %.shbin.o,%.shbin,$(notdir $@))) + picasso -o $(CURBIN) $1 + bin2s $(CURBIN) | $(AS) -o $@ + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h + echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h +endef + +%.shbin.o : %.v.pica %.g.pica + @echo $(notdir $^) + @$(call shader-as,$^) + +%.shbin.o : %.v.pica + @echo $(notdir $<) + @$(call shader-as,$<) + +%.shbin.o : %.shlist + @echo $(notdir $<) + @$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)/$(file))) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/externals/teakra/hwtest/dspapbptester/rsf.rsf b/externals/teakra/hwtest/dspapbptester/rsf.rsf old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dspapbptester/send.py b/externals/teakra/hwtest/dspapbptester/send.py old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dspmemorytester/Makefile b/externals/teakra/hwtest/dspmemorytester/Makefile new file mode 100644 index 00000000..bf7676b3 --- /dev/null +++ b/externals/teakra/hwtest/dspmemorytester/Makefile @@ -0,0 +1,171 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITARM)/3ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# ROMFS is the directory which contains the RomFS, relative to the Makefile (Optional) +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include +#ROMFS := romfs + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft + +CFLAGS := -g -Wall -O2 -mword-relocations \ + -fomit-frame-pointer -ffunction-sections \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM11 -D_3DS + +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lctru -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CTRULIB) + + +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica))) +SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).cxi $(TARGET).cia $(TARGET).elf + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +all: $(OUTPUT).3dsx $(OUTPUT).cia + +ifeq ($(strip $(NO_SMDH)),) +$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh +else +$(OUTPUT).3dsx : $(OUTPUT).elf +endif + +$(OUTPUT).cia : $(OUTPUT).cxi + @makerom -f cia -o $(OUTPUT).cia -target t -i $(OUTPUT).cxi:0:0 + @echo built ... $(OUTPUT).cia + +$(OUTPUT).cxi : $(OUTPUT).elf $(OUTPUT).smdh $(TOPDIR)/rsf.rsf $(TOPDIR)/banner.bnr + @makerom -o $(OUTPUT).cxi -rsf $(TOPDIR)/rsf.rsf -target t -elf $(OUTPUT).elf -icon $(OUTPUT).smdh -banner $(TOPDIR)/banner.bnr + @echo built ... $(OUTPUT).cxi + +$(OUTPUT).elf : $(OFILES) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +#--------------------------------------------------------------------------------- +# rules for assembling GPU shaders +#--------------------------------------------------------------------------------- +define shader-as + $(eval CURBIN := $(patsubst %.shbin.o,%.shbin,$(notdir $@))) + picasso -o $(CURBIN) $1 + bin2s $(CURBIN) | $(AS) -o $@ + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h + echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h +endef + +%.shbin.o : %.v.pica %.g.pica + @echo $(notdir $^) + @$(call shader-as,$^) + +%.shbin.o : %.v.pica + @echo $(notdir $<) + @$(call shader-as,$<) + +%.shbin.o : %.shlist + @echo $(notdir $<) + @$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)/$(file))) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/externals/teakra/hwtest/dspmemorytester/rsf.rsf b/externals/teakra/hwtest/dspmemorytester/rsf.rsf old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dspmemorytester/send.py b/externals/teakra/hwtest/dspmemorytester/send.py old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dsptester/Makefile b/externals/teakra/hwtest/dsptester/Makefile new file mode 100644 index 00000000..bf7676b3 --- /dev/null +++ b/externals/teakra/hwtest/dsptester/Makefile @@ -0,0 +1,171 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITARM)/3ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# ROMFS is the directory which contains the RomFS, relative to the Makefile (Optional) +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include +#ROMFS := romfs + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft + +CFLAGS := -g -Wall -O2 -mword-relocations \ + -fomit-frame-pointer -ffunction-sections \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM11 -D_3DS + +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lctru -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CTRULIB) + + +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica))) +SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).cxi $(TARGET).cia $(TARGET).elf + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +all: $(OUTPUT).3dsx $(OUTPUT).cia + +ifeq ($(strip $(NO_SMDH)),) +$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh +else +$(OUTPUT).3dsx : $(OUTPUT).elf +endif + +$(OUTPUT).cia : $(OUTPUT).cxi + @makerom -f cia -o $(OUTPUT).cia -target t -i $(OUTPUT).cxi:0:0 + @echo built ... $(OUTPUT).cia + +$(OUTPUT).cxi : $(OUTPUT).elf $(OUTPUT).smdh $(TOPDIR)/rsf.rsf $(TOPDIR)/banner.bnr + @makerom -o $(OUTPUT).cxi -rsf $(TOPDIR)/rsf.rsf -target t -elf $(OUTPUT).elf -icon $(OUTPUT).smdh -banner $(TOPDIR)/banner.bnr + @echo built ... $(OUTPUT).cxi + +$(OUTPUT).elf : $(OFILES) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +#--------------------------------------------------------------------------------- +# rules for assembling GPU shaders +#--------------------------------------------------------------------------------- +define shader-as + $(eval CURBIN := $(patsubst %.shbin.o,%.shbin,$(notdir $@))) + picasso -o $(CURBIN) $1 + bin2s $(CURBIN) | $(AS) -o $@ + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h + echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h +endef + +%.shbin.o : %.v.pica %.g.pica + @echo $(notdir $^) + @$(call shader-as,$^) + +%.shbin.o : %.v.pica + @echo $(notdir $<) + @$(call shader-as,$<) + +%.shbin.o : %.shlist + @echo $(notdir $<) + @$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)/$(file))) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/externals/teakra/hwtest/dsptester/rsf.rsf b/externals/teakra/hwtest/dsptester/rsf.rsf old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dsptester/send-program.py b/externals/teakra/hwtest/dsptester/send-program.py old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dspvictester/Makefile b/externals/teakra/hwtest/dspvictester/Makefile new file mode 100644 index 00000000..bf7676b3 --- /dev/null +++ b/externals/teakra/hwtest/dspvictester/Makefile @@ -0,0 +1,171 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITARM)/3ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# ROMFS is the directory which contains the RomFS, relative to the Makefile (Optional) +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include +#ROMFS := romfs + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft + +CFLAGS := -g -Wall -O2 -mword-relocations \ + -fomit-frame-pointer -ffunction-sections \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM11 -D_3DS + +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lctru -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CTRULIB) + + +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +PICAFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.v.pica))) +SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(PICAFILES:.v.pica=.shbin.o) $(SHLISTFILES:.shlist=.shbin.o) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).cxi $(TARGET).cia $(TARGET).elf + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +all: $(OUTPUT).3dsx $(OUTPUT).cia + +ifeq ($(strip $(NO_SMDH)),) +$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh +else +$(OUTPUT).3dsx : $(OUTPUT).elf +endif + +$(OUTPUT).cia : $(OUTPUT).cxi + @makerom -f cia -o $(OUTPUT).cia -target t -i $(OUTPUT).cxi:0:0 + @echo built ... $(OUTPUT).cia + +$(OUTPUT).cxi : $(OUTPUT).elf $(OUTPUT).smdh $(TOPDIR)/rsf.rsf $(TOPDIR)/banner.bnr + @makerom -o $(OUTPUT).cxi -rsf $(TOPDIR)/rsf.rsf -target t -elf $(OUTPUT).elf -icon $(OUTPUT).smdh -banner $(TOPDIR)/banner.bnr + @echo built ... $(OUTPUT).cxi + +$(OUTPUT).elf : $(OFILES) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +#--------------------------------------------------------------------------------- +# rules for assembling GPU shaders +#--------------------------------------------------------------------------------- +define shader-as + $(eval CURBIN := $(patsubst %.shbin.o,%.shbin,$(notdir $@))) + picasso -o $(CURBIN) $1 + bin2s $(CURBIN) | $(AS) -o $@ + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h + echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h + echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h +endef + +%.shbin.o : %.v.pica %.g.pica + @echo $(notdir $^) + @$(call shader-as,$^) + +%.shbin.o : %.v.pica + @echo $(notdir $<) + @$(call shader-as,$<) + +%.shbin.o : %.shlist + @echo $(notdir $<) + @$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)/$(file))) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/externals/teakra/hwtest/dspvictester/rsf.rsf b/externals/teakra/hwtest/dspvictester/rsf.rsf old mode 100644 new mode 100755 diff --git a/externals/teakra/hwtest/dspvictester/send.py b/externals/teakra/hwtest/dspvictester/send.py old mode 100644 new mode 100755 diff --git a/externals/vulkan-headers/registry/parse_dependency.py b/externals/vulkan-headers/registry/parse_dependency.py old mode 100644 new mode 100755 diff --git a/externals/vulkan-headers/registry/stripAPI.py b/externals/vulkan-headers/registry/stripAPI.py old mode 100644 new mode 100755 diff --git a/externals/vulkan-headers/registry/vk.xml b/externals/vulkan-headers/registry/vk.xml old mode 100644 new mode 100755 diff --git a/externals/vulkan-headers/registry/vkconventions.py b/externals/vulkan-headers/registry/vkconventions.py old mode 100644 new mode 100755 diff --git a/externals/xbyak/Makefile b/externals/xbyak/Makefile new file mode 100644 index 00000000..f91f6261 --- /dev/null +++ b/externals/xbyak/Makefile @@ -0,0 +1,24 @@ +PREFIX?=/usr/local +INSTALL_DIR=$(PREFIX)/include/xbyak + +all: + $(MAKE) -C sample + +clean: + $(MAKE) -C sample clean + +install: + mkdir -p $(INSTALL_DIR) + cp -pR xbyak/*.h $(INSTALL_DIR) + +uninstall: + rm -i $(INSTALL_DIR)/*.h + rmdir $(INSTALL_DIR) + +update: + $(MAKE) -C gen + +test: + $(MAKE) -C test test + +.PHONY: test update diff --git a/externals/xbyak/gen/Makefile b/externals/xbyak/gen/Makefile new file mode 100644 index 00000000..f254d71a --- /dev/null +++ b/externals/xbyak/gen/Makefile @@ -0,0 +1,39 @@ +TARGET=../xbyak/xbyak_mnemonic.h +BIN=sortline gen_code gen_avx512 +CFLAGS=-I../ -O2 -Wall -Wextra -Wno-missing-field-initializers $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +all: $(TARGET) ../CMakeLists.txt ../meson.build ../readme.md ../readme.txt +sortline: sortline.cpp + $(CXX) $(CFLAGS) $< -o $@ +gen_code: gen_code.cpp ../xbyak/xbyak.h avx_type.hpp + $(CXX) $(CFLAGS) $< -o $@ +gen_avx512: gen_avx512.cpp ../xbyak/xbyak.h avx_type.hpp + $(CXX) $(CFLAGS) $< -o $@ + +$(TARGET): $(BIN) + ./gen_code | ./sortline > $@ + echo "#ifdef XBYAK_ENABLE_OMITTED_OPERAND" >> $@ + ./gen_code omit | ./sortline >> $@ + echo "#endif" >>$@ + ./gen_code fixed >> $@ + echo "#ifndef XBYAK_DISABLE_AVX512" >> $@ + ./gen_avx512 | ./sortline >> $@ + echo "#ifdef XBYAK64" >> $@ + ./gen_avx512 64 | ./sortline >> $@ + echo "#endif" >> $@ + echo "#endif" >> $@ + +VER=$(shell head -n 1 ../xbyak/xbyak_mnemonic.h|grep -o "[0-9.]*") +../CMakeLists.txt: $(TARGET) + sed -i -e 's/CXX VERSION [0-9.]*/CXX VERSION $(VER)/' $@ + +../meson.build: $(TARGET) + sed -i -e "s/version: '[0-9.]*',/version: '$(VER)',/" $@ + +../readme.md: $(TARGET) + sed -l 2 -i -e "s/# Xbyak [0-9.]*/# Xbyak $(VER)/" $@ + +../readme.txt: $(TARGET) + sed -l 2 -i -e "s/Xbyak [0-9.]*/Xbyak $(VER)/" $@ + +clean: + $(RM) $(BIN) $(TARGET) diff --git a/externals/xbyak/sample/Makefile b/externals/xbyak/sample/Makefile new file mode 100644 index 00000000..91663607 --- /dev/null +++ b/externals/xbyak/sample/Makefile @@ -0,0 +1,128 @@ +XBYAK_INC=../xbyak/xbyak.h +CXX?=g++ + +BOOST_EXIST=$(shell echo "#include " | $(CXX) -x c++ -c - 2>/dev/null && echo 1) +UNAME_M=$(shell uname -m) + +ONLY_64BIT=0 +ifeq ($(shell uname -s),Darwin) + ONLY_64BIT=1 + OS=mac + ifeq ($(UNAME_M),x86_64) + BIT=64 + endif + ifeq ($(UNAME_M),i386) + BIT=32 + endif + ifeq ($(shell sw_vers -productVersion | cut -c1-4 | sed 's/\.//'),105) + ifeq ($(shell sysctl -n hw.cpu64bit_capable),1) + BIT=64 + endif + endif +else + BIT=32 + ifeq ($(UNAME_M),x86_64) + BIT=64 + endif + ifeq ($(UNAME_M),amd64) + BIT=64 + endif +endif + +ifeq ($(BIT),64) +TARGET += test64 bf64 memfunc64 test_util64 jmp_table64 +ifeq ($(BOOST_EXIST),1) +TARGET += calc64 #calc2_64 +endif +endif + +ifneq ($(OS),mac) +TARGET += static_buf64 +TARGET += memfd +endif + + +ifneq ($(ONLY_64BIT),1) + TARGET += test quantize bf toyvm test_util memfunc static_buf jmp_table +ifeq ($(BOOST_EXIST),1) + TARGET += calc #calc2 +endif +endif + +all: $(TARGET) + +CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith #-pedantic + +CFLAGS=-g -O2 -fomit-frame-pointer -Wall -I../ $(CFLAGS_WARN) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + +test: + $(CXX) $(CFLAGS) test0.cpp -o $@ -m32 + +quantize: + $(CXX) $(CFLAGS) quantize.cpp -o $@ -m32 + +calc: + $(CXX) $(CFLAGS) calc.cpp -o $@ -m32 +calc64: + $(CXX) $(CFLAGS) calc.cpp -o $@ -m64 +calc2: + $(CXX) $(CFLAGS) calc2.cpp -o $@ -m32 +calc2_64: + $(CXX) $(CFLAGS) calc2.cpp -o $@ -m64 + +bf: + $(CXX) $(CFLAGS) bf.cpp -o $@ -m32 +bf64: + $(CXX) $(CFLAGS) bf.cpp -o $@ -m64 + +memfunc: + $(CXX) $(CFLAGS) memfunc.cpp -o $@ -m32 +memfunc64: + $(CXX) $(CFLAGS) memfunc.cpp -o $@ -m64 + +toyvm: + $(CXX) $(CFLAGS) toyvm.cpp -o $@ -m32 + +test64: + $(CXX) $(CFLAGS) test0.cpp -o $@ -m64 +test_util: + $(CXX) $(CFLAGS) test_util.cpp -o $@ -m32 +test_util64: + $(CXX) $(CFLAGS) test_util.cpp -o $@ -m64 +static_buf: + $(CXX) $(CFLAGS) static_buf.cpp -o $@ -m32 +static_buf64: + $(CXX) $(CFLAGS) static_buf.cpp -o $@ -m64 +jmp_table: + $(CXX) $(CFLAGS) jmp_table.cpp -o $@ -m32 +jmp_table64: + $(CXX) $(CFLAGS) jmp_table.cpp -o $@ -m64 +memfd: + $(CXX) $(CFLAGS) memfd.cpp -o $@ -m64 +profiler: profiler.cpp ../xbyak/xbyak_util.h + $(CXX) $(CFLAGS) profiler.cpp -o $@ +profiler-vtune: profiler.cpp ../xbyak/xbyak_util.h + $(CXX) $(CFLAGS) profiler.cpp -o $@ -DXBYAK_USE_VTUNE -I /opt/intel/vtune_amplifier/include/ -L /opt/intel/vtune_amplifier/lib64 -ljitprofiling -ldl + +clean: + rm -rf $(TARGET) profiler profiler-vtune + +test : test0.cpp $(XBYAK_INC) +test64: test0.cpp $(XBYAK_INC) +quantize : quantize.cpp $(XBYAK_INC) +calc : calc.cpp $(XBYAK_INC) +calc64 : calc.cpp $(XBYAK_INC) +calc2 : calc2.cpp $(XBYAK_INC) +calc2_64 : calc2.cpp $(XBYAK_INC) +bf : bf.cpp $(XBYAK_INC) +bf64 : bf.cpp $(XBYAK_INC) +memfunc : memfunc.cpp $(XBYAK_INC) +memfunc64 : memfunc.cpp $(XBYAK_INC) +toyvm : toyvm.cpp $(XBYAK_INC) +static_buf: static_buf.cpp $(XBYAK_INC) +static_buf64: static_buf.cpp $(XBYAK_INC) +test_util : test_util.cpp $(XBYAK_INC) ../xbyak/xbyak_util.h +test_util2 : test_util.cpp $(XBYAK_INC) ../xbyak/xbyak_util.h +jmp_table: jmp_table.cpp $(XBYAK_INC) +jmp_table64: jmp_table.cpp $(XBYAK_INC) +memfd: memfd.cpp $(XBYAK_INC) diff --git a/externals/xbyak/sample/cpuid/cpuid.sh b/externals/xbyak/sample/cpuid/cpuid.sh old mode 100644 new mode 100755 diff --git a/externals/xbyak/sample/cpuid/update-txt.sh b/externals/xbyak/sample/cpuid/update-txt.sh old mode 100644 new mode 100755 diff --git a/externals/xbyak/test/Makefile b/externals/xbyak/test/Makefile new file mode 100644 index 00000000..eecdbe72 --- /dev/null +++ b/externals/xbyak/test/Makefile @@ -0,0 +1,114 @@ +TARGET = make_nm normalize_prefix bad_address misc cvt_test cvt_test32 noexception misc32 detect_x32 +XBYAK_INC=../xbyak/xbyak.h +UNAME_S=$(shell uname -s) +ifeq ($(shell ./detect_x32),x32) +X32?=1 +endif +BIT=32 +ifeq ($(shell uname -m),x86_64) +BIT=64 +endif +ONLY_64BIT=0 +ifeq ($(UNAME_S),Darwin) + # 32-bit binary is not supported + ONLY_64BIT=1 +endif +ifeq ($(ONLY_64BIT),0) + TARGET += jmp address +endif + +ifeq ($(BIT),64) + TARGET += jmp64 address64 +endif + +all: $(TARGET) + +CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wwrite-strings -Wfloat-equal -Wpointer-arith + +CFLAGS=-O2 -Wall -I../ -I./ $(CFLAGS_WARN) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) #-std=c++0x +make_nm: + $(CXX) $(CFLAGS) make_nm.cpp -o $@ +normalize_prefix: normalize_prefix.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) normalize_prefix.cpp -o $@ +test_mmx: test_mmx.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) test_mmx.cpp -o $@ -lpthread +jmp: jmp.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) jmp.cpp -o $@ -m32 +jmp64: jmp.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) jmp.cpp -o $@ -m64 +address: address.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) address.cpp -o $@ -m32 +address64: address.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) address.cpp -o $@ -m64 +bad_address: bad_address.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) bad_address.cpp -o $@ +misc: misc.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) misc.cpp -o $@ +misc32: misc.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) misc.cpp -o $@ -DXBYAK32 +cvt_test: cvt_test.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) $< -o $@ +cvt_test32: cvt_test.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) $< -o $@ -DXBYAK32 +noexception: noexception.cpp ../xbyak/xbyak.h + $(CXX) $(CFLAGS) $< -o $@ -fno-exceptions + +test_nm: normalize_prefix $(TARGET) + $(MAKE) -C ../gen +ifneq ($(ONLY_64BIT),1) + CXX=$(CXX) ./test_nm.sh + CXX=$(CXX) ./test_nm.sh noexcept + CXX=$(CXX) ./test_nm.sh Y + CXX=$(CXX) ./test_nm.sh avx512 + CXX=$(CXX) ./test_address.sh + ./jmp + ./cvt_test32 +endif + ./bad_address + ./misc + ./misc32 + ./cvt_test +ifeq ($(BIT),64) + CXX=$(CXX) ./test_address.sh 64 +ifneq ($(X32),1) + CXX=$(CXX) ./test_nm.sh 64 + CXX=$(CXX) ./test_nm.sh Y64 +endif + ./jmp64 +endif + +test_avx: normalize_prefix +ifneq ($(ONLY_64BIT),0) + CXX=$(CXX) ./test_avx.sh + CXX=$(CXX) ./test_avx.sh Y +endif +ifeq ($(BIT),64) + CXX=$(CXX) ./test_avx.sh 64 +ifneq ($(X32),1) + CXX=$(CXX) ./test_avx.sh Y64 +endif +endif + +test_avx512: normalize_prefix +ifneq ($(ONLY_64BIT),0) + CXX=$(CXX) ./test_avx512.sh +endif +ifeq ($(BIT),64) + CXX=$(CXX) ./test_avx512.sh 64 +endif + +detect_x32: detect_x32.c + $(CC) $< -o $@ + +test: detect_x32 + $(MAKE) test_nm + $(MAKE) test_avx + $(MAKE) test_avx512 + +clean: + $(RM) a.asm *.lst *.obj *.o $(TARGET) lib_run nm.cpp nm_frame make_512 + +lib_run: lib_test.cpp lib_run.cpp lib.h + $(CXX) $(CFLAGS) lib_run.cpp lib_test.cpp -o lib_run +make_nm: make_nm.cpp $(XBYAK_INC) + diff --git a/externals/xbyak/test/test_address.sh b/externals/xbyak/test/test_address.sh old mode 100644 new mode 100755 diff --git a/externals/xbyak/test/test_avx.sh b/externals/xbyak/test/test_avx.sh old mode 100644 new mode 100755 diff --git a/externals/xbyak/test/test_avx512.sh b/externals/xbyak/test/test_avx512.sh old mode 100644 new mode 100755 diff --git a/externals/xbyak/test/test_nm.sh b/externals/xbyak/test/test_nm.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/Makefile b/externals/zstd/Makefile new file mode 100644 index 00000000..3b2e3999 --- /dev/null +++ b/externals/zstd/Makefile @@ -0,0 +1,443 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +# verbose mode (print commands) on V=1 or VERBOSE=1 +Q = $(if $(filter 1,$(V) $(VERBOSE)),,@) + +PRGDIR = programs +ZSTDDIR = lib +BUILDIR = build +ZWRAPDIR = zlibWrapper +TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz + +# Define nul output +VOID = /dev/null + +# When cross-compiling from linux to windows, you might +# need to specify this as "Windows." Fedora build fails +# without it. +# +# Note: mingw-w64 build from linux to windows does not +# fail on other tested distros (ubuntu, debian) even +# without manually specifying the TARGET_SYSTEM. +TARGET_SYSTEM ?= $(OS) +CP ?= cp + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) + EXT =.exe +else + EXT = +endif + +## default: Build lib-release and zstd-release +.PHONY: default +default: lib-release zstd-release + +.PHONY: all +all: allmost examples manual contrib + +.PHONY: allmost +allmost: allzstd zlibwrapper + +# skip zwrapper, can't build that on alternate architectures without the proper zlib installed +.PHONY: allzstd +allzstd: lib + $(Q)$(MAKE) -C $(PRGDIR) all + $(Q)$(MAKE) -C $(TESTDIR) all + +.PHONY: all32 +all32: + $(MAKE) -C $(PRGDIR) zstd32 + $(MAKE) -C $(TESTDIR) all32 + +.PHONY: lib lib-release lib-mt lib-nomt +lib lib-release lib-mt lib-nomt: + $(Q)$(MAKE) -C $(ZSTDDIR) $@ + +.PHONY: zstd zstd-release +zstd zstd-release: + $(Q)$(MAKE) -C $(PRGDIR) $@ + $(Q)ln -sf $(PRGDIR)/zstd$(EXT) zstd$(EXT) + +.PHONY: zstdmt +zstdmt: + $(Q)$(MAKE) -C $(PRGDIR) $@ + $(Q)$(CP) $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) + +.PHONY: zlibwrapper +zlibwrapper: lib + $(MAKE) -C $(ZWRAPDIR) all + +## test: run long-duration tests +.PHONY: test +DEBUGLEVEL ?= 1 +test: MOREFLAGS += -g -Werror +test: + DEBUGLEVEL=$(DEBUGLEVEL) MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants + $(MAKE) -C $(TESTDIR) $@ + ZSTD=../../programs/zstd $(MAKE) -C doc/educational_decoder $@ + +## shortest: same as `make check` +.PHONY: shortest +shortest: + $(Q)$(MAKE) -C $(TESTDIR) $@ + +## check: run basic tests for `zstd` cli +.PHONY: check +check: shortest + +.PHONY: automated_benchmarking +automated_benchmarking: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: benchmarking +benchmarking: automated_benchmarking + +## examples: build all examples in `examples/` directory +.PHONY: examples +examples: lib + $(MAKE) -C examples all + +## manual: generate API documentation in html format +.PHONY: manual +manual: + $(MAKE) -C contrib/gen_html $@ + +## man: generate man page +.PHONY: man +man: + $(MAKE) -C programs $@ + +## contrib: build all supported projects in `/contrib` directory +.PHONY: contrib +contrib: lib + $(MAKE) -C contrib/pzstd all + $(MAKE) -C contrib/seekable_format/examples all + $(MAKE) -C contrib/seekable_format/tests test + $(MAKE) -C contrib/largeNbDicts all + $(MAKE) -C contrib/externalSequenceProducer all + cd build/single_file_libs/ ; ./build_decoder_test.sh + cd build/single_file_libs/ ; ./build_library_test.sh + +.PHONY: cleanTabs +cleanTabs: + cd contrib; ./cleanTabs + +.PHONY: clean +clean: + $(Q)$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) + $(Q)$(MAKE) -C $(PRGDIR) $@ > $(VOID) + $(Q)$(MAKE) -C $(TESTDIR) $@ > $(VOID) + $(Q)$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) + $(Q)$(MAKE) -C examples/ $@ > $(VOID) + $(Q)$(MAKE) -C contrib/gen_html $@ > $(VOID) + $(Q)$(MAKE) -C contrib/pzstd $@ > $(VOID) + $(Q)$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) + $(Q)$(MAKE) -C contrib/seekable_format/tests $@ > $(VOID) + $(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID) + $(Q)$(MAKE) -C contrib/externalSequenceProducer $@ > $(VOID) + $(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + $(Q)$(RM) -r lz4 + @echo Cleaning completed + +#------------------------------------------------------------------------------ +# make install is validated only for Linux, macOS, Hurd and some BSD targets +#------------------------------------------------------------------------------ +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku AIX)) + +HOST_OS = POSIX + +MKDIR ?= mkdir -p + +HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0) +EGREP_OPTIONS ?= +ifeq ($(HAVE_COLORNEVER), 1) +EGREP_OPTIONS += --color=never +endif +EGREP = egrep $(EGREP_OPTIONS) + +# Print a two column output of targets and their description. To add a target description, put a +# comment in the Makefile with the format "## : ". For example: +# +## list: Print all targets and their descriptions (if provided) +.PHONY: list +list: + $(Q)TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \ + | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \ + | $(EGREP) -v -e '^[^[:alnum:]]' | sort); \ + { \ + printf "Target Name\tDescription\n"; \ + printf "%0.s-" {1..16}; printf "\t"; printf "%0.s-" {1..40}; printf "\n"; \ + for target in $$TARGETS; do \ + line=$$($(EGREP) "^##[[:space:]]+$$target:" $(lastword $(MAKEFILE_LIST))); \ + description=$$(echo $$line | awk '{i=index($$0,":"); print substr($$0,i+1)}' | xargs); \ + printf "$$target\t$$description\n"; \ + done \ + } | column -t -s $$'\t' + +.PHONY: install armtest usan asan uasan msan asan32 +install: + $(Q)$(MAKE) -C $(ZSTDDIR) $@ + $(Q)$(MAKE) -C $(PRGDIR) $@ + +.PHONY: uninstall +uninstall: + $(Q)$(MAKE) -C $(ZSTDDIR) $@ + $(Q)$(MAKE) -C $(PRGDIR) $@ + +.PHONY: travis-install +travis-install: + $(MAKE) install PREFIX=~/install_test_dir + +.PHONY: gcc5build gcc6build gcc7build clangbuild m32build armbuild aarch64build ppcbuild ppc64build +gcc5build: clean + gcc-5 -v + CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror $(MOREFLAGS)" + +gcc6build: clean + gcc-6 -v + CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror $(MOREFLAGS)" + +gcc7build: clean + gcc-7 -v + CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror $(MOREFLAGS)" + +clangbuild: clean + clang -v + CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" $(MAKE) all + +m32build: clean + gcc -v + $(MAKE) all32 + +armbuild: clean + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd + +aarch64build: clean + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror -O0" $(MAKE) allzstd + +ppcbuild: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) -j allzstd + +ppc64build: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) -j allzstd + +.PHONY: armfuzz aarch64fuzz ppcfuzz ppc64fuzz +armfuzz: clean + CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest + +aarch64fuzz: clean + ld -v + CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest + +ppcfuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest + +ppc64fuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest + +.PHONY: cxxtest gcc5test gcc6test armtest aarch64test ppctest ppc64test +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror +cxxtest: clean + $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly + +gcc5test: clean + gcc-5 -v + $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror $(MOREFLAGS)" + +gcc6test: clean + gcc-6 -v + $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror $(MOREFLAGS)" + +armtest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" + +aarch64test: + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" + +ppctest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" + +ppc64test: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" + +.PHONY: arm-ppc-compilation +arm-ppc-compilation: + $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)" + $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static $(MOREFLAGS)" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static $(MOREFLAGS)" + +regressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest + +uasanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined" + +msanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory" + +update_regressionResults : REGRESS_RESULTS_DIR := /tmp/regress_results_dir/ +update_regressionResults: + $(MAKE) -C programs zstd + $(MAKE) -C tests/regression test + $(RM) -rf $(REGRESS_RESULTS_DIR) + $(MKDIR) $(REGRESS_RESULTS_DIR) + ./tests/regression/test \ + --cache tests/regression/cache \ + --output $(REGRESS_RESULTS_DIR)/results.csv \ + --zstd programs/zstd + echo "Showing results differences" + ! diff tests/regression/results.csv $(REGRESS_RESULTS_DIR)/results.csv + echo "Updating results.csv" + $(CP) $(REGRESS_RESULTS_DIR)/results.csv tests/regression/results.csv + + +# run UBsan with -fsanitize-recover=pointer-overflow +# this only works with recent compilers such as gcc 8+ +usan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=pointer-overflow -fsanitize=undefined -Werror $(MOREFLAGS)" + +asan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror $(MOREFLAGS)" + +asan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address -Werror $(MOREFLAGS)" $(MAKE) -C $(TESTDIR) $* + +msan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer -Werror $(MOREFLAGS)" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason + +msan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer -Werror $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* + +asan32: clean + $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address $(MOREFLAGS)" + +uasan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=pointer-overflow -fsanitize=address,undefined -Werror $(MOREFLAGS)" + +uasan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=pointer-overflow -fsanitize=address,undefined -Werror $(MOREFLAGS)" $(MAKE) -C $(TESTDIR) $* + +tsan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror $(MOREFLAGS)" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" + +.PHONY: apt-install +apt-install: + # TODO: uncomment once issue 3011 is resolved and remove hack from Github Actions .yml + # sudo apt-get update + sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) + +.PHONY: apt-add-repo +apt-add-repo: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + +.PHONY: ppcinstall arminstall valgrindinstall libc6install gcc6install gcc7install gcc8install gpp6install clang38install lz4install +ppcinstall: + APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install + +arminstall: + APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install + +valgrindinstall: + APT_PACKAGES="valgrind" $(MAKE) apt-install + +libc6install: + APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install + +gcc6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install + +gcc7install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-7 gcc-7-multilib" $(MAKE) apt-install + +gcc8install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-8 gcc-8-multilib" $(MAKE) apt-install + +gpp6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install + +clang38install: + APT_PACKAGES="clang-3.8" $(MAKE) apt-install + +# Ubuntu 14.04 ships a too-old lz4 +lz4install: + [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install + +endif + + +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release + +ifneq (,$(filter MSYS%,$(shell uname))) +HOST_OS = MSYS +CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +endif + +#------------------------------------------------------------------------ +# target specific tests +#------------------------------------------------------------------------ +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) +.PHONY: cmakebuild c89build gnu90build c99build gnu99build c11build bmix64build bmix32build bmi32build staticAnalyze +cmakebuild: + cmake --version + $(RM) -r $(BUILDIR)/cmake/build + $(MKDIR) $(BUILDIR)/cmake/build + cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. + $(MAKE) -C $(BUILDIR)/cmake/build -j4; + $(MAKE) -C $(BUILDIR)/cmake/build install; + $(MAKE) -C $(BUILDIR)/cmake/build uninstall; + cd $(BUILDIR)/cmake/build; ctest -V -L Medium + +c89build: clean + $(CC) -v + CFLAGS="-std=c89 -Werror -Wno-attributes -Wpedantic -Wno-long-long -Wno-variadic-macros -O0" $(MAKE) lib zstd + +gnu90build: clean + $(CC) -v + CFLAGS="-std=gnu90 -Werror -O0" $(MAKE) allmost + +c99build: clean + $(CC) -v + CFLAGS="-std=c99 -Werror -O0" $(MAKE) allmost + +gnu99build: clean + $(CC) -v + CFLAGS="-std=gnu99 -Werror -O0" $(MAKE) allmost + +c11build: clean + $(CC) -v + CFLAGS="-std=c11 -Werror -O0" $(MAKE) allmost + +bmix64build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test + +bmix32build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test + +bmi32build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test + +# static analyzer test uses clang's scan-build +# does not analyze zlibWrapper, due to detected issues in zlib source code +staticAnalyze: SCANBUILD ?= scan-build +staticAnalyze: + $(CC) -v + CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) zstd +endif diff --git a/externals/zstd/contrib/cleanTabs b/externals/zstd/contrib/cleanTabs old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/diagnose_corruption/Makefile b/externals/zstd/contrib/diagnose_corruption/Makefile new file mode 100644 index 00000000..ecc9e639 --- /dev/null +++ b/externals/zstd/contrib/diagnose_corruption/Makefile @@ -0,0 +1,35 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +.PHONY: all +all: check_flipped_bits + +ZSTDLIBDIR ?= ../../lib + +CFLAGS ?= -O3 +CFLAGS += -I$(ZSTDLIBDIR) -I$(ZSTDLIBDIR)/common -I$(ZSTDLIBDIR)/compress \ + -I$(ZSTDLIBDIR)/decompress +CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls -Wmissing-prototypes +CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + +.PHONY: $(ZSTDLIBDIR)/libzstd.a +$(ZSTDLIBDIR)/libzstd.a: + $(MAKE) -C $(ZSTDLIBDIR) libzstd.a + +check_flipped_bits: check_flipped_bits.c $(ZSTDLIBDIR)/libzstd.a + $(CC) $(FLAGS) $< -o $@$(EXT) $(ZSTDLIBDIR)/libzstd.a + +.PHONY: clean +clean: + rm -f check_flipped_bits diff --git a/externals/zstd/contrib/externalSequenceProducer/Makefile b/externals/zstd/contrib/externalSequenceProducer/Makefile new file mode 100644 index 00000000..0591ae01 --- /dev/null +++ b/externals/zstd/contrib/externalSequenceProducer/Makefile @@ -0,0 +1,40 @@ +# ################################################################ +# Copyright (c) Yann Collet, Meta Platforms, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +PROGDIR = ../../programs +LIBDIR = ../../lib + +LIBZSTD = $(LIBDIR)/libzstd.a + +CPPFLAGS+= -I$(LIBDIR) -I$(LIBDIR)/compress -I$(LIBDIR)/common + +CFLAGS ?= -O3 +CFLAGS += -std=gnu99 +DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum \ + -Wstrict-prototypes -Wundef -Wpointer-arith \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls +CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) + +default: externalSequenceProducer + +all: externalSequenceProducer + +externalSequenceProducer: sequence_producer.c main.c $(LIBZSTD) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +.PHONY: $(LIBZSTD) +$(LIBZSTD): + $(MAKE) -C $(LIBDIR) libzstd.a CFLAGS="$(CFLAGS)" + +clean: + $(RM) *.o + $(MAKE) -C $(LIBDIR) clean > /dev/null + $(RM) externalSequenceProducer diff --git a/externals/zstd/contrib/freestanding_lib/freestanding.py b/externals/zstd/contrib/freestanding_lib/freestanding.py old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/gen_html/Makefile b/externals/zstd/contrib/gen_html/Makefile new file mode 100644 index 00000000..26e87039 --- /dev/null +++ b/externals/zstd/contrib/gen_html/Makefile @@ -0,0 +1,51 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +CXXFLAGS ?= -O3 +CXXFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment +CXXFLAGS += $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) + +ZSTDAPI = ../../lib/zstd.h +ZSTDMANUAL = ../../doc/zstd_manual.html +LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(ZSTDAPI)` +LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(ZSTDAPI)` +LIBVER_PATCH_SCRIPT:=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(ZSTDAPI)` +LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT) +LIBVER := $(shell echo $(LIBVER_SCRIPT)) + + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + + +.PHONY: default +default: gen_html + +.PHONY: all +all: manual + +gen_html: gen_html.cpp + $(CXX) $(FLAGS) $^ -o $@$(EXT) + +$(ZSTDMANUAL): gen_html $(ZSTDAPI) + echo "Update zstd manual in /doc" + ./gen_html $(LIBVER) $(ZSTDAPI) $(ZSTDMANUAL) + +.PHONY: manual +manual: gen_html $(ZSTDMANUAL) + +.PHONY: clean +clean: + @$(RM) gen_html$(EXT) + @echo Cleaning completed diff --git a/externals/zstd/contrib/gen_html/gen-zstd-manual.sh b/externals/zstd/contrib/gen_html/gen-zstd-manual.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/largeNbDicts/Makefile b/externals/zstd/contrib/largeNbDicts/Makefile new file mode 100644 index 00000000..40734e62 --- /dev/null +++ b/externals/zstd/contrib/largeNbDicts/Makefile @@ -0,0 +1,58 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +PROGDIR = ../../programs +LIBDIR = ../../lib + +LIBZSTD = $(LIBDIR)/libzstd.a + +CPPFLAGS+= -I$(LIBDIR) -I$(LIBDIR)/common -I$(LIBDIR)/dictBuilder -I$(PROGDIR) + +CFLAGS ?= -O3 +CFLAGS += -std=gnu99 +DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum \ + -Wstrict-prototypes -Wundef -Wpointer-arith \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls +CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) + + +default: largeNbDicts + +all : largeNbDicts + +largeNbDicts: util.o timefn.o benchfn.o datagen.o xxhash.o largeNbDicts.c $(LIBZSTD) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +.PHONY: $(LIBZSTD) +$(LIBZSTD): + $(MAKE) -C $(LIBDIR) libzstd.a CFLAGS="$(CFLAGS)" + +benchfn.o: $(PROGDIR)/benchfn.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + +timefn.o: $(PROGDIR)/timefn.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + +datagen.o: $(PROGDIR)/datagen.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + +util.o: $(PROGDIR)/util.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + + +xxhash.o : $(LIBDIR)/common/xxhash.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + + +clean: + $(RM) *.o + $(MAKE) -C $(LIBDIR) clean > /dev/null + $(RM) largeNbDicts diff --git a/externals/zstd/contrib/linux-kernel/Makefile b/externals/zstd/contrib/linux-kernel/Makefile new file mode 100644 index 00000000..63dd15d9 --- /dev/null +++ b/externals/zstd/contrib/linux-kernel/Makefile @@ -0,0 +1,108 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +.PHONY: libzstd +libzstd: + rm -rf linux + mkdir -p linux + mkdir -p linux/include/linux + mkdir -p linux/lib/zstd + ../freestanding_lib/freestanding.py \ + --source-lib ../../lib \ + --output-lib linux/lib/zstd \ + --xxhash '' \ + --xxh64-state 'struct xxh64_state' \ + --xxh64-prefix 'xxh64' \ + --rewrite-include '=' \ + --rewrite-include '=' \ + --rewrite-include '"\.\./zstd.h"=' \ + --rewrite-include '"(\.\./)?zstd_errors.h"=' \ + --sed 's,/\*\*\*,/* *,g' \ + --sed 's,/\*\*,/*,g' \ + --spdx \ + -DZSTD_NO_INTRINSICS \ + -DZSTD_NO_UNUSED_FUNCTIONS \ + -DZSTD_LEGACY_SUPPORT=0 \ + -DZSTD_STATIC_LINKING_ONLY \ + -DFSE_STATIC_LINKING_ONLY \ + -DXXH_STATIC_LINKING_ONLY \ + -D__GNUC__ \ + -D__linux__=1 \ + -DSTATIC_BMI2=0 \ + -DZSTD_ADDRESS_SANITIZER=0 \ + -DZSTD_MEMORY_SANITIZER=0 \ + -DZSTD_DATAFLOW_SANITIZER=0 \ + -DZSTD_COMPRESS_HEAPMODE=1 \ + -UNO_PREFETCH \ + -U__cplusplus \ + -UZSTD_DLL_EXPORT \ + -UZSTD_DLL_IMPORT \ + -U__ICCARM__ \ + -UZSTD_MULTITHREAD \ + -U_MSC_VER \ + -U_WIN32 \ + -RZSTDLIB_VISIBLE= \ + -RZSTDERRORLIB_VISIBLE= \ + -RZSTD_FALLTHROUGH=fallthrough \ + -DZSTD_HAVE_WEAK_SYMBOLS=0 \ + -DZSTD_TRACE=0 \ + -DZSTD_NO_TRACE \ + -DZSTD_DISABLE_ASM \ + -DZSTD_LINUX_KERNEL + rm linux/lib/zstd/decompress/huf_decompress_amd64.S + mv linux/lib/zstd/zstd.h linux/include/linux/zstd_lib.h + mv linux/lib/zstd/zstd_errors.h linux/include/linux/ + cp linux_zstd.h linux/include/linux/zstd.h + cp zstd_common_module.c linux/lib/zstd + cp zstd_compress_module.c linux/lib/zstd + cp zstd_decompress_module.c linux/lib/zstd + cp decompress_sources.h linux/lib/zstd + cp linux.mk linux/lib/zstd/Makefile + +LINUX ?= $(HOME)/repos/linux + +.PHONY: import +import: libzstd + rm -f $(LINUX)/include/linux/zstd.h + rm -f $(LINUX)/include/linux/zstd_errors.h + rm -rf $(LINUX)/lib/zstd + cp linux/include/linux/zstd.h $(LINUX)/include/linux + cp linux/include/linux/zstd_lib.h $(LINUX)/include/linux + cp linux/include/linux/zstd_errors.h $(LINUX)/include/linux + cp -r linux/lib/zstd $(LINUX)/lib + +import-upstream: + rm -rf $(LINUX)/lib/zstd + mkdir $(LINUX)/lib/zstd + cp ../../lib/zstd.h $(LINUX)/include/linux/zstd_lib.h + cp -r ../../lib/common $(LINUX)/lib/zstd + cp -r ../../lib/compress $(LINUX)/lib/zstd + cp -r ../../lib/decompress $(LINUX)/lib/zstd + mv $(LINUX)/lib/zstd/zstd_errors.h $(LINUX)/include/linux + rm $(LINUX)/lib/zstd/common/threading.* + rm $(LINUX)/lib/zstd/common/pool.* + rm $(LINUX)/lib/zstd/common/xxhash.* + rm $(LINUX)/lib/zstd/compress/zstdmt_* + +DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef -Wpointer-arith \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls -Wmissing-prototypes -Wc++-compat \ + -Wimplicit-fallthrough + +.PHONY: test +test: libzstd + $(MAKE) -C test run-test CFLAGS="-O3 $(CFLAGS) $(DEBUGFLAGS) -Werror" -j + +.PHONY: clean +clean: + $(RM) -rf linux + $(MAKE) -C test clean diff --git a/externals/zstd/contrib/linux-kernel/btrfs-benchmark.sh b/externals/zstd/contrib/linux-kernel/btrfs-benchmark.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/linux-kernel/btrfs-extract-benchmark.sh b/externals/zstd/contrib/linux-kernel/btrfs-extract-benchmark.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/linux-kernel/squashfs-benchmark.sh b/externals/zstd/contrib/linux-kernel/squashfs-benchmark.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/linux-kernel/test/Makefile b/externals/zstd/contrib/linux-kernel/test/Makefile new file mode 100644 index 00000000..67b55e66 --- /dev/null +++ b/externals/zstd/contrib/linux-kernel/test/Makefile @@ -0,0 +1,49 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +LINUX := ../linux +LINUX_ZSTDLIB := $(LINUX)/lib/zstd + +CPPFLAGS += -I$(LINUX)/include -I$(LINUX_ZSTDLIB) -Iinclude -DNDEBUG -Wno-deprecated-declarations +# Don't poison the workspace, it currently doesn't work with static allocation and workspace reuse +CPPFLAGS += -DZSTD_ASAN_DONT_POISON_WORKSPACE + +LINUX_ZSTD_MODULE := $(wildcard $(LINUX_ZSTDLIB)/*.c) +LINUX_ZSTD_COMMON := $(wildcard $(LINUX_ZSTDLIB)/common/*.c) +LINUX_ZSTD_COMPRESS := $(wildcard $(LINUX_ZSTDLIB)/compress/*.c) +LINUX_ZSTD_DECOMPRESS := $(wildcard $(LINUX_ZSTDLIB)/decompress/*.c $(LINUX_ZSTDLIB)/decompress/*.S) +LINUX_ZSTD_FILES := $(LINUX_ZSTD_MODULE) $(LINUX_ZSTD_COMMON) $(LINUX_ZSTD_COMPRESS) $(LINUX_ZSTD_DECOMPRESS) +LINUX_ZSTD_OBJECTS0 := $(LINUX_ZSTD_FILES:.c=.o) +LINUX_ZSTD_OBJECTS := $(LINUX_ZSTD_OBJECTS0:.S=.o) + +%.o: %.S + $(COMPILE.S) $(OUTPUT_OPTION) $< + +liblinuxzstd.a: $(LINUX_ZSTD_OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +test: test.c liblinuxzstd.a + $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) $^ -o $@ + +static_test: static_test.c + $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) $^ -o $@ + +run-test: test static_test + ./macro-test.sh + ./test + ./static_test + +.PHONY: +clean: + $(RM) -f $(LINUX_ZSTDLIB)/*.o + $(RM) -f $(LINUX_ZSTDLIB)/**/*.o + $(RM) -f *.o *.a + $(RM) -f static_test + $(RM) -f test diff --git a/externals/zstd/contrib/linux-kernel/test/macro-test.sh b/externals/zstd/contrib/linux-kernel/test/macro-test.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/contrib/pzstd/Makefile b/externals/zstd/contrib/pzstd/Makefile new file mode 100644 index 00000000..e62f8e87 --- /dev/null +++ b/externals/zstd/contrib/pzstd/Makefile @@ -0,0 +1,268 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +# Standard variables for installation +DESTDIR ?= +PREFIX ?= /usr/local +BINDIR := $(DESTDIR)$(PREFIX)/bin + +ZSTDDIR = ../../lib +PROGDIR = ../../programs + +# External program to use to run tests, e.g. qemu or valgrind +TESTPROG ?= +# Flags to pass to the tests +TESTFLAGS ?= + +# We use gcc/clang to generate the header dependencies of files +DEPFLAGS = -MMD -MP -MF $*.Td +POSTCOMPILE = mv -f $*.Td $*.d + +# CFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS are for the users to override +CFLAGS ?= -O3 -Wall -Wextra +CXXFLAGS ?= -O3 -Wall -Wextra -pedantic +CPPFLAGS ?= +LDFLAGS ?= + +# PZstd uses legacy APIs +CFLAGS += -Wno-deprecated-declarations + +# Include flags +PZSTD_INC = -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(PROGDIR) -I. +GTEST_INC = -isystem googletest/googletest/include + +# If default C++ version is older than C++11, explicitly set C++11, which is the +# minimum required by the code. +ifeq ($(shell echo "\043if __cplusplus < 201103L\n\043error\n\043endif" | $(CXX) -x c++ -Werror -c - -o /dev/null 2>/dev/null && echo 1 || echo 0),0) +PZSTD_CXX_STD := -std=c++11 +endif + +PZSTD_CPPFLAGS = $(PZSTD_INC) +PZSTD_CCXXFLAGS = +PZSTD_CFLAGS = $(PZSTD_CCXXFLAGS) +PZSTD_CXXFLAGS = $(PZSTD_CCXXFLAGS) $(PZSTD_CXX_STD) +PZSTD_LDFLAGS = +EXTRA_FLAGS = +ALL_CFLAGS = $(EXTRA_FLAGS) $(CPPFLAGS) $(PZSTD_CPPFLAGS) $(CFLAGS) $(PZSTD_CFLAGS) +ALL_CXXFLAGS = $(EXTRA_FLAGS) $(CPPFLAGS) $(PZSTD_CPPFLAGS) $(CXXFLAGS) $(PZSTD_CXXFLAGS) +ALL_LDFLAGS = $(EXTRA_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(PZSTD_LDFLAGS) + + +# gtest libraries need to go before "-lpthread" because they depend on it. +GTEST_LIB = -L googletest/build/googlemock/gtest +LIBS = + +# Compilation commands +LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -pthread -o $@ +CC_COMMAND = $(CC) $(DEPFLAGS) $(ALL_CFLAGS) -c $< -o $@ +CXX_COMMAND = $(CXX) $(DEPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@ + +# List all the pzstd source files so we can determine their dependencies +PZSTD_SRCS := $(wildcard *.cpp) +PZSTD_TESTS := $(wildcard test/*.cpp) +UTILS_TESTS := $(wildcard utils/test/*.cpp) +ALL_SRCS := $(PZSTD_SRCS) $(PZSTD_TESTS) $(UTILS_TESTS) + + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + +# Standard targets +.PHONY: default +default: all + +.PHONY: test-pzstd +test-pzstd: TESTFLAGS=--gtest_filter=-*ExtremelyLarge* +test-pzstd: clean googletest pzstd tests check + +.PHONY: test-pzstd32 +test-pzstd32: clean googletest32 all32 check + +.PHONY: test-pzstd-tsan +test-pzstd-tsan: LDFLAGS=-fuse-ld=gold +test-pzstd-tsan: TESTFLAGS=--gtest_filter=-*ExtremelyLarge* +test-pzstd-tsan: clean googletest tsan check + +.PHONY: test-pzstd-asan +test-pzstd-asan: LDFLAGS=-fuse-ld=gold +test-pzstd-asan: TESTFLAGS=--gtest_filter=-*ExtremelyLarge* +test-pzstd-asan: clean asan check + +.PHONY: check +check: + $(TESTPROG) ./utils/test/BufferTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./utils/test/RangeTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./utils/test/ResourcePoolTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./utils/test/ScopeGuardTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./utils/test/ThreadPoolTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./utils/test/WorkQueueTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./test/OptionsTest$(EXT) $(TESTFLAGS) + $(TESTPROG) ./test/PzstdTest$(EXT) $(TESTFLAGS) + +.PHONY: install +install: PZSTD_CPPFLAGS += -DNDEBUG +install: pzstd$(EXT) + install -d -m 755 $(BINDIR)/ + install -m 755 pzstd$(EXT) $(BINDIR)/pzstd$(EXT) + +.PHONY: uninstall +uninstall: + $(RM) $(BINDIR)/pzstd$(EXT) + +# Targets for many different builds +.PHONY: all +all: PZSTD_CPPFLAGS += -DNDEBUG +all: pzstd$(EXT) + +.PHONY: debug +debug: EXTRA_FLAGS += -g +debug: pzstd$(EXT) tests roundtrip + +.PHONY: tsan +tsan: PZSTD_CCXXFLAGS += -fsanitize=thread -fPIC +tsan: PZSTD_LDFLAGS += -fsanitize=thread +tsan: debug + +.PHONY: asan +asan: EXTRA_FLAGS += -fsanitize=address +asan: debug + +.PHONY: ubsan +ubsan: EXTRA_FLAGS += -fsanitize=undefined +ubsan: debug + +.PHONY: all32 +all32: EXTRA_FLAGS += -m32 +all32: all tests roundtrip + +.PHONY: debug32 +debug32: EXTRA_FLAGS += -m32 +debug32: debug + +.PHONY: asan32 +asan32: EXTRA_FLAGS += -m32 +asan32: asan + +.PHONY: tsan32 +tsan32: EXTRA_FLAGS += -m32 +tsan32: tsan + +.PHONY: ubsan32 +ubsan32: EXTRA_FLAGS += -m32 +ubsan32: ubsan + +# Run long round trip tests +.PHONY: roundtripcheck +roundtripcheck: roundtrip check + $(TESTPROG) ./test/RoundTripTest$(EXT) $(TESTFLAGS) + +# Build the main binary +pzstd$(EXT): main.o $(PROGDIR)/util.o Options.o Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a + $(LD_COMMAND) + +# Target that depends on all the tests +.PHONY: tests +tests: EXTRA_FLAGS += -Wno-deprecated-declarations +tests: $(patsubst %,%$(EXT),$(basename $(PZSTD_TESTS) $(UTILS_TESTS))) + +# Build the round trip tests +.PHONY: roundtrip +roundtrip: EXTRA_FLAGS += -Wno-deprecated-declarations +roundtrip: test/RoundTripTest$(EXT) + +# Use the static library that zstd builds for simplicity and +# so we get the compiler options correct +.PHONY: $(ZSTDDIR)/libzstd.a +$(ZSTDDIR)/libzstd.a: + CFLAGS="$(ALL_CFLAGS)" LDFLAGS="$(ALL_LDFLAGS)" $(MAKE) -C $(ZSTDDIR) libzstd.a + +# Rules to build the tests +test/RoundTripTest$(EXT): test/RoundTripTest.o $(PROGDIR)/datagen.o \ + $(PROGDIR)/util.o Options.o \ + Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a + $(LD_COMMAND) + +test/%Test$(EXT): PZSTD_LDFLAGS += $(GTEST_LIB) +test/%Test$(EXT): LIBS += -lgtest -lgtest_main +test/%Test$(EXT): test/%Test.o $(PROGDIR)/datagen.o \ + $(PROGDIR)/util.o Options.o Pzstd.o \ + SkippableFrame.o $(ZSTDDIR)/libzstd.a + $(LD_COMMAND) + +utils/test/%Test$(EXT): PZSTD_LDFLAGS += $(GTEST_LIB) +utils/test/%Test$(EXT): LIBS += -lgtest -lgtest_main +utils/test/%Test$(EXT): utils/test/%Test.o + $(LD_COMMAND) + + +GTEST_CMAKEFLAGS = + +# Install googletest +.PHONY: googletest +googletest: PZSTD_CCXXFLAGS += -fPIC +googletest: + @$(RM) -rf googletest + @git clone https://github.com/google/googletest + @mkdir -p googletest/build + @cd googletest/build && cmake $(GTEST_CMAKEFLAGS) -DCMAKE_CXX_FLAGS="$(ALL_CXXFLAGS)" .. && $(MAKE) + +.PHONY: googletest32 +googletest32: PZSTD_CCXXFLAGS += -m32 +googletest32: googletest + +.PHONY: googletest-mingw64 +googletest-mingw64: GTEST_CMAKEFLAGS += -G "MSYS Makefiles" +googletest-mingw64: googletest + +.PHONY: clean +clean: + $(RM) -f *.o pzstd$(EXT) *.Td *.d + $(RM) -f test/*.o test/*Test$(EXT) test/*.Td test/*.d + $(RM) -f utils/test/*.o utils/test/*Test$(EXT) utils/test/*.Td utils/test/*.d + $(RM) -f $(PROGDIR)/*.o $(PROGDIR)/*.Td $(PROGDIR)/*.d + $(MAKE) -C $(ZSTDDIR) clean + @echo Cleaning completed + + +# Cancel implicit rules +%.o: %.c +%.o: %.cpp + +# Object file rules +%.o: %.c + $(CC_COMMAND) + $(POSTCOMPILE) + +$(PROGDIR)/%.o: $(PROGDIR)/%.c + $(CC_COMMAND) + $(POSTCOMPILE) + +%.o: %.cpp + $(CXX_COMMAND) + $(POSTCOMPILE) + +test/%.o: PZSTD_CPPFLAGS += $(GTEST_INC) +test/%.o: test/%.cpp + $(CXX_COMMAND) + $(POSTCOMPILE) + +utils/test/%.o: PZSTD_CPPFLAGS += $(GTEST_INC) +utils/test/%.o: utils/test/%.cpp + $(CXX_COMMAND) + $(POSTCOMPILE) + +# Dependency file stuff +.PRECIOUS: %.d test/%.d utils/test/%.d + +# Include rules that specify header file dependencies +-include $(patsubst %,%.d,$(basename $(ALL_SRCS))) diff --git a/externals/zstd/contrib/recovery/Makefile b/externals/zstd/contrib/recovery/Makefile new file mode 100644 index 00000000..be6ea4b0 --- /dev/null +++ b/externals/zstd/contrib/recovery/Makefile @@ -0,0 +1,35 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +.PHONY: all +all: recover_directory + +ZSTDLIBDIR ?= ../../lib +PROGRAMDIR ?= ../../programs + +CFLAGS ?= -O3 +CFLAGS += -I$(ZSTDLIBDIR) -I$(PROGRAMDIR) +CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum \ + -Wstrict-prototypes -Wundef \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls -Wmissing-prototypes +CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + +.PHONY: $(ZSTDLIBDIR)/libzstd.a +$(ZSTDLIBDIR)/libzstd.a: + $(MAKE) -C $(ZSTDLIBDIR) libzstd.a + +recover_directory: recover_directory.c $(ZSTDLIBDIR)/libzstd.a $(PROGRAMDIR)/util.c + $(CC) $(FLAGS) $^ -o $@$(EXT) + +.PHONY: clean +clean: + rm -f recover_directory diff --git a/externals/zstd/contrib/seekable_format/examples/Makefile b/externals/zstd/contrib/seekable_format/examples/Makefile new file mode 100644 index 00000000..fcc04587 --- /dev/null +++ b/externals/zstd/contrib/seekable_format/examples/Makefile @@ -0,0 +1,53 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +# This Makefile presumes libzstd is built, using `make` in / or /lib/ + +ZSTDLIB_PATH = ../../../lib +ZSTDLIB_NAME = libzstd.a +ZSTDLIB = $(ZSTDLIB_PATH)/$(ZSTDLIB_NAME) + +CPPFLAGS += -DXXH_NAMESPACE=ZSTD_ -I../ -I../../../lib -I../../../lib/common + +CFLAGS ?= -O3 +CFLAGS += -g + +SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c $(ZSTDLIB) + +.PHONY: default all clean test + +default: all + +all: seekable_compression seekable_decompression seekable_decompression_mem \ + parallel_processing + +$(ZSTDLIB): + make -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME) + +seekable_compression : seekable_compression.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +seekable_decompression : seekable_decompression.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +seekable_decompression_mem : seekable_decompression_mem.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +parallel_processing : parallel_processing.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ -pthread + +parallel_compression : parallel_compression.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ -pthread + +clean: + @rm -f core *.o tmp* result* *.zst \ + seekable_compression seekable_decompression \ + seekable_decompression_mem \ + parallel_processing parallel_compression + @echo Cleaning completed diff --git a/externals/zstd/contrib/seekable_format/tests/Makefile b/externals/zstd/contrib/seekable_format/tests/Makefile new file mode 100644 index 00000000..a81f2229 --- /dev/null +++ b/externals/zstd/contrib/seekable_format/tests/Makefile @@ -0,0 +1,38 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +# This Makefile presumes libzstd is built, using `make` in / or /lib/ + +ZSTDLIB_PATH = ../../../lib +ZSTDLIB_NAME = libzstd.a +ZSTDLIB = $(ZSTDLIB_PATH)/$(ZSTDLIB_NAME) + +CPPFLAGS += -DXXH_NAMESPACE=ZSTD_ -I../ -I$(ZSTDLIB_PATH) -I$(ZSTDLIB_PATH)/common + +CFLAGS ?= -O3 +CFLAGS += -g -Wall -Wextra -Wcast-qual -Wcast-align -Wconversion \ + -Wformat=2 -Wstrict-aliasing=1 + +SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c $(ZSTDLIB) + +.PHONY: default clean test +default: test + +test: seekable_tests + ./seekable_tests + +$(ZSTDLIB): + $(MAKE) -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME) + +seekable_tests : $(SEEKABLE_OBJS) + +clean: + @$(RM) core *.o tmp* result* *.zst \ + seekable_tests + @echo Cleaning completed diff --git a/externals/zstd/contrib/seqBench/Makefile b/externals/zstd/contrib/seqBench/Makefile new file mode 100644 index 00000000..e7f08a42 --- /dev/null +++ b/externals/zstd/contrib/seqBench/Makefile @@ -0,0 +1,58 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +PROGDIR = ../../programs +LIBDIR = ../../lib + +LIBZSTD = $(LIBDIR)/libzstd.a + +CPPFLAGS+= -I$(LIBDIR) -I$(LIBDIR)/common -I$(LIBDIR)/dictBuilder -I$(PROGDIR) + +CFLAGS ?= -O3 -g +CFLAGS += -std=gnu99 +DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum \ + -Wstrict-prototypes -Wundef -Wpointer-arith \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls +CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) + + +default: seqBench + +all : seqBench + +seqBench: util.o timefn.o benchfn.o datagen.o xxhash.o seqBench.c $(LIBZSTD) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +.PHONY: $(LIBZSTD) +$(LIBZSTD): + $(MAKE) -C $(LIBDIR) libzstd.a CFLAGS="$(CFLAGS)" + +benchfn.o: $(PROGDIR)/benchfn.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + +timefn.o: $(PROGDIR)/timefn.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + +datagen.o: $(PROGDIR)/datagen.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + +util.o: $(PROGDIR)/util.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + + +xxhash.o : $(LIBDIR)/common/xxhash.c + $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c + + +clean: + $(RM) *.o + $(MAKE) -C $(LIBDIR) clean > /dev/null + $(RM) seqBench diff --git a/externals/zstd/doc/educational_decoder/Makefile b/externals/zstd/doc/educational_decoder/Makefile new file mode 100644 index 00000000..f6deeb13 --- /dev/null +++ b/externals/zstd/doc/educational_decoder/Makefile @@ -0,0 +1,62 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +ZSTD ?= zstd # note: requires zstd installation on local system + +UNAME?= $(shell uname) +ifeq ($(UNAME), SunOS) +DIFF ?= gdiff +else +DIFF ?= diff +endif + +HARNESS_FILES=*.c + +MULTITHREAD_LDFLAGS = -pthread +DEBUGFLAGS= -g -DZSTD_DEBUG=1 +CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ + -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) +CFLAGS ?= -O2 +CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum \ + -Wredundant-decls -Wstrict-prototypes -Wundef \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -std=c99 +CFLAGS += $(DEBUGFLAGS) +CFLAGS += $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS) + +harness: $(HARNESS_FILES) + $(CC) $(FLAGS) $^ -o $@ + +clean: + @$(RM) harness *.o + @$(RM) -rf harness.dSYM # MacOS specific + +test: harness + # + # Testing single-file decompression with educational decoder + # + @$(ZSTD) -f README.md -o tmp.zst + @./harness tmp.zst tmp + @$(DIFF) -s tmp README.md + @$(RM) tmp* + # + # Testing dictionary decompression with education decoder + # + # note : files are presented multiple for training, to reach minimum threshold + @$(ZSTD) --train harness.c zstd_decompress.c zstd_decompress.h README.md \ + harness.c zstd_decompress.c zstd_decompress.h README.md \ + harness.c zstd_decompress.c zstd_decompress.h README.md \ + -o dictionary + @$(ZSTD) -f README.md -D dictionary -o tmp.zst + @./harness tmp.zst tmp dictionary + @$(DIFF) -s tmp README.md + @$(RM) tmp* dictionary diff --git a/externals/zstd/examples/Makefile b/externals/zstd/examples/Makefile new file mode 100644 index 00000000..31f52d35 --- /dev/null +++ b/externals/zstd/examples/Makefile @@ -0,0 +1,93 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +LIBDIR =../lib +CPPFLAGS += -I$(LIBDIR) +LIB = $(LIBDIR)/libzstd.a + + +.PHONY: default +default: all + +.PHONY: all +all: simple_compression simple_decompression \ + multiple_simple_compression\ + dictionary_compression dictionary_decompression \ + streaming_compression streaming_decompression \ + multiple_streaming_compression streaming_memory_usage + +$(LIB) : + $(MAKE) -C $(LIBDIR) libzstd.a + +simple_compression.o: common.h +simple_compression : $(LIB) + +simple_decompression.o: common.h +simple_decompression : $(LIB) + +multiple_simple_compression.o: common.h +multiple_simple_compression : $(LIB) + +dictionary_compression.o: common.h +dictionary_compression : $(LIB) + +dictionary_decompression.o: common.h +dictionary_decompression : $(LIB) + +streaming_compression.o: common.h +streaming_compression : $(LIB) + +multiple_streaming_compression.o: common.h +multiple_streaming_compression : $(LIB) + +streaming_decompression.o: common.h +streaming_decompression : $(LIB) + +streaming_memory_usage.o: common.h +streaming_memory_usage : $(LIB) + + +.PHONY:clean +clean: + @$(RM) core *.o tmp* result* *.zst \ + simple_compression simple_decompression \ + multiple_simple_compression \ + dictionary_compression dictionary_decompression \ + streaming_compression streaming_decompression \ + multiple_streaming_compression streaming_memory_usage + @echo Cleaning completed + +.PHONY:test +test: all + cp README.md tmp + cp Makefile tmp2 + @echo -- Simple compression tests + ./simple_compression tmp + ./simple_decompression tmp.zst + ./multiple_simple_compression *.c + ./streaming_decompression tmp.zst > /dev/null + @echo -- Streaming memory usage + ./streaming_memory_usage + @echo -- Streaming compression tests + ./streaming_compression tmp + ./streaming_decompression tmp.zst > /dev/null + @echo -- Edge cases detection + ! ./streaming_decompression tmp # invalid input, must fail + ! ./simple_decompression tmp # invalid input, must fail + touch tmpNull # create 0-size file + ./simple_compression tmpNull + ./simple_decompression tmpNull.zst # 0-size frame : must work + @echo -- Multiple streaming tests + ./multiple_streaming_compression *.c + @echo -- Dictionary compression tests + ./dictionary_compression tmp2 tmp README.md + ./dictionary_decompression tmp2.zst tmp.zst README.md + $(RM) tmp* *.zst + @echo tests completed diff --git a/externals/zstd/lib/Makefile b/externals/zstd/lib/Makefile new file mode 100644 index 00000000..a4cf61ab --- /dev/null +++ b/externals/zstd/lib/Makefile @@ -0,0 +1,357 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +# Modules +ZSTD_LIB_COMPRESSION ?= 1 +ZSTD_LIB_DECOMPRESSION ?= 1 +ZSTD_LIB_DICTBUILDER ?= 1 +ZSTD_LIB_DEPRECATED ?= 0 + +# Input variables for libzstd.mk +ifeq ($(ZSTD_LIB_COMPRESSION), 0) + ZSTD_LIB_DICTBUILDER = 0 + ZSTD_LIB_DEPRECATED = 0 +endif + +ifeq ($(ZSTD_LIB_DECOMPRESSION), 0) + ZSTD_LEGACY_SUPPORT = 0 + ZSTD_LIB_DEPRECATED = 0 +endif + +include libzstd.mk + +ZSTD_FILES := $(ZSTD_COMMON_FILES) $(ZSTD_LEGACY_FILES) + +ifneq ($(ZSTD_LIB_COMPRESSION), 0) + ZSTD_FILES += $(ZSTD_COMPRESS_FILES) +endif + +ifneq ($(ZSTD_LIB_DECOMPRESSION), 0) + ZSTD_FILES += $(ZSTD_DECOMPRESS_FILES) +endif + +ifneq ($(ZSTD_LIB_DEPRECATED), 0) + ZSTD_FILES += $(ZSTD_DEPRECATED_FILES) +endif + +ifneq ($(ZSTD_LIB_DICTBUILDER), 0) + ZSTD_FILES += $(ZSTD_DICTBUILDER_FILES) +endif + +ZSTD_LOCAL_SRC := $(notdir $(ZSTD_FILES)) +ZSTD_LOCAL_OBJ0 := $(ZSTD_LOCAL_SRC:.c=.o) +ZSTD_LOCAL_OBJ := $(ZSTD_LOCAL_OBJ0:.S=.o) + +VERSION := $(ZSTD_VERSION) + +# Note: by default, the static library is built single-threaded and dynamic library is built +# multi-threaded. It is possible to force multi or single threaded builds by appending +# -mt or -nomt to the build target (like lib-mt for multi-threaded, lib-nomt for single-threaded). +.PHONY: default +default: lib-release + +CPPFLAGS_DYNLIB += -DZSTD_MULTITHREAD # dynamic library build defaults to multi-threaded +LDFLAGS_DYNLIB += -pthread +CPPFLAGS_STATLIB += # static library build defaults to single-threaded + + +ifeq ($(findstring GCC,$(CCVER)),GCC) +decompress/zstd_decompress_block.o : CFLAGS+=-fno-tree-vectorize +endif + + +# macOS linker doesn't support -soname, and use different extension +# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html +ifeq ($(UNAME), Darwin) + SHARED_EXT = dylib + SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT) + SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT) + SONAME_FLAGS = -install_name $(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER) +else + ifeq ($(UNAME), AIX) + SONAME_FLAGS = + else + SONAME_FLAGS = -Wl,-soname=libzstd.$(SHARED_EXT).$(LIBVER_MAJOR) + endif + SHARED_EXT = so + SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR) + SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) +endif + + +.PHONY: all +all: lib + + +.PHONY: libzstd.a # must be run every time +libzstd.a: CPPFLAGS += $(CPPFLAGS_STATLIB) + +SET_CACHE_DIRECTORY = \ + +$(MAKE) --no-print-directory $@ \ + BUILD_DIR=obj/$(HASH_DIR) \ + CPPFLAGS="$(CPPFLAGS)" \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" + +ifndef BUILD_DIR +# determine BUILD_DIR from compilation flags + +libzstd.a: + $(SET_CACHE_DIRECTORY) + +else +# BUILD_DIR is defined + +ZSTD_STATLIB_DIR := $(BUILD_DIR)/static +ZSTD_STATLIB := $(ZSTD_STATLIB_DIR)/libzstd.a +ZSTD_STATLIB_OBJ := $(addprefix $(ZSTD_STATLIB_DIR)/,$(ZSTD_LOCAL_OBJ)) +$(ZSTD_STATLIB): ARFLAGS = rcs +$(ZSTD_STATLIB): | $(ZSTD_STATLIB_DIR) +$(ZSTD_STATLIB): $(ZSTD_STATLIB_OBJ) + # Check for multithread flag at target execution time + $(if $(filter -DZSTD_MULTITHREAD,$(CPPFLAGS)),\ + @echo compiling multi-threaded static library $(LIBVER),\ + @echo compiling single-threaded static library $(LIBVER)) + $(AR) $(ARFLAGS) $@ $^ + +libzstd.a: $(ZSTD_STATLIB) + cp -f $< $@ + +endif + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) + +LIBZSTD = dll/libzstd.dll +$(LIBZSTD): $(ZSTD_FILES) + @echo compiling dynamic library $(LIBVER) + $(CC) $(FLAGS) -DZSTD_DLL_EXPORT=1 -Wl,--out-implib,dll/libzstd.dll.a -shared $^ -o $@ + +else # not Windows + +LIBZSTD = libzstd.$(SHARED_EXT_VER) +.PHONY: $(LIBZSTD) # must be run every time +$(LIBZSTD): CPPFLAGS += $(CPPFLAGS_DYNLIB) +$(LIBZSTD): CFLAGS += -fPIC -fvisibility=hidden +$(LIBZSTD): LDFLAGS += -shared $(LDFLAGS_DYNLIB) + +ifndef BUILD_DIR +# determine BUILD_DIR from compilation flags + +$(LIBZSTD): + $(SET_CACHE_DIRECTORY) + +else +# BUILD_DIR is defined + +ZSTD_DYNLIB_DIR := $(BUILD_DIR)/dynamic +ZSTD_DYNLIB := $(ZSTD_DYNLIB_DIR)/$(LIBZSTD) +ZSTD_DYNLIB_OBJ := $(addprefix $(ZSTD_DYNLIB_DIR)/,$(ZSTD_LOCAL_OBJ)) + +$(ZSTD_DYNLIB): | $(ZSTD_DYNLIB_DIR) +$(ZSTD_DYNLIB): $(ZSTD_DYNLIB_OBJ) +# Check for multithread flag at target execution time + $(if $(filter -DZSTD_MULTITHREAD,$(CPPFLAGS)),\ + @echo compiling multi-threaded dynamic library $(LIBVER),\ + @echo compiling single-threaded dynamic library $(LIBVER)) + $(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@ + @echo creating versioned links + ln -sf $@ libzstd.$(SHARED_EXT_MAJOR) + ln -sf $@ libzstd.$(SHARED_EXT) + +$(LIBZSTD): $(ZSTD_DYNLIB) + cp -f $< $@ + +endif # ifndef BUILD_DIR +endif # if windows + +.PHONY: libzstd +libzstd : $(LIBZSTD) + +.PHONY: lib +lib : libzstd.a libzstd + + +# note : do not define lib-mt or lib-release as .PHONY +# make does not consider implicit pattern rule for .PHONY target + +%-mt : CPPFLAGS_DYNLIB := -DZSTD_MULTITHREAD +%-mt : CPPFLAGS_STATLIB := -DZSTD_MULTITHREAD +%-mt : LDFLAGS_DYNLIB := -pthread +%-mt : % + @echo multi-threaded build completed + +%-nomt : CPPFLAGS_DYNLIB := +%-nomt : LDFLAGS_DYNLIB := +%-nomt : CPPFLAGS_STATLIB := +%-nomt : % + @echo single-threaded build completed + +%-release : DEBUGFLAGS := +%-release : % + @echo release build completed + + +# Generate .h dependencies automatically + +DEPFLAGS = -MT $@ -MMD -MP -MF + +$(ZSTD_DYNLIB_DIR)/%.o : %.c $(ZSTD_DYNLIB_DIR)/%.d | $(ZSTD_DYNLIB_DIR) + @echo CC $@ + $(COMPILE.c) $(DEPFLAGS) $(ZSTD_DYNLIB_DIR)/$*.d $(OUTPUT_OPTION) $< + +$(ZSTD_STATLIB_DIR)/%.o : %.c $(ZSTD_STATLIB_DIR)/%.d | $(ZSTD_STATLIB_DIR) + @echo CC $@ + $(COMPILE.c) $(DEPFLAGS) $(ZSTD_STATLIB_DIR)/$*.d $(OUTPUT_OPTION) $< + +$(ZSTD_DYNLIB_DIR)/%.o : %.S | $(ZSTD_DYNLIB_DIR) + @echo AS $@ + $(COMPILE.S) $(OUTPUT_OPTION) $< + +$(ZSTD_STATLIB_DIR)/%.o : %.S | $(ZSTD_STATLIB_DIR) + @echo AS $@ + $(COMPILE.S) $(OUTPUT_OPTION) $< + +MKDIR ?= mkdir +$(BUILD_DIR) $(ZSTD_DYNLIB_DIR) $(ZSTD_STATLIB_DIR): + $(MKDIR) -p $@ + +DEPFILES := $(ZSTD_DYNLIB_OBJ:.o=.d) $(ZSTD_STATLIB_OBJ:.o=.d) +$(DEPFILES): + +include $(wildcard $(DEPFILES)) + + +# Special case : building library in single-thread mode _and_ without zstdmt_compress.c +ZSTDMT_FILES = compress/zstdmt_compress.c +ZSTD_NOMT_FILES = $(filter-out $(ZSTDMT_FILES),$(ZSTD_FILES)) +libzstd-nomt: CFLAGS += -fPIC -fvisibility=hidden +libzstd-nomt: LDFLAGS += -shared +libzstd-nomt: $(ZSTD_NOMT_FILES) + @echo compiling single-thread dynamic library $(LIBVER) + @echo files : $(ZSTD_NOMT_FILES) + $(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@ + +.PHONY: clean +clean: + $(RM) -r *.dSYM # macOS-specific + $(RM) core *.o *.a *.gcda *.$(SHARED_EXT) *.$(SHARED_EXT).* libzstd.pc + $(RM) dll/libzstd.dll dll/libzstd.lib libzstd-nomt* + $(RM) -r obj/* + @echo Cleaning library completed + +#----------------------------------------------------------------------------- +# make install is validated only for below listed environments +#----------------------------------------------------------------------------- +ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX)) + +lib: libzstd.pc + +HAS_EXPLICIT_EXEC_PREFIX := $(if $(or $(EXEC_PREFIX),$(exec_prefix)),1,) + +DESTDIR ?= +# directory variables : GNU conventions prefer lowercase +# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html +# support both lower and uppercase (BSD), use uppercase in script +prefix ?= /usr/local +PREFIX ?= $(prefix) +exec_prefix ?= $(PREFIX) +EXEC_PREFIX ?= $(exec_prefix) +libdir ?= $(EXEC_PREFIX)/lib +LIBDIR ?= $(libdir) +includedir ?= $(PREFIX)/include +INCLUDEDIR ?= $(includedir) + +PCINCDIR := $(patsubst $(PREFIX)%,%,$(INCLUDEDIR)) +PCLIBDIR := $(patsubst $(EXEC_PREFIX)%,%,$(LIBDIR)) + +# If we successfully stripped off a prefix, we'll add a reference to the +# relevant pc variable. +PCINCPREFIX := $(if $(findstring $(INCLUDEDIR),$(PCINCDIR)),,$${prefix}) +PCLIBPREFIX := $(if $(findstring $(LIBDIR),$(PCLIBDIR)),,$${exec_prefix}) + +# If no explicit EXEC_PREFIX was set by the caller, write it out as a reference +# to PREFIX, rather than as a resolved value. +PCEXEC_PREFIX := $(if $(HAS_EXPLICIT_EXEC_PREFIX),$(EXEC_PREFIX),$${prefix}) + +ifneq (,$(filter $(UNAME),FreeBSD NetBSD DragonFly)) + PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig +else + PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig +endif + +ifneq (,$(filter $(UNAME),SunOS)) + INSTALL ?= ginstall +else + INSTALL ?= install +endif + +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= $(INSTALL) -m 644 + + +libzstd.pc: libzstd.pc.in + @echo creating pkgconfig + @sed \ + -e 's|@PREFIX@|$(PREFIX)|' \ + -e 's|@EXEC_PREFIX@|$(PCEXEC_PREFIX)|' \ + -e 's|@INCLUDEDIR@|$(PCINCPREFIX)$(PCINCDIR)|' \ + -e 's|@LIBDIR@|$(PCLIBPREFIX)$(PCLIBDIR)|' \ + -e 's|@VERSION@|$(VERSION)|' \ + -e 's|@LIBS_PRIVATE@|$(LDFLAGS_DYNLIB)|' \ + $< >$@ + +.PHONY: install +install: install-pc install-static install-shared install-includes + @echo zstd static and shared library installed + +.PHONY: install-pc +install-pc: libzstd.pc + [ -e $(DESTDIR)$(PKGCONFIGDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ + $(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/ + +.PHONY: install-static +install-static: + # only generate libzstd.a if it's not already present + [ -e libzstd.a ] || $(MAKE) libzstd.a-release + [ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/ + @echo Installing static library + $(INSTALL_DATA) libzstd.a $(DESTDIR)$(LIBDIR) + +.PHONY: install-shared +install-shared: + # only generate libzstd.so if it's not already present + [ -e $(LIBZSTD) ] || $(MAKE) libzstd-release + [ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/ + @echo Installing shared library + $(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR) + ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) + ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT) + +.PHONY: install-includes +install-includes: + [ -e $(DESTDIR)$(INCLUDEDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/ + @echo Installing includes + $(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) zstd_errors.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) zdict.h $(DESTDIR)$(INCLUDEDIR) + +.PHONY: uninstall +uninstall: + $(RM) $(DESTDIR)$(LIBDIR)/libzstd.a + $(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT) + $(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) + $(RM) $(DESTDIR)$(LIBDIR)/$(LIBZSTD) + $(RM) $(DESTDIR)$(PKGCONFIGDIR)/libzstd.pc + $(RM) $(DESTDIR)$(INCLUDEDIR)/zstd.h + $(RM) $(DESTDIR)$(INCLUDEDIR)/zstd_errors.h + $(RM) $(DESTDIR)$(INCLUDEDIR)/zdict.h + @echo zstd libraries successfully uninstalled + +endif diff --git a/externals/zstd/lib/dll/example/Makefile b/externals/zstd/lib/dll/example/Makefile new file mode 100644 index 00000000..86cf6906 --- /dev/null +++ b/externals/zstd/lib/dll/example/Makefile @@ -0,0 +1,48 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +VOID := /dev/null +ZSTDDIR := ../include +LIBDIR := ../static +DLLDIR := ../dll + +CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make +CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \ + -Wdeclaration-after-statement -Wstrict-prototypes \ + -Wpointer-arith -Wstrict-aliasing=1 +CFLAGS += $(MOREFLAGS) +CPPFLAGS:= -I$(ZSTDDIR) -DXXH_NAMESPACE=ZSTD_ +FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + +.PHONY: default fullbench-dll fullbench-lib + + +default: all + +all: fullbench-dll fullbench-lib + + +fullbench-lib: fullbench.c datagen.c + $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/libzstd_static.lib + +fullbench-dll: fullbench.c datagen.c + $(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(DLLDIR)/libzstd.dll + +clean: + @$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \ + @echo Cleaning completed diff --git a/externals/zstd/programs/Makefile b/externals/zstd/programs/Makefile new file mode 100644 index 00000000..8507abef --- /dev/null +++ b/externals/zstd/programs/Makefile @@ -0,0 +1,446 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ########################################################################## +# zstd : Command Line Utility, supporting gzip-like arguments +# zstd32 : Same as zstd, but forced to compile in 32-bits mode +# zstd-nolegacy : zstd without support of decompression of legacy versions +# zstd-small : minimal zstd without dictionary builder and benchmark +# zstd-compress : compressor-only version of zstd +# zstd-decompress : decompressor-only version of zstd +# ########################################################################## + +.PHONY: default +default: zstd-release + +LIBZSTD := ../lib + +include $(LIBZSTD)/libzstd.mk + +ifeq ($(shell $(CC) -v 2>&1 | $(GREP) -c "gcc version "), 1) + ALIGN_LOOP = -falign-loops=32 +else + ALIGN_LOOP = +endif + +ZSTDLIB_COMMON_SRC := $(sort $(ZSTD_COMMON_FILES)) +ZSTDLIB_COMPRESS_SRC := $(sort $(ZSTD_COMPRESS_FILES)) +ZSTDLIB_DECOMPRESS_SRC := $(sort $(ZSTD_DECOMPRESS_FILES)) +ZSTDLIB_CORE_SRC := $(sort $(ZSTD_DECOMPRESS_FILES) $(ZSTD_COMMON_FILES) $(ZSTD_COMPRESS_FILES)) +ZDICT_SRC := $(sort $(ZSTD_DICTBUILDER_FILES)) +ZSTDLEGACY_SRC := $(sort $(ZSTD_LEGACY_FILES)) + +# Sort files in alphabetical order for reproducible builds +ZSTDLIB_FULL_SRC = $(sort $(ZSTDLIB_CORE_SRC) $(ZSTDLEGACY_SRC) $(ZDICT_SRC)) +ZSTDLIB_LOCAL_SRC = $(notdir $(ZSTDLIB_FULL_SRC)) +ZSTDLIB_LOCAL_OBJ0 := $(ZSTDLIB_LOCAL_SRC:.c=.o) +ZSTDLIB_LOCAL_OBJ := $(ZSTDLIB_LOCAL_OBJ0:.S=.o) + +ZSTD_CLI_SRC := $(sort $(wildcard *.c)) +ZSTD_CLI_OBJ := $(ZSTD_CLI_SRC:.c=.o) + +ZSTD_ALL_SRC = $(ZSTDLIB_LOCAL_SRC) $(ZSTD_CLI_SRC) +ZSTD_ALL_OBJ0 := $(ZSTD_ALL_SRC:.c=.o) +ZSTD_ALL_OBJ := $(ZSTD_ALL_OBJ0:.S=.o) + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) + EXT =.exe + RES64_FILE = windres/zstd64.res + RES32_FILE = windres/zstd32.res +ifneq (,$(filter x86_64%,$(shell $(CC) -dumpmachine))) + RES_FILE = $(RES64_FILE) +else + RES_FILE = $(RES32_FILE) +endif +else + EXT = +endif + +# thread detection +NO_THREAD_MSG := ==> no threads, building without multithreading support +HAVE_PTHREAD := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c) +HAVE_THREAD := $(shell [ "$(HAVE_PTHREAD)" -eq "1" -o -n "$(filter Windows%,$(OS))" ] && echo 1 || echo 0) +ifeq ($(HAVE_THREAD), 1) + THREAD_MSG := ==> building with threading support + THREAD_CPP := -DZSTD_MULTITHREAD + THREAD_LD := -pthread +else + THREAD_MSG := $(NO_THREAD_MSG) +endif + +# zlib detection +NO_ZLIB_MSG := ==> no zlib, building zstd without .gz support +HAVE_ZLIB ?= $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c) +ifeq ($(HAVE_ZLIB), 1) + ZLIB_MSG := ==> building zstd with .gz compression support + ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS + ZLIBLD = -lz +else + ZLIB_MSG := $(NO_ZLIB_MSG) +endif + +# lzma detection +NO_LZMA_MSG := ==> no liblzma, building zstd without .xz/.lzma support +HAVE_LZMA ?= $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c) +ifeq ($(HAVE_LZMA), 1) + LZMA_MSG := ==> building zstd with .xz/.lzma compression support + LZMACPP = -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS + LZMALD = -llzma +else + LZMA_MSG := $(NO_LZMA_MSG) +endif + +# lz4 detection +NO_LZ4_MSG := ==> no liblz4, building zstd without .lz4 support +HAVE_LZ4 ?= $(shell printf '$(NUM_SYMBOL)include \n$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c) +ifeq ($(HAVE_LZ4), 1) + LZ4_MSG := ==> building zstd with .lz4 compression support + LZ4CPP = -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS + LZ4LD = -llz4 +else + LZ4_MSG := $(NO_LZ4_MSG) +endif + +# explicit backtrace enable/disable for Linux & Darwin +ifeq ($(BACKTRACE), 0) + DEBUGFLAGS += -DBACKTRACE_ENABLE=0 +endif +ifeq (,$(filter Windows%, $(OS))) +ifeq ($(BACKTRACE), 1) + DEBUGFLAGS += -DBACKTRACE_ENABLE=1 + DEBUGFLAGS_LD += -rdynamic +endif +endif + +SET_CACHE_DIRECTORY = \ + +$(MAKE) --no-print-directory $@ \ + BUILD_DIR=obj/$(HASH_DIR) \ + CPPFLAGS="$(CPPFLAGS)" \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" \ + LDLIBS="$(LDLIBS)" \ + ZSTD_ALL_SRC="$(ZSTD_ALL_SRC)" + + +.PHONY: all +all: zstd zstd-compress zstd-decompress zstd-small + +.PHONY: allVariants +allVariants: all zstd-frugal zstd-nolegacy zstd-dictBuilder + +.PHONY: zstd # must always be run +zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP) +zstd : LDFLAGS += $(THREAD_LD) $(DEBUGFLAGS_LD) +zstd : LDLIBS += $(ZLIBLD) $(LZMALD) $(LZ4LD) +zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) +ifneq (,$(filter Windows%,$(OS))) +zstd : $(RES_FILE) +endif + +ifndef BUILD_DIR +# generate BUILD_DIR from flags + +zstd: + $(SET_CACHE_DIRECTORY) + +else +# BUILD_DIR is defined + +ZSTD_OBJ := $(addprefix $(BUILD_DIR)/, $(ZSTD_ALL_OBJ)) +$(BUILD_DIR)/zstd : $(ZSTD_OBJ) + @echo "$(THREAD_MSG)" + @echo "$(ZLIB_MSG)" + @echo "$(LZMA_MSG)" + @echo "$(LZ4_MSG)" + @echo LINK $@ + $(CC) $(FLAGS) $^ $(LDLIBS) -o $@$(EXT) + +ifeq ($(HAVE_HASH),1) +SRCBIN_HASH = $(shell cat $(BUILD_DIR)/zstd$(EXT) 2> $(VOID) | $(HASH) | cut -f 1 -d " ") +DSTBIN_HASH = $(shell cat zstd$(EXT) 2> $(VOID) | $(HASH) | cut -f 1 -d " ") +BIN_ISDIFFERENT = $(if $(filter $(SRCBIN_HASH),$(DSTBIN_HASH)),0,1) +else +BIN_ISDIFFERENT = 1 +endif + +zstd : $(BUILD_DIR)/zstd + if [ $(BIN_ISDIFFERENT) -eq 1 ]; then \ + cp -f $<$(EXT) $@$(EXT); \ + echo zstd build completed; \ + else \ + echo zstd already built; \ + fi + +endif # BUILD_DIR + + +CLEAN += zstd +.PHONY: zstd-release +zstd-release: DEBUGFLAGS := -DBACKTRACE_ENABLE=0 +zstd-release: DEBUGFLAGS_LD := +zstd-release: zstd + +CLEAN += zstd32 +zstd32 : CPPFLAGS += $(THREAD_CPP) +zstd32 : LDFLAGS += $(THREAD_LD) +zstd32 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) +ifneq (,$(filter Windows%,$(OS))) +zstd32 : $(RES32_FILE) +endif +zstd32 : $(ZSTDLIB_FULL_SRC) $(ZSTD_CLI_SRC) + $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + +## zstd-nolegacy: same scope as zstd, with removed support of legacy formats +CLEAN += zstd-nolegacy +zstd-nolegacy : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) $(DEBUGFLAGS_LD) +zstd-nolegacy : CPPFLAGS += -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 +zstd-nolegacy : $(ZSTDLIB_CORE_SRC) $(ZDICT_SRC) $(ZSTD_CLI_OBJ) + $(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS) + +.PHONY: zstd-nomt +zstd-nomt : THREAD_CPP := +zstd-nomt : THREAD_LD := +zstd-nomt : THREAD_MSG := - multi-threading disabled +zstd-nomt : zstd + +.PHONY: zstd-nogz +zstd-nogz : ZLIBCPP := +zstd-nogz : ZLIBLD := +zstd-nogz : ZLIB_MSG := - gzip support is disabled +zstd-nogz : zstd + +.PHONY: zstd-noxz +zstd-noxz : LZMACPP := +zstd-noxz : LZMALD := +zstd-noxz : LZMA_MSG := - xz/lzma support is disabled +zstd-noxz : zstd + +## zstd-dll: zstd executable linked to dynamic library libzstd (must have same version) +.PHONY: zstd-dll +zstd-dll : LDFLAGS+= -L$(LIBZSTD) +zstd-dll : LDLIBS += -lzstd +zstd-dll : ZSTDLIB_LOCAL_SRC = xxhash.c pool.c threading.c +zstd-dll : zstd + + +## zstd-pgo: zstd executable optimized with PGO. +.PHONY: zstd-pgo +zstd-pgo : LLVM_PROFDATA?=llvm-profdata +zstd-pgo : PROF_GENERATE_FLAGS=-fprofile-generate $(if $(findstring gcc,$(CC)),-fprofile-dir=.) +zstd-pgo : PROF_USE_FLAGS=-fprofile-use $(if $(findstring gcc,$(CC)),-fprofile-dir=. -Werror=missing-profile -Wno-error=coverage-mismatch) +zstd-pgo : + $(MAKE) clean HASH_DIR=$(HASH_DIR) + $(MAKE) zstd HASH_DIR=$(HASH_DIR) MOREFLAGS="$(PROF_GENERATE_FLAGS)" + ./zstd -b19i1 $(PROFILE_WITH) + ./zstd -b16i1 $(PROFILE_WITH) + ./zstd -b9i2 $(PROFILE_WITH) + ./zstd -b $(PROFILE_WITH) + ./zstd -b7i2 $(PROFILE_WITH) + ./zstd -b5 $(PROFILE_WITH) +ifndef BUILD_DIR + $(RM) zstd obj/$(HASH_DIR)/zstd obj/$(HASH_DIR)/*.o +else + $(RM) zstd $(BUILD_DIR)/zstd $(BUILD_DIR)/*.o +endif + case $(CC) in *clang*) if ! [ -e default.profdata ]; then $(LLVM_PROFDATA) merge -output=default.profdata default*.profraw; fi ;; esac + $(MAKE) zstd HASH_DIR=$(HASH_DIR) MOREFLAGS="$(PROF_USE_FLAGS)" + +## zstd-small: minimal target, supporting only zstd compression and decompression. no bench. no legacy. no other format. +CLEAN += zstd-small zstd-frugal +zstd-small: CFLAGS = -Os -Wl,-s +zstd-frugal zstd-small: $(ZSTDLIB_CORE_SRC) zstdcli.c util.c timefn.c fileio.c fileio_asyncio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOTRACE -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) + +CLEAN += zstd-decompress +zstd-decompress: $(ZSTDLIB_COMMON_SRC) $(ZSTDLIB_DECOMPRESS_SRC) zstdcli.c util.c timefn.c fileio.c fileio_asyncio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS -DZSTD_NOTRACE -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) + +CLEAN += zstd-compress +zstd-compress: $(ZSTDLIB_COMMON_SRC) $(ZSTDLIB_COMPRESS_SRC) zstdcli.c util.c timefn.c fileio.c fileio_asyncio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS -DZSTD_NOTRACE -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) + +## zstd-dictBuilder: executable supporting dictionary creation and compression (only) +CLEAN += zstd-dictBuilder +zstd-dictBuilder: $(ZSTDLIB_COMMON_SRC) $(ZSTDLIB_COMPRESS_SRC) $(ZDICT_SRC) zstdcli.c util.c timefn.c fileio.c fileio_asyncio.c dibio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODECOMPRESS -DZSTD_NOTRACE $^ -o $@$(EXT) + +CLEAN += zstdmt +zstdmt: zstd + ln -sf zstd zstdmt + +.PHONY: generate_res +generate_res: $(RES64_FILE) $(RES32_FILE) + +ifneq (,$(filter Windows%,$(OS))) +RC ?= windres +# https://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable +$(RES64_FILE): windres/zstd.rc + $(RC) -o $@ -I ../lib -I windres -i $< -O coff -F pe-x86-64 +$(RES32_FILE): windres/zstd.rc + $(RC) -o $@ -I ../lib -I windres -i $< -O coff -F pe-i386 +endif + +.PHONY: clean +clean: + $(RM) $(CLEAN) core *.o tmp* result* dictionary *.zst \ + *.gcda default*.profraw default.profdata have_zlib + $(RM) -r obj/* + @echo Cleaning completed + +MD2ROFF = ronn +MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="zstd $(ZSTD_VERSION)" + +zstd.1: zstd.1.md ../lib/zstd.h + cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@ + +zstdgrep.1: zstdgrep.1.md ../lib/zstd.h + cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@ + +zstdless.1: zstdless.1.md ../lib/zstd.h + cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@ + +.PHONY: man +man: zstd.1 zstdgrep.1 zstdless.1 + +.PHONY: clean-man +clean-man: + $(RM) zstd.1 + $(RM) zstdgrep.1 + $(RM) zstdless.1 + +.PHONY: preview-man +preview-man: clean-man man + man ./zstd.1 + man ./zstdgrep.1 + man ./zstdless.1 + + +# Generate .h dependencies automatically + +DEPFLAGS = -MT $@ -MMD -MP -MF + +$(BUILD_DIR)/%.o : %.c $(BUILD_DIR)/%.d | $(BUILD_DIR) + @echo CC $@ + $(COMPILE.c) $(DEPFLAGS) $(BUILD_DIR)/$*.d $(OUTPUT_OPTION) $< + +$(BUILD_DIR)/%.o : %.S | $(BUILD_DIR) + @echo AS $@ + $(COMPILE.S) $(OUTPUT_OPTION) $< + +MKDIR ?= mkdir +$(BUILD_DIR): ; $(MKDIR) -p $@ + +DEPFILES := $(ZSTD_OBJ:.o=.d) +$(DEPFILES): + +include $(wildcard $(DEPFILES)) + + + +#----------------------------------------------------------------------------- +# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets +#----------------------------------------------------------------------------- +ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX)) + +HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0) +EGREP_OPTIONS ?= +ifeq ($(HAVE_COLORNEVER), 1) + EGREP_OPTIONS += --color=never +endif +EGREP = egrep $(EGREP_OPTIONS) +AWK = awk + +# Print a two column output of targets and their description. To add a target description, put a +# comment in the Makefile with the format "## : ". For example: +# +## list: Print all targets and their descriptions (if provided) +.PHONY: list +list: + TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \ + | $(AWK) -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \ + | $(EGREP) -v -e '^[^[:alnum:]]' | sort); \ + { \ + printf "Target Name\tDescription\n"; \ + printf "%0.s-" {1..16}; printf "\t"; printf "%0.s-" {1..40}; printf "\n"; \ + for target in $$TARGETS; do \ + line=$$($(EGREP) "^##[[:space:]]+$$target:" $(lastword $(MAKEFILE_LIST))); \ + description=$$(echo $$line | $(AWK) '{i=index($$0,":"); print substr($$0,i+1)}' | xargs); \ + printf "$$target\t$$description\n"; \ + done \ + } | column -t -s $$'\t' + + +DESTDIR ?= +# directory variables : GNU conventions prefer lowercase +# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html +# support both lower and uppercase (BSD), use uppercase in script +prefix ?= /usr/local +PREFIX ?= $(prefix) +exec_prefix ?= $(PREFIX) +bindir ?= $(exec_prefix)/bin +BINDIR ?= $(bindir) +datarootdir ?= $(PREFIX)/share +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 + +ifneq (,$(filter $(UNAME),OpenBSD FreeBSD NetBSD DragonFly SunOS)) + MANDIR ?= $(PREFIX)/man + MAN1DIR ?= $(MANDIR)/man1 +else + MAN1DIR ?= $(man1dir) +endif + +ifneq (,$(filter $(UNAME),SunOS)) + INSTALL ?= ginstall +else + INSTALL ?= install +endif + +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_SCRIPT ?= $(INSTALL_PROGRAM) +INSTALL_DATA ?= $(INSTALL) -m 644 +INSTALL_MAN ?= $(INSTALL_DATA) + +.PHONY: install +install: + # generate zstd only if not already present + [ -e zstd ] || $(MAKE) zstd-release + [ -e $(DESTDIR)$(BINDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ + [ -e $(DESTDIR)$(MAN1DIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(MAN1DIR)/ + @echo Installing binaries + $(INSTALL_PROGRAM) zstd$(EXT) $(DESTDIR)$(BINDIR)/zstd$(EXT) + ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdcat$(EXT) + ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/unzstd$(EXT) + ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdmt$(EXT) + $(INSTALL_SCRIPT) zstdless $(DESTDIR)$(BINDIR)/zstdless + $(INSTALL_SCRIPT) zstdgrep $(DESTDIR)$(BINDIR)/zstdgrep + @echo Installing man pages + $(INSTALL_MAN) zstd.1 $(DESTDIR)$(MAN1DIR)/zstd.1 + ln -sf zstd.1 $(DESTDIR)$(MAN1DIR)/zstdcat.1 + ln -sf zstd.1 $(DESTDIR)$(MAN1DIR)/unzstd.1 + $(INSTALL_MAN) zstdgrep.1 $(DESTDIR)$(MAN1DIR)/zstdgrep.1 + $(INSTALL_MAN) zstdless.1 $(DESTDIR)$(MAN1DIR)/zstdless.1 + @echo zstd installation completed + +.PHONY: uninstall +uninstall: + $(RM) $(DESTDIR)$(BINDIR)/zstdgrep + $(RM) $(DESTDIR)$(BINDIR)/zstdless + $(RM) $(DESTDIR)$(BINDIR)/zstdcat + $(RM) $(DESTDIR)$(BINDIR)/unzstd + $(RM) $(DESTDIR)$(BINDIR)/zstdmt + $(RM) $(DESTDIR)$(BINDIR)/zstd + $(RM) $(DESTDIR)$(MAN1DIR)/zstdless.1 + $(RM) $(DESTDIR)$(MAN1DIR)/zstdgrep.1 + $(RM) $(DESTDIR)$(MAN1DIR)/zstdcat.1 + $(RM) $(DESTDIR)$(MAN1DIR)/unzstd.1 + $(RM) $(DESTDIR)$(MAN1DIR)/zstd.1 + @echo zstd programs successfully uninstalled + +endif diff --git a/externals/zstd/programs/zstdgrep b/externals/zstd/programs/zstdgrep old mode 100644 new mode 100755 diff --git a/externals/zstd/programs/zstdless b/externals/zstd/programs/zstdless old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/DEPRECATED-test-zstd-speed.py b/externals/zstd/tests/DEPRECATED-test-zstd-speed.py old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/Makefile b/externals/zstd/tests/Makefile new file mode 100644 index 00000000..778c7d67 --- /dev/null +++ b/externals/zstd/tests/Makefile @@ -0,0 +1,468 @@ + +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ +# datagen : Synthetic and parametrable data generator, for tests +# fullbench : Precisely measure speed for each zstd inner functions +# fullbench32: Same as fullbench, but forced to compile in 32-bits mode +# fuzzer : Test tool, to check zstd integrity on target platform +# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode +# paramgrill : parameter tester for zstd +# test-zstd-speed.py : script for testing zstd speed difference between commits +# versionsTest : compatibility test between zstd versions stored on Github (v0.1+) +# zstreamtest : Fuzzer test tool for zstd streaming API +# zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode +# ########################################################################## + +LIBZSTD = ../lib + +ZSTD_LEGACY_SUPPORT ?= 0 + +DEBUGLEVEL ?= 2 +export DEBUGLEVEL # transmit value to sub-makefiles + +include $(LIBZSTD)/libzstd.mk + +ZSTDDIR = $(LIBZSTD) +PRGDIR = ../programs +PYTHON ?= python3 +TESTARTEFACT := versionsTest + +DEBUGFLAGS += -g -Wno-c++-compat +CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ + -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) \ + -DZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY=1 + +ZSTDCOMMON_FILES := $(sort $(ZSTD_COMMON_FILES)) +ZSTDCOMP_FILES := $(sort $(ZSTD_COMPRESS_FILES)) +ZSTDDECOMP_FILES := $(sort $(ZSTD_DECOMPRESS_FILES)) +ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) +ZDICT_FILES := $(sort $(ZSTD_DICTBUILDER_FILES)) + +ZSTD_F1 := $(sort $(wildcard $(ZSTD_FILES))) +ZSTD_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdm_,$(ZSTD_F1)) +ZSTD_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdc_,$(ZSTD_OBJ1)) +ZSTD_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdd_,$(ZSTD_OBJ2)) +ZSTD_OBJ4 := $(ZSTD_OBJ3:.c=.o) +ZSTD_OBJECTS := $(ZSTD_OBJ4:.S=.o) + +ZSTDMT_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdmt_m_,$(ZSTD_F1)) +ZSTDMT_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdmt_c_,$(ZSTDMT_OBJ1)) +ZSTDMT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2)) +ZSTDMT_OBJ4 := $(ZSTDMT_OBJ3:.c=.o) +ZSTDMT_OBJECTS := $(ZSTDMT_OBJ4:.S=.o) + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +MULTITHREAD_CPP = -DZSTD_MULTITHREAD +MULTITHREAD_LD = +else +EXT = +MULTITHREAD_CPP = -DZSTD_MULTITHREAD +MULTITHREAD_LD = -pthread +endif +MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD) + +VOID = /dev/null +ZSTREAM_TESTTIME ?= -T90s +FUZZERTEST ?= -T200s +ZSTDRTTEST = --test-large-data +DECODECORPUS_TESTTIME ?= -T30 + +.PHONY: default +default: fullbench + +.PHONY: all +all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus roundTripCrash poolTests + +.PHONY: all32 +all32: fullbench32 fuzzer32 zstreamtest32 + +.PHONY: allnothread +allnothread: MULTITHREAD_CPP= +allnothread: MULTITHREAD_LD= +allnothread: fullbench fuzzer paramgrill datagen decodecorpus + +# note : broken : requires symbols unavailable from dynamic library +.PHONY: dll +dll: fuzzer-dll zstreamtest-dll + +.PHONY: zstd zstd32 zstd-nolegacy # only external makefile knows how to build or update them +zstd zstd32 zstd-nolegacy zstd-dll: + $(MAKE) -C $(PRGDIR) $@ MOREFLAGS+="$(DEBUGFLAGS)" + +.PHONY: libzstd +libzstd : + $(MAKE) -C $(ZSTDDIR) libzstd MOREFLAGS+="$(DEBUGFLAGS)" + +%-dll : libzstd +%-dll : LDFLAGS += -L$(ZSTDDIR) -lzstd + +$(ZSTDDIR)/libzstd.a : + $(MAKE) -C $(ZSTDDIR) libzstd.a + +zstdm_%.o : $(ZSTDDIR)/common/%.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +zstdc_%.o : $(ZSTDDIR)/compress/%.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +zstdd_%.o : $(ZSTDDIR)/decompress/%.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +zstdd_%.o : $(ZSTDDIR)/decompress/%.S + $(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ + +zstdmt%.o : CPPFLAGS += $(MULTITHREAD_CPP) + +zstdmt_m_%.o : $(ZSTDDIR)/common/%.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +zstdmt_c_%.o : $(ZSTDDIR)/compress/%.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +zstdmt_d_%.o : $(ZSTDDIR)/decompress/%.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + +zstdmt_d_%.o : $(ZSTDDIR)/decompress/%.S + $(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ + +FULLBENCHS := fullbench fullbench32 +CLEAN += $(FULLBENCHS) +fullbench32: CPPFLAGS += -m32 +$(FULLBENCHS) : CPPFLAGS += $(MULTITHREAD_CPP) -Wno-deprecated-declarations +$(FULLBENCHS) : LDFLAGS += $(MULTITHREAD_LD) +$(FULLBENCHS) : DEBUGFLAGS = -DNDEBUG # turn off assert() for speed measurements +$(FULLBENCHS) : $(ZSTD_FILES) +$(FULLBENCHS) : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c + $(LINK.c) $^ -o $@$(EXT) + +CLEAN += fullbench-lib +fullbench-lib : CPPFLAGS += -DXXH_NAMESPACE=ZSTD_ +fullbench-lib : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(ZSTDDIR)/libzstd.a fullbench.c + $(LINK.c) $^ -o $@$(EXT) + +# note : broken : requires symbols unavailable from dynamic library +fullbench-dll: $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/benchfn.c $(PRGDIR)/timefn.c fullbench.c +# $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll + $(LINK.c) $^ $(LDLIBS) -o $@$(EXT) + +CLEAN += fuzzer fuzzer32 +fuzzer : CPPFLAGS += $(MULTITHREAD_CPP) -Wno-deprecated-declarations +fuzzer : LDFLAGS += $(MULTITHREAD_LD) +fuzzer : $(ZSTDMT_OBJECTS) +fuzzer fuzzer32 : $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c + +fuzzer32 : CFLAGS += -m32 $(MULTITHREAD) +fuzzer32 : $(ZSTD_FILES) + $(LINK.c) $^ -o $@$(EXT) + +# note : broken : requires symbols unavailable from dynamic library +fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT) + +CLEAN += zstreamtest zstreamtest32 +ZSTREAM_LOCAL_FILES := $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c seqgen.c zstreamtest.c external_matchfinder.c +ZSTREAM_PROPER_FILES := $(ZDICT_FILES) $(ZSTREAM_LOCAL_FILES) +ZSTREAMFILES := $(ZSTD_FILES) $(ZSTREAM_PROPER_FILES) +zstreamtest32 : CFLAGS += -m32 +zstreamtest zstreamtest32 : CPPFLAGS += $(MULTITHREAD_CPP) +zstreamtest zstreamtest32 : LDFLAGS += $(MULTITHREAD_LD) +zstreamtest : $(ZSTDMT_OBJECTS) $(ZSTREAM_PROPER_FILES) +zstreamtest32 : $(ZSTREAMFILES) +zstreamtest zstreamtest32 : + $(LINK.c) $^ -o $@$(EXT) + +CLEAN += zstreamtest_asan +zstreamtest_asan : CFLAGS += -fsanitize=address +zstreamtest_asan : $(ZSTREAMFILES) + $(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT) + +CLEAN += zstreamtest_tsan +zstreamtest_tsan : CFLAGS += -fsanitize=thread +zstreamtest_tsan : $(ZSTREAMFILES) + $(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT) + +CLEAN += zstreamtest_ubsan +zstreamtest_ubsan : CFLAGS += -fsanitize=undefined +zstreamtest_ubsan : $(ZSTREAMFILES) + $(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT) + +# note : broken : requires symbols unavailable from dynamic library +zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c # xxh symbols not exposed from dll +zstreamtest-dll : $(ZSTREAM_LOCAL_FILES) + $(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT) + +CLEAN += paramgrill +paramgrill : DEBUGFLAGS = # turn off debug for speed measurements +paramgrill : LDLIBS += -lm +paramgrill : $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(PRGDIR)/benchzstd.c $(PRGDIR)/datagen.c paramgrill.c + +CLEAN += datagen +datagen : $(PRGDIR)/datagen.c datagencli.c + $(LINK.c) $^ -o $@$(EXT) + +CLEAN += roundTripCrash +roundTripCrash: CFLAGS += $(MULTITHREAD) +roundTripCrash : $(ZSTD_OBJECTS) roundTripCrash.c + +CLEAN += longmatch +longmatch : $(ZSTD_OBJECTS) longmatch.c + +CLEAN += bigdict +bigdict: CFLAGS += $(MULTITHREAD) +bigdict: $(ZSTDMT_OBJECTS) $(PRGDIR)/datagen.c bigdict.c + +CLEAN += invalidDictionaries +invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c + +CLEAN += legacy +legacy : CPPFLAGS += -I$(ZSTDDIR)/legacy -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=4 +legacy : $(ZSTD_FILES) $(sort $(wildcard $(ZSTDDIR)/legacy/*.c)) legacy.c + +CLEAN += decodecorpus +decodecorpus : LDLIBS += -lm +decodecorpus : $(filter-out zstdc_zstd_compress.o, $(ZSTD_OBJECTS)) $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c decodecorpus.c + +CLEAN += poolTests +poolTests : $(PRGDIR)/util.c $(PRGDIR)/timefn.c poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c + $(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT) + +.PHONY: versionsTest +versionsTest: clean + $(PYTHON) test-zstd-versions.py + +.PHONY: automated_benchmarking +automated_benchmarking: clean + $(PYTHON) automated_benchmarking.py + +# make checkTag : check that release tag corresponds to release version +CLEAN += checkTag +checkTag.o : $(ZSTDDIR)/zstd.h + +.PHONY: clean +clean: + $(MAKE) -C $(ZSTDDIR) clean + $(MAKE) -C $(PRGDIR) clean + $(RM) -fR $(TESTARTEFACT) + $(RM) -rf tmp* # some test directories are named tmp* + $(RM) $(CLEAN) core *.o *.tmp result* *.gcda dictionary *.zst \ + $(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \ + fullbench-dll$(EXT) fuzzer-dll$(EXT) zstreamtest-dll$(EXT) + @echo Cleaning completed + + +#---------------------------------------------------------------------------------- +# valgrind tests validated only for some posix platforms +#---------------------------------------------------------------------------------- +UNAME := $(shell uname) +ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS AIX)) +HOST_OS = POSIX + +.PHONY: test-valgrind +test-valgrind: VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 +test-valgrind: zstd datagen fuzzer fullbench + @echo "\n ---- valgrind tests : memory analyzer ----" + $(VALGRIND) ./datagen -g50M > $(VOID) + $(VALGRIND) $(PRGDIR)/zstd ; if [ $$? -eq 0 ] ; then echo "zstd without argument should have failed"; false; fi + ./datagen -g80 | $(VALGRIND) $(PRGDIR)/zstd - -c > $(VOID) + ./datagen -g16KB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID) + ./datagen -g2930KB | $(VALGRIND) $(PRGDIR)/zstd -5 -vf - -o tmp + $(VALGRIND) $(PRGDIR)/zstd -vdf tmp -c > $(VOID) + ./datagen -g64MB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID) + $(RM) tmp + $(VALGRIND) ./fuzzer -T1mn -t1 + $(VALGRIND) ./fullbench -i1 + +endif + +ifneq (,$(filter MINGW% MSYS%,$(UNAME))) + HOST_OS = MSYS +endif + + +#----------------------------------------------------------------------------- +# make tests validated only for below targets +#----------------------------------------------------------------------------- +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) + +DIFF:=diff +ifneq (,$(filter $(UNAME),SunOS)) + DIFF:=gdiff +endif + +.PHONY: list +list: + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + +.PHONY: shortest +shortest: ZSTDRTTEST= # remove long tests +shortest: test-zstd + +.PHONY: check +check: shortest + +.PHONY: fuzztest +fuzztest: test-fuzzer test-zstream test-decodecorpus + +.PHONY: test +test: test-zstd test-fullbench test-fuzzer test-zstream test-invalidDictionaries test-legacy test-decodecorpus test-cli-tests +ifeq ($(QEMU_SYS),) +test: test-pool +endif + +.PHONY: test32 +test32: test-zstd32 test-fullbench32 test-fuzzer32 test-zstream32 + +.PHONY: test-all +test-all: test test32 test-decodecorpus-cli + +.PHONY: test-zstd test-zstd32 test-zstd-nolegacy +test-zstd: ZSTD = $(PRGDIR)/zstd +test-zstd: zstd + +.PHONY: test-zstd-dll +test-zstd-dll: ZSTD = $(PRGDIR)/zstd +test-zstd-dll: zstd-dll + +test-zstd32: ZSTD = $(PRGDIR)/zstd32 +test-zstd32: zstd32 + +test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy +test-zstd-nolegacy: zstd-nolegacy + +test-zstd test-zstd32 test-zstd-nolegacy test-zstd-dll: datagen + file $(ZSTD) + EXE_PREFIX="$(QEMU_SYS)" ZSTD_BIN="$(ZSTD)" DATAGEN_BIN=./datagen ./playTests.sh $(ZSTDRTTEST) + +.PHONY: test-cli-tests +test-cli-tests: ZSTD = $(PRGDIR)/zstd +test-cli-tests: zstd datagen + file $(ZSTD) + ./cli-tests/run.py --exec-prefix="$(QEMU_SYS)" --zstd="$(ZSTD)" --datagen=./datagen + +.PHONY: test-fullbench +test-fullbench: fullbench datagen + $(QEMU_SYS) ./fullbench -i1 + $(QEMU_SYS) ./fullbench -i1 -P0 + +.PHONY: test-fullbench32 +test-fullbench32: fullbench32 datagen + $(QEMU_SYS) ./fullbench32 -i1 + $(QEMU_SYS) ./fullbench32 -i1 -P0 + +.PHONY: test-fuzzer +test-fuzzer: fuzzer + $(QEMU_SYS) ./fuzzer -v $(FUZZERTEST) $(FUZZER_FLAGS) + +# Note : this test presumes `fuzzer` will be built +.PHONY: test-fuzzer-stackmode +test-fuzzer-stackmode: MOREFLAGS += -DZSTD_HEAPMODE=0 +test-fuzzer-stackmode: test-fuzzer + +.PHONY: test-fuzzer32 +test-fuzzer32: fuzzer32 + $(QEMU_SYS) ./fuzzer32 -v $(FUZZERTEST) $(FUZZER_FLAGS) + +.PHONY: test-zstream +test-zstream: zstreamtest + $(QEMU_SYS) ./zstreamtest -v $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS) + $(QEMU_SYS) ./zstreamtest --newapi -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS) + +test-zstream32: zstreamtest32 + $(QEMU_SYS) ./zstreamtest32 -v $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS) + +test-longmatch: longmatch + $(QEMU_SYS) ./longmatch + +test-bigdict: bigdict + $(QEMU_SYS) ./bigdict + +test-invalidDictionaries: invalidDictionaries + $(QEMU_SYS) ./invalidDictionaries + +test-legacy: legacy + $(QEMU_SYS) ./legacy + +test-decodecorpus: decodecorpus + $(QEMU_SYS) ./decodecorpus -t $(DECODECORPUS_TESTTIME) + +test-decodecorpus-cli: decodecorpus + @echo "\n ---- decodecorpus basic cli tests ----" + @mkdir testdir + ./decodecorpus -n5 -otestdir -ptestdir + @cd testdir && \ + $(ZSTD) -d z000000.zst -o tmp0 && \ + $(ZSTD) -d z000001.zst -o tmp1 && \ + $(ZSTD) -d z000002.zst -o tmp2 && \ + $(ZSTD) -d z000003.zst -o tmp3 && \ + $(ZSTD) -d z000004.zst -o tmp4 && \ + diff z000000 tmp0 && \ + diff z000001 tmp1 && \ + diff z000002 tmp2 && \ + diff z000003 tmp3 && \ + diff z000004 tmp4 && \ + rm ./* && \ + cd .. + @echo "\n ---- decodecorpus dictionary cli tests ----" + ./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB + @cd testdir && \ + $(ZSTD) -d z000000.zst -D dictionary -o tmp0 && \ + $(ZSTD) -d z000001.zst -D dictionary -o tmp1 && \ + $(ZSTD) -d z000002.zst -D dictionary -o tmp2 && \ + $(ZSTD) -d z000003.zst -D dictionary -o tmp3 && \ + $(ZSTD) -d z000004.zst -D dictionary -o tmp4 && \ + diff z000000 tmp0 && \ + diff z000001 tmp1 && \ + diff z000002 tmp2 && \ + diff z000003 tmp3 && \ + diff z000004 tmp4 && \ + cd .. + @rm -rf testdir + +test-pool: poolTests + $(QEMU_SYS) ./poolTests + +test-lz4: ZSTD = LD_LIBRARY_PATH=/usr/local/lib $(PRGDIR)/zstd +test-lz4: ZSTD_LZ4 = LD_LIBRARY_PATH=/usr/local/lib ./lz4 +test-lz4: ZSTD_UNLZ4 = LD_LIBRARY_PATH=/usr/local/lib ./unlz4 +test-lz4: zstd decodecorpus datagen + [ -f lz4 ] || ln -s $(PRGDIR)/zstd lz4 + [ -f unlz4 ] || ln -s $(PRGDIR)/zstd unlz4 + + ./decodecorpus -ptmp + # lz4 -> zstd + lz4 < tmp | \ + $(ZSTD) -d | \ + cmp - tmp + lz4 < tmp | \ + $(ZSTD_UNLZ4) | \ + cmp - tmp + # zstd -> lz4 + $(ZSTD) --format=lz4 < tmp | \ + lz4 -d | \ + cmp - tmp + $(ZSTD_LZ4) < tmp | \ + lz4 -d | \ + cmp - tmp + # zstd -> zstd + $(ZSTD) --format=lz4 < tmp | \ + $(ZSTD) -d | \ + cmp - tmp + # zstd -> zstd + $(ZSTD) < tmp | \ + $(ZSTD) -d | \ + cmp - tmp + + ./datagen -g384KB | $(ZSTD) --format=lz4 | $(ZSTD) -d > /dev/null + + rm tmp lz4 unlz4 + +endif diff --git a/externals/zstd/tests/check_size.py b/externals/zstd/tests/check_size.py old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/basic/help.sh b/externals/zstd/tests/cli-tests/basic/help.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/basic/memlimit.sh b/externals/zstd/tests/cli-tests/basic/memlimit.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/basic/output_dir.sh b/externals/zstd/tests/cli-tests/basic/output_dir.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/basic/version.sh b/externals/zstd/tests/cli-tests/basic/version.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/cmp_size b/externals/zstd/tests/cli-tests/bin/cmp_size old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/datagen b/externals/zstd/tests/cli-tests/bin/datagen old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/die b/externals/zstd/tests/cli-tests/bin/die old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/println b/externals/zstd/tests/cli-tests/bin/println old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/zstd b/externals/zstd/tests/cli-tests/bin/zstd old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/zstdgrep b/externals/zstd/tests/cli-tests/bin/zstdgrep old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/bin/zstdless b/externals/zstd/tests/cli-tests/bin/zstdless old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/cltools/setup b/externals/zstd/tests/cli-tests/cltools/setup old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/cltools/zstdgrep.sh b/externals/zstd/tests/cli-tests/cltools/zstdgrep.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/cltools/zstdless.sh b/externals/zstd/tests/cli-tests/cltools/zstdless.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/adapt.sh b/externals/zstd/tests/cli-tests/compression/adapt.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/basic.sh b/externals/zstd/tests/cli-tests/compression/basic.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/compress-literals.sh b/externals/zstd/tests/cli-tests/compression/compress-literals.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/format.sh b/externals/zstd/tests/cli-tests/compression/format.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/golden.sh b/externals/zstd/tests/cli-tests/compression/golden.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/gzip-compat.sh b/externals/zstd/tests/cli-tests/compression/gzip-compat.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/levels.sh b/externals/zstd/tests/cli-tests/compression/levels.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/long-distance-matcher.sh b/externals/zstd/tests/cli-tests/compression/long-distance-matcher.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/multi-threaded.sh b/externals/zstd/tests/cli-tests/compression/multi-threaded.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/multiple-files.sh b/externals/zstd/tests/cli-tests/compression/multiple-files.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/row-match-finder.sh b/externals/zstd/tests/cli-tests/compression/row-match-finder.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/setup b/externals/zstd/tests/cli-tests/compression/setup old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/stream-size.sh b/externals/zstd/tests/cli-tests/compression/stream-size.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/verbose-wlog.sh b/externals/zstd/tests/cli-tests/compression/verbose-wlog.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/compression/window-resize.sh b/externals/zstd/tests/cli-tests/compression/window-resize.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/decompression/golden.sh b/externals/zstd/tests/cli-tests/decompression/golden.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/decompression/pass-through.sh b/externals/zstd/tests/cli-tests/decompression/pass-through.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/dict-builder/empty-input.sh b/externals/zstd/tests/cli-tests/dict-builder/empty-input.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/dict-builder/no-inputs.sh b/externals/zstd/tests/cli-tests/dict-builder/no-inputs.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh b/externals/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/dictionaries/golden.sh b/externals/zstd/tests/cli-tests/dictionaries/golden.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/dictionaries/setup b/externals/zstd/tests/cli-tests/dictionaries/setup old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/dictionaries/setup_once b/externals/zstd/tests/cli-tests/dictionaries/setup_once old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh b/externals/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh b/externals/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh b/externals/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh b/externals/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh b/externals/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh b/externals/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh b/externals/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh b/externals/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh b/externals/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/progress/no-progress.sh b/externals/zstd/tests/cli-tests/progress/no-progress.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/progress/progress.sh b/externals/zstd/tests/cli-tests/progress/progress.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/run.py b/externals/zstd/tests/cli-tests/run.py old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/zstd-symlinks/setup b/externals/zstd/tests/cli-tests/zstd-symlinks/setup old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh b/externals/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/fuzz/Makefile b/externals/zstd/tests/fuzz/Makefile new file mode 100644 index 00000000..525e396b --- /dev/null +++ b/externals/zstd/tests/fuzz/Makefile @@ -0,0 +1,270 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +# Optionally user defined flags +CFLAGS ?= -O3 +CXXFLAGS ?= -O3 +CPPFLAGS ?= +ASFLAGS ?= +LDFLAGS ?= +ARFLAGS ?= +LIB_FUZZING_ENGINE ?= libregression.a +PYTHON ?= python +ifeq ($(shell uname), Darwin) + DOWNLOAD?=curl -L -o +else + DOWNLOAD?=wget -O +endif +CORPORA_URL_PREFIX:=https://github.com/facebook/zstd/releases/download/fuzz-corpora/ + +LIBZSTD = ../../lib +DEBUGLEVEL ?= 2 +ZSTD_LEGACY_SUPPORT ?= 1 + +include $(LIBZSTD)/libzstd.mk + +ZSTDDIR = ../../lib +PRGDIR = ../../programs +CONTRIBDIR = ../../contrib + +DEFAULT_SEQ_PROD_DIR = $(CONTRIBDIR)/externalSequenceProducer +DEFAULT_SEQ_PROD_SRC = $(DEFAULT_SEQ_PROD_DIR)/sequence_producer.c +THIRD_PARTY_SEQ_PROD_OBJ ?= + +FUZZ_CPPFLAGS := -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ + -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(ZSTDDIR)/legacy \ + -I$(CONTRIBDIR)/seekable_format -I$(PRGDIR) -I$(DEFAULT_SEQ_PROD_DIR) \ + -DZSTD_MULTITHREAD -DZSTD_LEGACY_SUPPORT=1 $(CPPFLAGS) +FUZZ_EXTRA_FLAGS := -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls -Wno-deprecated-declarations \ + -g -fno-omit-frame-pointer +FUZZ_CFLAGS := $(FUZZ_EXTRA_FLAGS) $(CFLAGS) +FUZZ_ASFLAGS := $(FUZZ_EXTRA_FLAGS) $(ASFLAGS) +FUZZ_CXXFLAGS := $(FUZZ_EXTRA_FLAGS) -std=c++11 $(CXXFLAGS) +FUZZ_LDFLAGS := -pthread $(LDFLAGS) +FUZZ_ARFLAGS := $(ARFLAGS) +FUZZ_TARGET_FLAGS = $(FUZZ_CPPFLAGS) $(FUZZ_CXXFLAGS) $(FUZZ_LDFLAGS) + +FUZZ_ROUND_TRIP_FLAGS := -DFUZZING_ASSERT_VALID_SEQUENCE + +FUZZ_HEADERS := fuzz_helpers.h fuzz.h zstd_helpers.h fuzz_data_producer.h +FUZZ_SRC := $(PRGDIR)/util.c ./fuzz_helpers.c ./zstd_helpers.c ./fuzz_data_producer.c + +SEEKABLE_HEADERS = $(CONTRIBDIR)/seekable_format/zstd_seekable.h +SEEKABLE_OBJS = $(CONTRIBDIR)/seekable_format/zstdseek_compress.c $(CONTRIBDIR)/seekable_format/zstdseek_decompress.c + +ZSTDCOMMON_SRC := $(ZSTD_COMMON_FILES) +ZSTDCOMP_SRC := $(ZSTD_COMPRESS_FILES) +ZSTDDECOMP_SRC := $(ZSTD_DECOMPRESS_FILES) +ZSTDDICT_SRC := $(ZSTD_DICTBUILDER_FILES) +ZSTDLEGACY_SRC := $(ZSTD_LEGACY_FILES) +FUZZ_SRC := \ + $(FUZZ_SRC) \ + $(ZSTDDECOMP_SRC) \ + $(ZSTDCOMMON_SRC) \ + $(ZSTDCOMP_SRC) \ + $(ZSTDDICT_SRC) \ + $(ZSTDLEGACY_SRC) \ + $(DEFAULT_SEQ_PROD_SRC) +FUZZ_SRC := $(sort $(wildcard $(FUZZ_SRC))) + +FUZZ_D_OBJ1 := $(subst $(ZSTDDIR)/common/,d_lib_common_,$(FUZZ_SRC)) +FUZZ_D_OBJ2 := $(subst $(ZSTDDIR)/compress/,d_lib_compress_,$(FUZZ_D_OBJ1)) +FUZZ_D_OBJ3 := $(subst $(ZSTDDIR)/decompress/,d_lib_decompress_,$(FUZZ_D_OBJ2)) +FUZZ_D_OBJ4 := $(subst $(ZSTDDIR)/dictBuilder/,d_lib_dictBuilder_,$(FUZZ_D_OBJ3)) +FUZZ_D_OBJ5 := $(subst $(ZSTDDIR)/legacy/,d_lib_legacy_,$(FUZZ_D_OBJ4)) +FUZZ_D_OBJ6 := $(subst $(PRGDIR)/,d_prg_,$(FUZZ_D_OBJ5)) +FUZZ_D_OBJ7 := $(subst $(DEFAULT_SEQ_PROD_DIR)/,d_default_seq_prod_,$(FUZZ_D_OBJ6)) +FUZZ_D_OBJ8 := $(subst $\./,d_fuzz_,$(FUZZ_D_OBJ7)) +FUZZ_D_OBJ9 := $(FUZZ_D_OBJ8:.c=.o) +FUZZ_D_OBJ10 := $(THIRD_PARTY_SEQ_PROD_OBJ) $(FUZZ_D_OBJ9) +FUZZ_DECOMPRESS_OBJ := $(FUZZ_D_OBJ10:.S=.o) + +FUZZ_RT_OBJ1 := $(subst $(ZSTDDIR)/common/,rt_lib_common_,$(FUZZ_SRC)) +FUZZ_RT_OBJ2 := $(subst $(ZSTDDIR)/compress/,rt_lib_compress_,$(FUZZ_RT_OBJ1)) +FUZZ_RT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,rt_lib_decompress_,$(FUZZ_RT_OBJ2)) +FUZZ_RT_OBJ4 := $(subst $(ZSTDDIR)/dictBuilder/,rt_lib_dictBuilder_,$(FUZZ_RT_OBJ3)) +FUZZ_RT_OBJ5 := $(subst $(ZSTDDIR)/legacy/,rt_lib_legacy_,$(FUZZ_RT_OBJ4)) +FUZZ_RT_OBJ6 := $(subst $(PRGDIR)/,rt_prg_,$(FUZZ_RT_OBJ5)) +FUZZ_RT_OBJ7 := $(subst $(DEFAULT_SEQ_PROD_DIR)/,rt_default_seq_prod_,$(FUZZ_RT_OBJ6)) +FUZZ_RT_OBJ8 := $(subst $\./,rt_fuzz_,$(FUZZ_RT_OBJ7)) +FUZZ_RT_OBJ9 := $(FUZZ_RT_OBJ8:.c=.o) +FUZZ_RT_OBJ10 := $(THIRD_PARTY_SEQ_PROD_OBJ) $(FUZZ_RT_OBJ9) +FUZZ_ROUND_TRIP_OBJ := $(FUZZ_RT_OBJ10:.S=.o) + +.PHONY: default all clean cleanall + +default: all + +FUZZ_TARGETS := \ + simple_round_trip \ + stream_round_trip \ + block_round_trip \ + simple_decompress \ + stream_decompress \ + block_decompress \ + dictionary_round_trip \ + dictionary_decompress \ + zstd_frame_info \ + simple_compress \ + dictionary_loader \ + raw_dictionary_round_trip \ + dictionary_stream_round_trip \ + decompress_dstSize_tooSmall \ + fse_read_ncount \ + sequence_compression_api \ + seekable_roundtrip \ + huf_round_trip \ + huf_decompress + +all: libregression.a $(FUZZ_TARGETS) + +rt_lib_common_%.o: $(ZSTDDIR)/common/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_lib_compress_%.o: $(ZSTDDIR)/compress/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_lib_decompress_%.o: $(ZSTDDIR)/decompress/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_lib_decompress_%.o: $(ZSTDDIR)/decompress/%.S + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_ASFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_lib_dictBuilder_%.o: $(ZSTDDIR)/dictBuilder/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_lib_legacy_%.o: $(ZSTDDIR)/legacy/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_prg_%.o: $(PRGDIR)/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_fuzz_%.o: %.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +rt_default_seq_prod_%.o: $(DEFAULT_SEQ_PROD_DIR)/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $(FUZZ_ROUND_TRIP_FLAGS) $< -c -o $@ + +d_lib_common_%.o: $(ZSTDDIR)/common/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_lib_compress_%.o: $(ZSTDDIR)/compress/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_lib_decompress_%.o: $(ZSTDDIR)/decompress/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_lib_decompress_%.o: $(ZSTDDIR)/decompress/%.S + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_ASFLAGS) $< -c -o $@ + +d_lib_dictBuilder_%.o: $(ZSTDDIR)/dictBuilder/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_lib_legacy_%.o: $(ZSTDDIR)/legacy/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_prg_%.o: $(PRGDIR)/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_fuzz_%.o: %.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +d_default_seq_prod_%.o: $(DEFAULT_SEQ_PROD_DIR)/%.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $< -c -o $@ + +simple_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_simple_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_simple_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +stream_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_stream_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_stream_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +block_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_block_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_block_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +simple_decompress: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_simple_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_simple_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +stream_decompress: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_stream_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_stream_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +block_decompress: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_block_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_block_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +dictionary_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_dictionary_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_dictionary_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +raw_dictionary_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_raw_dictionary_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_raw_dictionary_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +dictionary_stream_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_dictionary_stream_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_dictionary_stream_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +dictionary_decompress: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_dictionary_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_dictionary_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +simple_compress: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_simple_compress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_simple_compress.o $(LIB_FUZZING_ENGINE) -o $@ + +zstd_frame_info: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_zstd_frame_info.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_zstd_frame_info.o $(LIB_FUZZING_ENGINE) -o $@ + +dictionary_loader: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_dictionary_loader.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_dictionary_loader.o $(LIB_FUZZING_ENGINE) -o $@ + +decompress_dstSize_tooSmall: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_decompress_dstSize_tooSmall.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_decompress_dstSize_tooSmall.o $(LIB_FUZZING_ENGINE) -o $@ + +fse_read_ncount: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_fse_read_ncount.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_fse_read_ncount.o $(LIB_FUZZING_ENGINE) -o $@ + +sequence_compression_api: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_sequence_compression_api.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_sequence_compression_api.o $(LIB_FUZZING_ENGINE) -o $@ + +seekable_roundtrip: $(FUZZ_HEADERS) $(SEEKABLE_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) $(SEEKABLE_OBJS) rt_fuzz_seekable_roundtrip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) $(SEEKABLE_OBJS) rt_fuzz_seekable_roundtrip.o $(LIB_FUZZING_ENGINE) -o $@ + +huf_round_trip: $(FUZZ_HEADERS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_huf_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_ROUND_TRIP_OBJ) rt_fuzz_huf_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +huf_decompress: $(FUZZ_HEADERS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_huf_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_DECOMPRESS_OBJ) d_fuzz_huf_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +libregression.a: $(FUZZ_HEADERS) $(PRGDIR)/util.h $(PRGDIR)/util.c d_fuzz_regression_driver.o + $(AR) $(FUZZ_ARFLAGS) $@ d_fuzz_regression_driver.o + +corpora/%_seed_corpus.zip: + @mkdir -p corpora + $(DOWNLOAD) $@ $(CORPORA_URL_PREFIX)$*_seed_corpus.zip + +corpora/%: corpora/%_seed_corpus.zip + unzip -q $^ -d $@ + +.PHONY: corpora +corpora: $(patsubst %,corpora/%,$(FUZZ_TARGETS)) + +.PHONY: seedcorpora +seedcorpora: $(patsubst %,corpora/%_seed_corpus.zip,$(FUZZ_TARGETS)) + +regressiontest: corpora + CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" $(PYTHON) ./fuzz.py build all + $(PYTHON) ./fuzz.py regression all + +clean: + @$(RM) *.a *.o $(FUZZ_TARGETS) + @echo Cleaning completed + +cleanall: + @$(RM) -r Fuzzer + @$(RM) -r corpora + @echo Cleaning completed diff --git a/externals/zstd/tests/fuzz/fuzz.py b/externals/zstd/tests/fuzz/fuzz.py old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile b/externals/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile new file mode 100644 index 00000000..f9d9fad3 --- /dev/null +++ b/externals/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile @@ -0,0 +1,16 @@ +# Copyright (c) Yann Collet, Meta Platforms, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. + +CC = clang +CFLAGS = -g -fno-omit-frame-pointer -fsanitize=undefined,address,fuzzer -I../ -I../../../lib/ + +.PHONY: default +default: example_seq_prod.o + +example_seq_prod.o: example_seq_prod.c + $(CC) -c $(CFLAGS) $^ -o $@ diff --git a/externals/zstd/tests/gzip/Makefile b/externals/zstd/tests/gzip/Makefile new file mode 100644 index 00000000..cca31096 --- /dev/null +++ b/externals/zstd/tests/gzip/Makefile @@ -0,0 +1,45 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +PRGDIR = ../../programs +VOID = /dev/null +export PATH := .:$(PATH) + +.PHONY: all +#all: test-gzip-env +all: test-helin-segv test-hufts test-keep test-list test-memcpy-abuse test-mixed +all: test-null-suffix-clobber test-stdin test-trailing-nul test-unpack-invalid +all: test-zdiff test-zgrep-context test-zgrep-f test-zgrep-signal test-znew-k test-z-suffix + @echo Testing completed + +.PHONY: zstd +zstd: + $(MAKE) -C $(PRGDIR) zstd + ln -sf $(PRGDIR)/zstd gzip + @echo PATH=$(PATH) + gzip --version + +.PHONY: clean +clean: + @$(MAKE) -C $(PRGDIR) $@ > $(VOID) + @$(RM) *.trs *.log + @echo Cleaning completed + + +#------------------------------------------------------------------------------ +# validated only for Linux, macOS, Hurd and some BSD targets +#------------------------------------------------------------------------------ +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD)) + +test-%: zstd + @./test-driver.sh --test-name $* --log-file $*.log --trs-file $*.trs --expect-failure "no" --color-tests "yes" --enable-hard-errors "yes" ./$*.sh + # || echo ignoring error + +endif diff --git a/externals/zstd/tests/gzip/gzip-env.sh b/externals/zstd/tests/gzip/gzip-env.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/libzstd_builds.sh b/externals/zstd/tests/libzstd_builds.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/playTests.sh b/externals/zstd/tests/playTests.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/rateLimiter.py b/externals/zstd/tests/rateLimiter.py old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/regression/Makefile b/externals/zstd/tests/regression/Makefile new file mode 100644 index 00000000..ba8b4302 --- /dev/null +++ b/externals/zstd/tests/regression/Makefile @@ -0,0 +1,60 @@ +# ################################################################ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +CFLAGS ?= -O3 + +CURL_CFLAGS := $(shell curl-config --cflags) +CURL_LDFLAGS := $(shell curl-config --libs) -pthread + +PROGDIR := ../../programs +LIBDIR := ../../lib +ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common -Wno-deprecated-declarations + +REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS) +REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS) +REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS) + +all: test + +xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +config.o: config.c config.h levels.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +method.h: data.h config.h result.h + +method.o: method.c method.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +result.o: result.c result.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +test.o: test.c data.h config.h method.h + $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ + +.PHONY: libzstd.a +libzstd.a: + $(MAKE) -C $(LIBDIR) libzstd.a-mt + cp $(LIBDIR)/libzstd.a . + +test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a + $(CC) $^ $(REGRESSION_LDFLAGS) -o $@ + +.PHONY: clean +clean: + $(MAKE) -C $(LIBDIR) clean + $(RM) *.o *.a test diff --git a/externals/zstd/tests/test-license.py b/externals/zstd/tests/test-license.py old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/test-variants.sh b/externals/zstd/tests/test-variants.sh old mode 100644 new mode 100755 diff --git a/externals/zstd/tests/test-zstd-versions.py b/externals/zstd/tests/test-zstd-versions.py old mode 100644 new mode 100755 diff --git a/externals/zstd/zlibWrapper/Makefile b/externals/zstd/zlibWrapper/Makefile new file mode 100644 index 00000000..830b294b --- /dev/null +++ b/externals/zstd/zlibWrapper/Makefile @@ -0,0 +1,120 @@ +# Makefile for example of using zstd wrapper for zlib +# +# make - compiles examples +# make MOREFLAGS=-DZWRAP_USE_ZSTD=1 - compiles examples with zstd compression turned on +# make test - runs examples + + +# Paths to static and dynamic zlib and zstd libraries +# Use "make ZLIB_PATH=path/to/zlib ZLIB_LIBRARY=path/to/libz.so" to select a path to library +ZLIB_LIBRARY ?= -lz +ZLIB_PATH ?= . + +ZSTDLIBDIR = ../lib +ZSTDLIBRARY = $(ZSTDLIBDIR)/libzstd.a +ZLIBWRAPPER_PATH = . +GZFILES = gzclose.o gzlib.o gzread.o gzwrite.o +EXAMPLE_PATH = examples +PROGRAMS_PATH = ../programs +TEST_FILE = ../doc/zstd_compression_format.md + +vpath %.c $(PROGRAMS_PATH) $(EXAMPLE_PATH) $(ZLIBWRAPPER_PATH) + + +CPPFLAGS += -DXXH_NAMESPACE=ZSTD_ -I$(ZLIB_PATH) -I$(PROGRAMS_PATH) \ + -I$(ZSTDLIBDIR) -I$(ZSTDLIBDIR)/common -I$(ZLIBWRAPPER_PATH) +STDFLAGS = -std=c89 -pedantic -Wno-long-long -Wno-variadic-macros -Wc++-compat \ + -DNO_snprintf -DNO_vsnprintf # strict ANSI C89 is missing these prototypes +DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \ + -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \ + -Wstrict-aliasing=1 +CFLAGS ?= -O3 +CFLAGS += $(STDFLAGS) $(DEBUGFLAGS) +CPPFLAGS += $(MOREFLAGS) +LDLIBS += $(ZLIB_LIBRARY) + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + +default : release + +release : STDFLAGS = +release : DEBUGFLAGS = +release : all + +all: fitblk example zwrapbench minigzip + +test: example fitblk example_zstd fitblk_zstd zwrapbench minigzip minigzip_zstd + ./example + ./example_zstd + ./fitblk 10240 <$(TEST_FILE) + ./fitblk 40960 <$(TEST_FILE) + ./fitblk_zstd 10240 <$(TEST_FILE) + ./fitblk_zstd 40960 <$(TEST_FILE) + @echo ---- minigzip start ---- + ./minigzip_zstd example$(EXT) + #cp example$(EXT).gz example$(EXT)_zstd.gz + ./minigzip_zstd -d example$(EXT).gz + ./minigzip example$(EXT) + #cp example$(EXT).gz example$(EXT)_gz.gz + ./minigzip_zstd -d example$(EXT).gz + @echo ---- minigzip end ---- + ./zwrapbench -qi1b3B1K $(TEST_FILE) + ./zwrapbench -rqi1b1e3 ../lib + +.PHONY: test-valgrind +#test-valgrind: ZSTDLIBRARY = $(ZSTDLIBDIR)/libzstd.so +test-valgrind: VALGRIND = LD_LIBRARY_PATH=$(ZSTDLIBDIR) valgrind --track-origins=yes --leak-check=full --error-exitcode=1 +test-valgrind: clean example fitblk example_zstd fitblk_zstd zwrapbench + @echo "\n ---- valgrind tests ----" + $(VALGRIND) ./example + $(VALGRIND) ./example_zstd + $(VALGRIND) ./fitblk 10240 <$(TEST_FILE) + $(VALGRIND) ./fitblk 40960 <$(TEST_FILE) + $(VALGRIND) ./fitblk_zstd 10240 <$(TEST_FILE) + $(VALGRIND) ./fitblk_zstd 40960 <$(TEST_FILE) + $(VALGRIND) ./zwrapbench -qi1b3B1K $(TEST_FILE) + $(VALGRIND) ./zwrapbench -rqi1b1e5 ../lib ../programs ../tests + +#.c.o: +# $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ + +minigzip: minigzip.o zstd_zlibwrapper.o $(GZFILES) $(ZSTDLIBRARY) + +minigzip_zstd: minigzip.o zstdTurnedOn_zlibwrapper.o $(GZFILES) $(ZSTDLIBRARY) + $(LINK.o) $^ $(LDLIBS) $(OUTPUT_OPTION) + +example: example.o zstd_zlibwrapper.o $(GZFILES) $(ZSTDLIBRARY) + +example_zstd: example.o zstdTurnedOn_zlibwrapper.o $(GZFILES) $(ZSTDLIBRARY) + $(LINK.o) $^ $(LDLIBS) $(OUTPUT_OPTION) + +fitblk: fitblk.o zstd_zlibwrapper.o $(ZSTDLIBRARY) + +fitblk_zstd: fitblk.o zstdTurnedOn_zlibwrapper.o $(ZSTDLIBRARY) + $(LINK.o) $^ $(LDLIBS) $(OUTPUT_OPTION) + +zwrapbench: zwrapbench.o zstd_zlibwrapper.o util.o timefn.o datagen.o $(ZSTDLIBRARY) + + +zstd_zlibwrapper.o: zstd_zlibwrapper.h + +zstdTurnedOn_zlibwrapper.o: CPPFLAGS += -DZWRAP_USE_ZSTD=1 +zstdTurnedOn_zlibwrapper.o: zstd_zlibwrapper.c zstd_zlibwrapper.h + $(COMPILE.c) $< $(OUTPUT_OPTION) + + +$(ZSTDLIBRARY): + $(MAKE) -C $(ZSTDLIBDIR) libzstd.a + +$(ZSTDLIBDIR)/libzstd.so: + $(MAKE) -C $(ZSTDLIBDIR) libzstd + + +clean: + -$(RM) $(ZLIBWRAPPER_PATH)/*.o $(EXAMPLE_PATH)/*.o *.o foo.gz example$(EXT) example_zstd$(EXT) fitblk$(EXT) fitblk_zstd$(EXT) zwrapbench$(EXT) minigzip$(EXT) minigzip_zstd$(EXT) + @echo Cleaning completed diff --git a/hooks/pre-commit b/hooks/pre-commit old mode 100644 new mode 100755 diff --git a/src/android/gradlew b/src/android/gradlew old mode 100644 new mode 100755 diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp old mode 100644 new mode 100755 diff --git a/src/input_common/analog_from_button.h b/src/input_common/analog_from_button.h old mode 100644 new mode 100755