Compare commits
3042 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fdec47a83d | |||
| 7ff913bbd2 | |||
| 94775bef9f | |||
| 3cf102334f | |||
| 627e733a30 | |||
| d31b80da5b | |||
| eb231b65f3 | |||
| 59e3b1f98d | |||
| 8b174bb272 | |||
| 4199a44bef | |||
| 777392c0fe | |||
| ede1fec5e7 | |||
| 16de3e78a5 | |||
| d7508d8c09 | |||
| 2a136c1c1d | |||
| 2578102be9 | |||
| dadee7acfb | |||
| 28f0bb4e11 | |||
| 824c8a8efb | |||
| 37f27a1262 | |||
| 2b8a7a492a | |||
| db56bbb11b | |||
| 82d26f04a4 | |||
| 5045f7eb42 | |||
| 82a6ccac4d | |||
| 2d74298001 | |||
| ce21254ed2 | |||
| 874250fe49 | |||
| c8a3acbba8 | |||
| 81e11987a2 | |||
| 668cefec2f | |||
| 212bc04257 | |||
| db401fd05e | |||
| bebe72481c | |||
| 2b9e83256d | |||
| 5763518cce | |||
| 3e4c5bab72 | |||
| bce109ab54 | |||
| 69ca635c4c | |||
| e0bf460993 | |||
| 29762a8a96 | |||
| c7ef08dc2d | |||
| 50a6698715 | |||
| 7dd2cdea1e | |||
| af87f7f2bf | |||
| 295889023f | |||
| feef2e38cf | |||
| 80d30aab32 | |||
| e910a9dc3e | |||
| 504224696c | |||
| e2acd666df | |||
| e5c0d998b7 | |||
| 63f6fef964 | |||
| 983eb6d676 | |||
| 98fedef1a1 | |||
| 75a769759d | |||
| 2354b01bad | |||
| c331b9f1e2 | |||
| afeaeeddec | |||
| ab7ef9f511 | |||
| d3ad6d25d8 | |||
| 2e29f9fa5f | |||
| 5d9f71bb13 | |||
| 82ed25bb44 | |||
| f57393c0e8 | |||
| b54cced19c | |||
| 60a0544314 | |||
| 283c1cf931 | |||
| fff53efc05 | |||
| 07d368adca | |||
| 13276d93fa | |||
| 79b1b1a586 | |||
| 2f083f3e56 | |||
| 73b0b4db9d | |||
| ca0e614b56 | |||
| 72613d06a5 | |||
| 48ad5513ff | |||
| 201d9f1346 | |||
| 1e8f1f49d0 | |||
| 65707900bc | |||
| 39c5be43aa | |||
| c4437cb293 | |||
| e2b86a49db | |||
| 8fe83be87f | |||
| 17167d4905 | |||
| 05ff7e35a1 | |||
| f67cec4752 | |||
| fd4882abcf | |||
| 0f42579e68 | |||
| 7398d8f68f | |||
| ec33109b22 | |||
| 2cfa4c1eb7 | |||
| a13b4d10d9 | |||
| 36e94e58d0 | |||
| d0a52bd483 | |||
| 38a1d3179b | |||
| 0d639d6386 | |||
| 4256057c27 | |||
| b720b47c12 | |||
| 55e4a4f086 | |||
| b4cb9f8b2f | |||
| 63298ebd6d | |||
| 73c816e468 | |||
| 0492e650ef | |||
| b8b94ee89e | |||
| 81176716d5 | |||
| 26e7ae00e9 | |||
| c75d7a685d | |||
| 4318cc22ee | |||
| 575cb720c6 | |||
| 5db34fbf92 | |||
| 7cfef2f6bf | |||
| 4603f1df4b | |||
| c69fcfff9d | |||
| 70f14101ed | |||
| a9803459ed | |||
| 43034e8e92 | |||
| ef547034f6 | |||
| e87fc60391 | |||
| 45e6e73d85 | |||
| be30c26dbb | |||
| 79e9b0762c | |||
| a9a806c418 | |||
| c7d8b6fed1 | |||
| a723efd225 | |||
| cf429dfce4 | |||
| 3fcd64a0c0 | |||
| 83cb38022b | |||
| 93c04d1f66 | |||
| 3c47898cf4 | |||
| 61e1366122 | |||
| a20636fd63 | |||
| aa8cdca0a9 | |||
| 6931a3aa70 | |||
| d001a63bce | |||
| 0d3377f48b | |||
| aeb04d97c8 | |||
| eb68ab91cd | |||
| ee242ba987 | |||
| 44a53736ff | |||
| 1b21fef081 | |||
| 5f9c50cd3e | |||
| 793d8c1d2e | |||
| 81f868a0c6 | |||
| dadbbbdc64 | |||
| bfd2153f2b | |||
| 077793fa5e | |||
| acad3c3000 | |||
| 3b4627e17e | |||
| 05976ee1a7 | |||
| c1311c78a3 | |||
| 717150b7f3 | |||
| a68c62d938 | |||
| c11f8a569a | |||
| 03436d2415 | |||
| 4ae75375e0 | |||
| 2721ef0636 | |||
| 7a232cb330 | |||
| 52f19ae330 | |||
| 275477f914 | |||
| 2ed6755d5d | |||
| 78c555b4a6 | |||
| a127125707 | |||
| f853f91c5b | |||
| e7ca5c54ff | |||
| 663d6b466b | |||
| 0e2a9de2b2 | |||
| 34df0d6ef1 | |||
| 540164849b | |||
| 252143d0bb | |||
| 480ab51650 | |||
| 972c76eb42 | |||
| e5aeea9ed2 | |||
| f204670008 | |||
| 651155c64d | |||
| 660aee6d22 | |||
| a646231630 | |||
| 1050de5171 | |||
| b7a5b9437a | |||
| 620955a724 | |||
| 2e64a277f8 | |||
| ea567a8b14 | |||
| be23f93ee6 | |||
| fcdf0e92c1 | |||
| 2d6987252e | |||
| 4a9c46253e | |||
| 5bcf9dd8af | |||
| 284adb203f | |||
| adafa841f7 | |||
| fdc5d25d03 | |||
| 294a7077de | |||
| 990d0ec543 | |||
| bb90c4dff4 | |||
| 00e3d992e8 | |||
| 937bfa4e49 | |||
| 1d9c211eed | |||
| 76ddf6b8da | |||
| 7f1f29b0d8 | |||
| 222471744f | |||
| cc100be26e | |||
| 966b571b7c | |||
| f3e710394a | |||
| bfd1f1fbfa | |||
| a09146b5e0 | |||
| bbf2b08f48 | |||
| e2dbc661f1 | |||
| 7626e09f66 | |||
| 248a6980cf | |||
| f956bfc797 | |||
| 6da79783ea | |||
| 22329e0ab2 | |||
| a94b0329c9 | |||
| be8601f8cc | |||
| bd441e83ae | |||
| 02bd9cc403 | |||
| c9f6a3583c | |||
| 076aaf829a | |||
| 85f0c5a445 | |||
| d5263a56ce | |||
| ef5b55b4d1 | |||
| d65e65b2b1 | |||
| 6aa641e5aa | |||
| 504839951a | |||
| d55746f62d | |||
| 144010295e | |||
| 181c752488 | |||
| bd4aca5c12 | |||
| ad6d73c875 | |||
| c5cc83d424 | |||
| fe949bdf67 | |||
| 766fe466d6 | |||
| 333a288248 | |||
| 613df414ed | |||
| be050693f2 | |||
| bf957f435e | |||
| 3a6f688265 | |||
| 1084a7896c | |||
| 9ea2b31541 | |||
| 09da986742 | |||
| cb70a5fef5 | |||
| 4fa6a6aeef | |||
| ab31e8dde9 | |||
| 53d7b5449f | |||
| d33a34f016 | |||
| f6ff5a2805 | |||
| 1518e5bc98 | |||
| 78f48d65d5 | |||
| b81ec224b7 | |||
| 4be6cfebcd | |||
| 98973dd8b9 | |||
| 1218b6ff2a | |||
| ba5c77c9e5 | |||
| cbaedffce2 | |||
| cb60603950 | |||
| 0a69e7803b | |||
| baa9090198 | |||
| e78a08b8fc | |||
| 7e5e6012df | |||
| 0a1d24d1d9 | |||
| 35555bfb8a | |||
| c9cb42df40 | |||
| 2be03028f4 | |||
| 214dd0a522 | |||
| 182e0796df | |||
| fb844a8ed1 | |||
| 6be3e747ca | |||
| 23f63e4196 | |||
| fd6837b267 | |||
| 1c29f921e0 | |||
| 1ab6e01de2 | |||
| 801618740c | |||
| 2469563b26 | |||
| 00139caf43 | |||
| 21d102c84f | |||
| f17d9967c2 | |||
| 0569ef37ba | |||
| 984334c9a1 | |||
| 34a25e61c7 | |||
| ed3f45953e | |||
| 80de11bc5b | |||
| c9fe84c9aa | |||
| 5f98bb0ab0 | |||
| d86d5314ba | |||
| 700c8730cf | |||
| b4429e1a42 | |||
| a8fa3ca5cf | |||
| 9aef7b0d6f | |||
| 2575eef3c0 | |||
| 8236276a90 | |||
| fdc68812c5 | |||
| 9db6d18d11 | |||
| f962afe146 | |||
| adcd569852 | |||
| d045b7f223 | |||
| 57cb6a7530 | |||
| baa1ed9be3 | |||
| 16af6e1a29 | |||
| 0af8998be6 | |||
| c32f517fa5 | |||
| 9131d5216f | |||
| fb14a7991d | |||
| ff53862dab | |||
| 49245a20c5 | |||
| 13bc031163 | |||
| 0c18c1c35c | |||
| 63dc19ce25 | |||
| 6871c2fc0a | |||
| 4ae3a8b2b0 | |||
| f2e562b5de | |||
| f7e2266c3f | |||
| 361a3056cb | |||
| ca0437556d | |||
| 51899957a9 | |||
| 7b0b760d78 | |||
| 4f5866b5a7 | |||
| a6b5033cf1 | |||
| a6296ecd67 | |||
| bb1df15958 | |||
| 249431f45f | |||
| cbe129795e | |||
| 2a135e245b | |||
| 05a0b3557a | |||
| c7cfe8b608 | |||
| 8d3e1d28a7 | |||
| 7841e15583 | |||
| dd164fbc86 | |||
| 23fe02e84a | |||
| 94e72238f2 | |||
| 8f7ac520eb | |||
| bd193201b2 | |||
| 8ced672d24 | |||
| f218812858 | |||
| 8a7b980fc0 | |||
| 385c9877f8 | |||
| 10df93536e | |||
| 6cad27896f | |||
| 052392d97b | |||
| ce6b5a0688 | |||
| 1879185e42 | |||
| a928a08f9d | |||
| 1805cb6857 | |||
| 6ce625b535 | |||
| 4702f12818 | |||
| 4f3054f07d | |||
| 0d7bd52e21 | |||
| c3466f579c | |||
| 7c105d7af5 | |||
| 924b229afb | |||
| 890d66ecf0 | |||
| 143049922b | |||
| e6ccef2cf1 | |||
| be61e9f584 | |||
| 89d0fda9fa | |||
| 6a85bab5da | |||
| c1a55b063e | |||
| 77c914bce5 | |||
| cc60f03b2e | |||
| cc9ccdbbd1 | |||
| 9dfc8f573c | |||
| 4e2fdb464a | |||
| 73b854874e | |||
| 0016512df1 | |||
| 527139978a | |||
| 47bc68fa6b | |||
| 972b670a64 | |||
| d7c416f243 | |||
| 3ace7a0468 | |||
| d305023f5e | |||
| 963392a5ae | |||
| 2f453acf5d | |||
| 4ae1576726 | |||
| 17bd0b3248 | |||
| a1ad1aee99 | |||
| a817ed0692 | |||
| 828a6cf07b | |||
| 962c35aa08 | |||
| b327645e64 | |||
| e1b42616a2 | |||
| f96638c42a | |||
| 6272152dfe | |||
| 030a200c08 | |||
| 994da63b4d | |||
| 2315bff280 | |||
| 98dddf93d8 | |||
| fd2939e18d | |||
| 80c27e0822 | |||
| b463f24eda | |||
| 2a849444db | |||
| 69e106c0c5 | |||
| 926481dace | |||
| a3b2cde58d | |||
| 30f37d2cc6 | |||
| c4d61dd9fe | |||
| 210870f840 | |||
| 4cb4bd38eb | |||
| 58c6d19f7c | |||
| f99ae94747 | |||
| 6868ca7953 | |||
| 87a5a4ef32 | |||
| c67a5d677c | |||
| 1ce6f0e6f4 | |||
| 740b4ff865 | |||
| 1059f62566 | |||
| df3193c1ee | |||
| 67860e3704 | |||
| 35fbb1ecb6 | |||
| c63a71ad42 | |||
| f33645f739 | |||
| d7ba31cab8 | |||
| 342b1b7d6c | |||
| 936013f60c | |||
| fdf2eddc73 | |||
| 4409753014 | |||
| 9172ae3d19 | |||
| e2f60adc95 | |||
| 1bb93d4fce | |||
| eb90eab632 | |||
| 0f4975fd7f | |||
| b5b1f06a11 | |||
| 86f8eb0930 | |||
| 91ad0e7572 | |||
| b034ee98fe | |||
| ded07f8781 | |||
| 849bdd87e1 | |||
| 643e48efd7 | |||
| 92f072cf70 | |||
| 95bf2e2e41 | |||
| 6a6c6d84eb | |||
| 08a689c81e | |||
| d1174385ef | |||
| cb5f590e10 | |||
| 5ed9c66ed9 | |||
| b8f52d14f4 | |||
| 5d295c24f0 | |||
| 8be9da8280 | |||
| 819c33fee2 | |||
| 75a2cc4ecb | |||
| e2833cf303 | |||
| 801de73dbe | |||
| 6a53c0b3d4 | |||
| 58b122d97d | |||
| 276b748aa6 | |||
| 23570097cf | |||
| 62a07df45e | |||
| 593a69ce25 | |||
| c33603e324 | |||
| 29fa358077 | |||
| 49766388bc | |||
| f23267bddd | |||
| 4484acf9d6 | |||
| 47ddace96a | |||
| 8aadbcd786 | |||
| 517bc9db0b | |||
| 16bfa7b846 | |||
| 570b2d0e88 | |||
| 2653a0749a | |||
| 3de0008543 | |||
| d4e2d7e8a8 | |||
| a9c08c6f52 | |||
| c2aa5c35f7 | |||
| 423f1a8758 | |||
| cc5f684e33 | |||
| b6646d319a | |||
| 3667fa4e44 | |||
| d1c80154f6 | |||
| 3c2bfc742e | |||
| d60fef753f | |||
| 70ed2d0d03 | |||
| 716d203a78 | |||
| 9719a7dd56 | |||
| c097233bf3 | |||
| 69a583281f | |||
| 8e90c9af2b | |||
| a784284b7f | |||
| 0509edf08d | |||
| 7ca20f424f | |||
| b74d51c2a8 | |||
| 58061cd121 | |||
| b8f6be5389 | |||
| 7c766b3313 | |||
| 91b81b587b | |||
| 780a4347b8 | |||
| 606ad08dd1 | |||
| 75c31dff1d | |||
| 473b90419f | |||
| f88b85e126 | |||
| b122f8e9d0 | |||
| cb8b1595a1 | |||
| 1bee919276 | |||
| 78b1da5c00 | |||
| bb8239ccda | |||
| 2a594ad0a7 | |||
| b05073550c | |||
| 37d6a34e58 | |||
| 4f0cba9bb6 | |||
| 4d1c754af9 | |||
| c1cfde21d7 | |||
| bb1f9cdecd | |||
| b259b0ca28 | |||
| 0051dfc84f | |||
| 9f294e6ce5 | |||
| 153ea8be03 | |||
| f3f7f97f8d | |||
| 9bb6854e64 | |||
| 4bba1e6cb7 | |||
| 597e8fe407 | |||
| 556c541ffb | |||
| 5963f18f7c | |||
| 0dac6b7be3 | |||
| 296ede780b | |||
| faaa19331a | |||
| 88cb5886f3 | |||
| 2fcc3f86c0 | |||
| 9362fde9eb | |||
| 56f4d781c1 | |||
| 7a3637ff5a | |||
| 2923c0968e | |||
| 98cfe99d65 | |||
| bdd97fe0b2 | |||
| 6b500bc83b | |||
| 92a12a2ec1 | |||
| 04d79040f9 | |||
| 3201ddc680 | |||
| 2f06de54c5 | |||
| 6489ec9bba | |||
| 1a5ba22fe7 | |||
| 8f9713ed53 | |||
| 90eb68b3b9 | |||
| 95fcbcb4f2 | |||
| b97688d119 | |||
| 5ea3627cab | |||
| d9288213ec | |||
| 614c86fb7d | |||
| 9f651ee40f | |||
| 774c8c3fd4 | |||
| b711d2f750 | |||
| 8a793d5942 | |||
| 99f52c60ed | |||
| 2c2e108301 | |||
| 563165e6ae | |||
| f1a31b4793 | |||
| 5e9b6bd69d | |||
| 9b990c4eae | |||
| 7a625a449a | |||
| c2b62359d5 | |||
| 6722e8972e | |||
| fefe7a3452 | |||
| 90a1322929 | |||
| d698eb69e2 | |||
| 0ef00e9b82 | |||
| 95cedb6640 | |||
| d736da4208 | |||
| be83788666 | |||
| 5a28a51abc | |||
| 8a84df752c | |||
| 85f53b210d | |||
| 5d13c6cd01 | |||
| 98a0d381e9 | |||
| e1d20fd0b5 | |||
| d1035ecd8f | |||
| 0e651facdd | |||
| 9fdddfc332 | |||
| 7d2913709c | |||
| 3623199e8d | |||
| e4b23f7a47 | |||
| f056ecdcd5 | |||
| 857a03a074 | |||
| a34deee4f5 | |||
| fc9c8ae482 | |||
| 08c63f06eb | |||
| bbff510ef1 | |||
| f747435952 | |||
| e6edad8f46 | |||
| 05e44b9644 | |||
| 16bb7ab841 | |||
| 9248f02557 | |||
| 9485a56af1 | |||
| 021c8db58a | |||
| 8ab180edf8 | |||
| ab35b685d4 | |||
| 86745721ee | |||
| c34fe09a79 | |||
| 1fa9ff2c05 | |||
| e8ef0cf63f | |||
| 8c84efb8fb | |||
| f3a7620ae8 | |||
| c7969ed5a5 | |||
| 900926c0ed | |||
| df94f4288a | |||
| 969efe687d | |||
| ee3f1292d0 | |||
| cacb239040 | |||
| 28d1789783 | |||
| 633eb98e34 | |||
| 4854c03096 | |||
| e853119c77 | |||
| 161a58bafb | |||
| f5fd94e815 | |||
| edde6210f1 | |||
| 507e19945e | |||
| 4a35bf32ea | |||
| e04bf9e4bc | |||
| c384d224c0 | |||
| 35427f998e | |||
| 1174da2bc3 | |||
| 11e8a47030 | |||
| 8c4e9bcf0d | |||
| 9dfd624901 | |||
| 79e65503a9 | |||
| 59f18b9d9f | |||
| fb3699fb89 | |||
| 9d2d59b5d2 | |||
| aefb2fa3c3 | |||
| e8aa80f904 | |||
| 990988f920 | |||
| 576d9a4e7e | |||
| 1d462ee424 | |||
| c9b09555c4 | |||
| 860b5bf967 | |||
| 5063480a38 | |||
| 3400ae9dbe | |||
| 3385264eb2 | |||
| 34646f1c6a | |||
| 50aa63a5a0 | |||
| 64557bee43 | |||
| 7c21c4513e | |||
| c6d6378005 | |||
| 4f6979967d | |||
| e633c51b50 | |||
| 143f0accef | |||
| b413f3da26 | |||
| 6eafa552bb | |||
| 7a0514d9b4 | |||
| 7e7565299e | |||
| ed34a089c6 | |||
| d14a2c5282 | |||
| f014406b65 | |||
| 58771ecca6 | |||
| 5d9dcb634b | |||
| 19c2c1edcf | |||
| 0430e7931e | |||
| bb8e607442 | |||
| e61ada944d | |||
| 46730315e3 | |||
| 4869142034 | |||
| 8e42e17bbf | |||
| 38c8b84a26 | |||
| c652626a37 | |||
| 06f6e47ebf | |||
| 403b180b1d | |||
| ee008acfbd | |||
| d149092ac0 | |||
| eafa136c69 | |||
| 402c885987 | |||
| 5e7e0508b9 | |||
| ff1d5fb794 | |||
| ad3f63b5c4 | |||
| a3e51e6dee | |||
| c1b9c79f54 | |||
| e0bc040b0a | |||
| 85eb4c7537 | |||
| 1f929d47d0 | |||
| 608662d73b | |||
| 7841d23e77 | |||
| b72dda4ada | |||
| c59c8a1ea2 | |||
| 1522293be0 | |||
| b37bc99330 | |||
| 7f905724b1 | |||
| 2bf5bb1625 | |||
| 08d3376740 | |||
| 7bace76176 | |||
| ef336dbcc6 | |||
| ca7217e717 | |||
| 3931cb7871 | |||
| 9e8de4abe5 | |||
| 26be845563 | |||
| 2f11a629fa | |||
| a295437e11 | |||
| 04597fb804 | |||
| f2f002409b | |||
| 509de877ca | |||
| 63aea4a7dc | |||
| 6470c748db | |||
| 25a6429e6a | |||
| 4fa1c2a97e | |||
| 9ad39d77cc | |||
| 92527126a8 | |||
| 02b4a4c974 | |||
| ede570be21 | |||
| 08627e9df5 | |||
| 6d9f3adc86 | |||
| 96433b4e39 | |||
| f4947cc2ae | |||
| 7b554d4f72 | |||
| 5b54544438 | |||
| ef78d23494 | |||
| ef8a7f330d | |||
| b72e0f3060 | |||
| 2a0bab938b | |||
| cd637629c4 | |||
| b9adfd801d | |||
| 69355514c9 | |||
| 33dc947c21 | |||
| 6de021d8d8 | |||
| 9be86621bf | |||
| a7a0876298 | |||
| 31b42345c3 | |||
| 1b172e729e | |||
| 3bf387a2d4 | |||
| 9f20bbb046 | |||
| 82af555974 | |||
| 50638b5213 | |||
| 650df95b72 | |||
| b2115a4162 | |||
| d67bf16a08 | |||
| a4c9b64224 | |||
| 8f572e5fe6 | |||
| e58873044b | |||
| 8ada92a69f | |||
| 3c8ed5c000 | |||
| c127d5b64a | |||
| 2d3bd0809a | |||
| eef955a9dd | |||
| e59ce39dc6 | |||
| 62815f5c3c | |||
| f496010273 | |||
| 143c4e3322 | |||
| e7f1e99a5e | |||
| 140a031515 | |||
| b7c91941b8 | |||
| 33f0b6da67 | |||
| ee18fe9bba | |||
| a51330cf07 | |||
| a67aed2744 | |||
| d979e19315 | |||
| 4c74d16795 | |||
| 6e541a432f | |||
| d8f47e248a | |||
| d1a869496b | |||
| f42a37555d | |||
| d9e019bd87 | |||
| ce194fa5d8 | |||
| b5bdf57636 | |||
| a3a81ce7c6 | |||
| 61f347401c | |||
| d985a4c250 | |||
| d31947e1f0 | |||
| e4659b7d7c | |||
| 8827a534db | |||
| ddf48b45a5 | |||
| 8eabb9b02f | |||
| 8a195a0b35 | |||
| 955206aaf0 | |||
| 082dd7d5ee | |||
| 90714cf624 | |||
| 61798d33f0 | |||
| 6e2a41cb26 | |||
| 515897e180 | |||
| fe4a8f33b1 | |||
| 304d848f53 | |||
| b5f738abf3 | |||
| 7ebed06393 | |||
| 2e56fe82bb | |||
| 32019c61aa | |||
| f7ffae565c | |||
| cd11bb1606 | |||
| 24c924d668 | |||
| 9be94e4b58 | |||
| 15e9d8c99d | |||
| 391f511094 | |||
| 5b53c11a6b | |||
| 9df4b6ea24 | |||
| a440564ba4 | |||
| 9583cfcc93 | |||
| c4a921283a | |||
| 4e05f087f9 | |||
| 40b506d2e0 | |||
| 263f384810 | |||
| d80c145a18 | |||
| 8848fe35f6 | |||
| 7a681bd20d | |||
| ed31fb184b | |||
| 360b94dd6c | |||
| 8524e73f59 | |||
| 940514e5ca | |||
| a4e47625ac | |||
| 7c16872a6e | |||
| 994c3c3552 | |||
| c34f496600 | |||
| 8bca8629be | |||
| 85fdd579d6 | |||
| e88d2ff88c | |||
| bdf08baebd | |||
| 3dcdd25177 | |||
| 491e8640b2 | |||
| b23b7ef85e | |||
| b167374f13 | |||
| cd1f6e733f | |||
| d3fc7687b8 | |||
| 17a83d58da | |||
| 18a8e1b6d6 | |||
| 2c23cbb359 | |||
| cdd58cf757 | |||
| a0df325659 | |||
| a59005e836 | |||
| 5da6a27e6b | |||
| ef97af71e3 | |||
| 6ed67f4532 | |||
| 1278d663b4 | |||
| 0395c7b407 | |||
| df3d15ffb3 | |||
| 6f673310d2 | |||
| 978c3eca23 | |||
| 20bc848bd6 | |||
| ce7f1292dc | |||
| d97ff8bb40 | |||
| 8a9b46d82f | |||
| 12e5703541 | |||
| 1b87fc2ee6 | |||
| ebd0c780a1 | |||
| bd976cd562 | |||
| 0e511c3e07 | |||
| 300d489408 | |||
| 024d081167 | |||
| 348173d3f1 | |||
| 23e3814f8a | |||
| b818e2c4b8 | |||
| 6adb3dc142 | |||
| 0e154cc759 | |||
| 9dce8d9bce | |||
| 0aa3b9c487 | |||
| dc7ab3ed30 | |||
| 254259b354 | |||
| 9651c70efd | |||
| 5840190ed5 | |||
| a807b88694 | |||
| 0db82e09e9 | |||
| e5865f171a | |||
| 166d198dcb | |||
| 445795f2ec | |||
| 6be4a87dac | |||
| 17c47053d6 | |||
| b4e18f7521 | |||
| fbe4d287c7 | |||
| 543fa3ae79 | |||
| 7cf855413c | |||
| f5d65dc0bc | |||
| 2f6211a1d9 | |||
| 513a57330a | |||
| 715ddf0620 | |||
| 6bb31e276e | |||
| b10f1df49f | |||
| f999519b13 | |||
| aedbf02830 | |||
| bd5479b250 | |||
| 9d14715652 | |||
| 72156fcf1b | |||
| 1c6eab00d1 | |||
| f9738c5b55 | |||
| 3b63083619 | |||
| d5d7d8bc84 | |||
| f26118cf5a | |||
| 5d6c4b475c | |||
| 2c4ef392f6 | |||
| 2a128fe772 | |||
| bb7d3ca3a1 | |||
| a2bdba7eda | |||
| e8aabc9980 | |||
| 9f554a14fd | |||
| 68a2b91ccb | |||
| 4089cc6e6f | |||
| 4e8848eeca | |||
| 8c6133c115 | |||
| 483db31acd | |||
| 35dae3dab7 | |||
| 8232aedf78 | |||
| d30a0a2e67 | |||
| d913fe508f | |||
| 4029903301 | |||
| 5db7e826d3 | |||
| 7f3e7da7c7 | |||
| 93cefde8fc | |||
| 02e7981e10 | |||
| 0ecec10af0 | |||
| 00b8cba987 | |||
| 8486bff918 | |||
| 5305eb5b8a | |||
| 377a3bb7de | |||
| 5a47e8d2c6 | |||
| 71f4cd7c85 | |||
| f7751684af | |||
| 59df1d39b2 | |||
| 7e5933e6a0 | |||
| 2cefd34bb7 | |||
| eac891dc3a | |||
| abd3599408 | |||
| 1bcd259c00 | |||
| c4e835266c | |||
| 685953f6a5 | |||
| 03fffbc724 | |||
| e1a8c932ee | |||
| 1aa2a6b054 | |||
| 1ad96c9c81 | |||
| f69199909f | |||
| d063e77040 | |||
| bf3ddeb1eb | |||
| fc261ad8cd | |||
| 90fc018295 | |||
| cdc01d9a69 | |||
| da7e76c07d | |||
| ba9118aa58 | |||
| fdce705e55 | |||
| 81268e7064 | |||
| f502f41359 | |||
| 34c9cfb6b0 | |||
| 6da1790c46 | |||
| d333c940da | |||
| c940d2906f | |||
| ac4b51ba85 | |||
| ea7a1ad2c7 | |||
| 45ddd6a68d | |||
| acd99364e0 | |||
| 14710dea55 | |||
| 5d3be8da1d | |||
| 3026821f9f | |||
| fba51dabd0 | |||
| c4da5e81fa | |||
| bc80d81432 | |||
| 67797efead | |||
| c7cb036536 | |||
| 0ccbc5f139 | |||
| 2a6bbcaf8f | |||
| d46a8438ba | |||
| cc9d19da19 | |||
| 6e6aa6fd6d | |||
| 61652a2989 | |||
| edd7503607 | |||
| c9d6dab401 | |||
| d303038bcb | |||
| 0a0e7c3b7c | |||
| 0b4ac35bc9 | |||
| c51864ca39 | |||
| a1cabd5a68 | |||
| 9c1bc99d7a | |||
| c05fedcb76 | |||
| e11beeae4b | |||
| 4749e0d71e | |||
| 1c01b77a71 | |||
| 1dd8ad3685 | |||
| d6f6350b54 | |||
| 4f3b85e604 | |||
| efd5bc24b0 | |||
| a1d5dfa1ac | |||
| 597c2ba180 | |||
| 2c2fb1b70b | |||
| fc1287659a | |||
| 1a76630594 | |||
| 322f682d32 | |||
| 0e329336fc | |||
| b33bdabbb6 | |||
| 27d30121ab | |||
| 345278f309 | |||
| 4953e77161 | |||
| 8d61e037f9 | |||
| 33a51e69bf | |||
| d5dd9bbf24 | |||
| 8772e52513 | |||
| 9e1631ad4f | |||
| 134b829d59 | |||
| 3df7d26101 | |||
| cf56086f06 | |||
| a72aca4379 | |||
| edb0b7519a | |||
| 3a3248c88c | |||
| 3f14b9dab7 | |||
| b1c07c22ce | |||
| 3b2c411274 | |||
| e418af1ccd | |||
| 7dc004acb3 | |||
| 2635472896 | |||
| 5c0340f9ae | |||
| c2c970ee33 | |||
| b52dabe091 | |||
| 3fa2db8d6f | |||
| 1e7950f671 | |||
| 8fde05191a | |||
| 2557de6c4e | |||
| 44328aee76 | |||
| f606b5879b | |||
| 83607119df | |||
| 9b86e68268 | |||
| d688a05ac7 | |||
| 97e975b4f6 | |||
| 9dd0e3ce4f | |||
| ca2293f6d3 | |||
| 0cd1ef0c7a | |||
| b0207ce524 | |||
| fab0c3b09d | |||
| 8b35dd3358 | |||
| cadcbb27eb | |||
| 297d44c614 | |||
| 22178f2224 | |||
| 554f8a376c | |||
| 4157affbd7 | |||
| 4b991203df | |||
| 38a265741c | |||
| 56eb02280f | |||
| ed900b0476 | |||
| 42206364e5 | |||
| 82d9bb8f51 | |||
| 923a9d3f9b | |||
| ae7660068b | |||
| f466c1d764 | |||
| 6e76f8ef3a | |||
| b3a8d02caf | |||
| 022ba32c1a | |||
| 8f5e89c900 | |||
| d335d7bafd | |||
| 1f51ef7df6 | |||
| ec082ee023 | |||
| a6bc271e0d | |||
| 791fd9199e | |||
| 9e8baf1914 | |||
| 64b7080532 | |||
| 8fd5479f32 | |||
| 04eb9c02c3 | |||
| 07b41b9bc3 | |||
| 8ebadfafe9 | |||
| 3283896e4b | |||
| b444bcf418 | |||
| 13034577fc | |||
| 9feefc2e7f | |||
| a5393e985d | |||
| e3fe0dc89b | |||
| 42d49e9d50 | |||
| 06eb244800 | |||
| 870cdfa51f | |||
| 93787c74ee | |||
| 945323fe15 | |||
| 5e41e69b27 | |||
| 9d14185f7d | |||
| 0f74162551 | |||
| 00b1ff1ff6 | |||
| 977024ea94 | |||
| 3534ed21d7 | |||
| ee093e5232 | |||
| 807ab8d19f | |||
| 81f3ff098f | |||
| 85a5759afb | |||
| 490e7a56a5 | |||
| e41c475671 | |||
| b0841268bd | |||
| b9b3b67b95 | |||
| 0d57d2cfe3 | |||
| 32de5d0d7f | |||
| 51eab2a4b7 | |||
| 93cf170253 | |||
| f7554374ab | |||
| b4870f62c9 | |||
| f1d713ebf6 | |||
| 4134a512b9 | |||
| cf998f945c | |||
| a7386238dd | |||
| 6b39d122a6 | |||
| a0582c5380 | |||
| 1f37112969 | |||
| 361958db76 | |||
| 8bc7880b19 | |||
| ceddf29586 | |||
| 3fc78e21bc | |||
| 48e00b371c | |||
| aee52d3880 | |||
| bd54499537 | |||
| e6da9e8d1a | |||
| 156ca03b67 | |||
| 3f4419b177 | |||
| 676f860d7d | |||
| 5ce93ae0c7 | |||
| 43231826b9 | |||
| 899b393fcc | |||
| 5c3e02d2f0 | |||
| a29064107e | |||
| 4cdc969801 | |||
| 68159d457e | |||
| daafc29d2b | |||
| 3c786acf2b | |||
| 53c3817d4d | |||
| 9109254488 | |||
| df19f0d5ec | |||
| 093362e479 | |||
| 7826a3652b | |||
| c27b7e52e1 | |||
| 6f79cbb2a6 | |||
| 6f33929f91 | |||
| 2e8b649195 | |||
| 3841be7e20 | |||
| 2c28521283 | |||
| 1c735cc204 | |||
| f0b13ae8e4 | |||
| b1a2f8fec0 | |||
| 83828aa8a3 | |||
| 4eb81b4d66 | |||
| 96d9968db5 | |||
| 2781e37ec0 | |||
| 6d61e773b5 | |||
| c5171114d1 | |||
| 0ca0a832de | |||
| aef54a4bfd | |||
| 4c473acfec | |||
| 0de41e97ac | |||
| 0e52ab3f90 | |||
| 797679b42c | |||
| 1bc8b6f46e | |||
| f322b580ff | |||
| 2b2f33e3f5 | |||
| ce29cd2fad | |||
| 0d5843f44e | |||
| e36e8e3b33 | |||
| e251a1ca19 | |||
| 4aedb00e43 | |||
| 10a0469221 | |||
| d3419acada | |||
| 65ea4117ca | |||
| 8b0101dcab | |||
| 188f67cfca | |||
| a89f4bd4b8 | |||
| 053c9dc0e1 | |||
| 493d9f1b9d | |||
| e28793f128 | |||
| ea2bddf245 | |||
| 763b3c05af | |||
| 473cfb54be | |||
| a7fd742c17 | |||
| b66ba140cb | |||
| 242f606a29 | |||
| 60a1214d7e | |||
| 189ab8c8e8 | |||
| 3765ca4e92 | |||
| df87d76070 | |||
| 8fbf0b406b | |||
| 633073803f | |||
| 104da198d3 | |||
| b3121e4534 | |||
| 3bb654cc85 | |||
| d2830db94d | |||
| ad6914b938 | |||
| 57ba965b93 | |||
| 544ec21fc2 | |||
| 1bb0fa1809 | |||
| ffa0efc898 | |||
| af6b4b8c27 | |||
| 3f7c1f966b | |||
| 535515f296 | |||
| 7af6c4b10e | |||
| 2076bef95b | |||
| 48ce1f1814 | |||
| 5151c8a505 | |||
| 44248f19b5 | |||
| 8d433f2580 | |||
| 272fe5488c | |||
| c97765de14 | |||
| 7acf150ac5 | |||
| 077bbdfc78 | |||
| 2fb38ce13a | |||
| 22dc183f25 | |||
| 3c492c3fc7 | |||
| d71db2978e | |||
| e4723e0bad | |||
| dc56c4e530 | |||
| 9579a51a8b | |||
| 71f897ebf5 | |||
| 09d9f71ae9 | |||
| c678ccdfb1 | |||
| bbbebe343b | |||
| 033cb4f0c2 | |||
| d750034b79 | |||
| a2063f0628 | |||
| acf2f2ffc4 | |||
| d14f484c4b | |||
| 695e515a65 | |||
| 61089feee7 | |||
| ddc9b10cd3 | |||
| f95c92b431 | |||
| eba65a94e6 | |||
| c28a0c6bb8 | |||
| d6bacd9b47 | |||
| 70b1657323 | |||
| 1ef08bd169 | |||
| da68cc6a78 | |||
| 45c75d42ad | |||
| d4e55af2c2 | |||
| 48791a329d | |||
| 9b26ebed75 | |||
| e2160fb6c9 | |||
| 345a1c64f9 | |||
| 7ad1e7756b | |||
| 90caf19e9e | |||
| 8d0b3b7d44 | |||
| 4c253d68d4 | |||
| 73d1b331f1 | |||
| af2fddfd6d | |||
| 3e065ead65 | |||
| 3774704326 | |||
| 4a1100b6a4 | |||
| 63dec77ed6 | |||
| 1d3a66f890 | |||
| c1da92ca22 | |||
| 13475002d7 | |||
| 5bb6f246ed | |||
| 89df7451ef | |||
| 1334d544f7 | |||
| 3fefaa7362 | |||
| 15d62f7b96 | |||
| 83e0aaa511 | |||
| ee06ce1148 | |||
| 16d6124bb4 | |||
| 1197beaa13 | |||
| 98b428a8be | |||
| 17f47d3c0a | |||
| a9cc3b2a89 | |||
| 199102c106 | |||
| c7d76fb7ab | |||
| ba9b86c0dc | |||
| 5de83a606e | |||
| 01a0c8672d | |||
| fa522c0ffc | |||
| 16241d010f | |||
| 9cb8fbf178 | |||
| bd7ef27628 | |||
| 42e520e841 | |||
| d8f9cd237f | |||
| 33065ecf04 | |||
| 718a1da262 | |||
| b89c3ebb42 | |||
| 9d7e44feff | |||
| e48a60a4f0 | |||
| 163e1907a4 | |||
| ac1ccaa246 | |||
| 53b45279ad | |||
| f80daf5de1 | |||
| 298ea1f0d3 | |||
| 1d13d8c4a0 | |||
| 2238c99b61 | |||
| 7d4dfbef2b | |||
| 759827b404 | |||
| fca627d1b0 | |||
| 404da18aed | |||
| 330fca722a | |||
| 8939cd120b | |||
| 63afeb7373 | |||
| 6ba68a6455 | |||
| 1579c74302 | |||
| 373ca15c71 | |||
| a8a3caed1c | |||
| cb35ba4543 | |||
| cdd152d015 | |||
| 83ce7dc62f | |||
| b182b50f24 | |||
| 71a9941b84 | |||
| c777da263e | |||
| 2cb7b56a41 | |||
| 52f9ef14b9 | |||
| 8d6c594240 | |||
| 7ad77ff540 | |||
| acede72e9b | |||
| 771fd732d1 | |||
| 2a79a69f59 | |||
| 8c0321697f | |||
| 0151b3f9b3 | |||
| 82a51f35ea | |||
| 35944cbfc1 | |||
| f0aef9b28b | |||
| ae37c3902c | |||
| d612585582 | |||
| 7ca14d209c | |||
| c37f582c10 | |||
| 6272fb3822 | |||
| 2582fbac59 | |||
| 5abb578e47 | |||
| 015ebf89a5 | |||
| c6724968f1 | |||
| 9fa1772ae4 | |||
| 4551937812 | |||
| 51ee664cae | |||
| fb611a98f9 | |||
| a3d5face38 | |||
| 424cd497d3 | |||
| d46eeffaaf | |||
| 6520f2061e | |||
| 5d93f86b4b | |||
| b3f63ce7ae | |||
| 56de770682 | |||
| 940341bc9d | |||
| 804a0ce601 | |||
| 41054a4c56 | |||
| 7b8e5d4180 | |||
| ca2369f1c1 | |||
| 129cb0b3cd | |||
| 632b2ae1ba | |||
| 18e55061e1 | |||
| e49b65723f | |||
| 8e52894763 | |||
| 07cba6c774 | |||
| 9cb639b505 | |||
| 4cf6eeeee2 | |||
| c0f692792f | |||
| bd77e0945b | |||
| f0eb171b2a | |||
| fb93662b5c | |||
| a26c982e93 | |||
| 7db3e98944 | |||
| 4a87834e04 | |||
| bf6ecaeeb9 | |||
| f70ef86dfa | |||
| cd3132667a | |||
| 1c459a7bea | |||
| 4f0bfeab4c | |||
| c5c9921b59 | |||
| 6b63aba1fc | |||
| 382331fb11 | |||
| caf9af7ae4 | |||
| 45d2adeb9c | |||
| 96708d7592 | |||
| 13090d1219 | |||
| 8ab229cca9 | |||
| 583cd078dc | |||
| aa2ac1bbb8 | |||
| 928b426672 | |||
| 6766b14415 | |||
| 9d0f9e967f | |||
| d7609088e5 | |||
| b2643b6926 | |||
| 07b65ca069 | |||
| 25727f7f99 | |||
| 880ae89307 | |||
| 1496df1989 | |||
| 7d8ae6b4b1 | |||
| 312d4cccaf | |||
| ce5f9f95ea | |||
| d9bf8a76d9 | |||
| f7a35fb9fe | |||
| 3ba691ded5 | |||
| 7a7277d56f | |||
| 76be5dd1d3 | |||
| 53dc63f3bc | |||
| 80da0bc9d5 | |||
| bce7af4e11 | |||
| 9da09b51ed | |||
| 86392f197f | |||
| 1c13046297 | |||
| fbc756b531 | |||
| 6c64b06453 | |||
| 241834029a | |||
| 5b8a9c0b47 | |||
| 037c29d24a | |||
| 893f26ac9a | |||
| d43f8e3100 | |||
| 2b42acf7b8 | |||
| f65b80ed42 | |||
| e84abbdc82 | |||
| 66269eabe9 | |||
| 36c0928483 | |||
| 9237e15adc | |||
| 0d3a2072b2 | |||
| aa2ee5dfc2 | |||
| b515fa39ec | |||
| 76e3f4eb92 | |||
| 4959e5c6c2 | |||
| 7082594bbc | |||
| 36dd35f238 | |||
| 9c9fb6a485 | |||
| 5438a4837b | |||
| 84996e8cb6 | |||
| 87a368a857 | |||
| 21412d93dd | |||
| 0b11ff22b4 | |||
| 8fafa78796 | |||
| c43158f8a2 | |||
| 92ad524947 | |||
| b362a61863 | |||
| 468fec38d7 | |||
| 89830a5ae0 | |||
| 5977c296bd | |||
| 47d5792d97 | |||
| 25d706a913 | |||
| 048236aaaa | |||
| d442c58fd1 | |||
| f890f6bb09 | |||
| 036d466790 | |||
| dee47ba2d8 | |||
| be96c28b77 | |||
| ad1c0f578e | |||
| c8f7b1b72c | |||
| c89702ae84 | |||
| 2d29a82250 | |||
| b36c65e654 | |||
| 09b072b908 | |||
| 0ae9fee350 | |||
| 1579182ed9 | |||
| 074671aa71 | |||
| 36b7c47247 | |||
| 424d5b3025 | |||
| 8a5d352733 | |||
| f383629282 | |||
| a6d717cb04 | |||
| 84a5753301 | |||
| 5d2d9c7e81 | |||
| 82801d1411 | |||
| 340c3963d8 | |||
| ef15cf9847 | |||
| 4d613ccfa7 | |||
| 43ce34d547 | |||
| eda074cd80 | |||
| a2396d82f6 | |||
| a38721db93 | |||
| a06e811717 | |||
| 86e534ff75 | |||
| 640d5b2dec | |||
| 57e9b27085 | |||
| c56eefc739 | |||
| cf28306997 | |||
| 10acf3ddd1 | |||
| fed3ed9f9a | |||
| 260138ba11 | |||
| 67f7e0089c | |||
| d4a22c7851 | |||
| 06cf986490 | |||
| adf9aa04ce | |||
| 69f66fbe52 | |||
| d061005c89 | |||
| f6ee8b9f04 | |||
| 31af22c2ff | |||
| c421e3f243 | |||
| 6e92902407 | |||
| 6256381dc3 | |||
| b247b051ea | |||
| afbd553622 | |||
| 36bc14e884 | |||
| 9c5d0ff2ff | |||
| cfa6c8ddf6 | |||
| 21924bf022 | |||
| eea33f6019 | |||
| 66d48ae808 | |||
| de9b9fd0b1 | |||
| ece7384be4 | |||
| 0c052e4506 | |||
| 1996a0a3d6 | |||
| 679ad9b8c6 | |||
| d4983731e7 | |||
| 4fec3c8f34 | |||
| 836fd2565f | |||
| 54618064a1 | |||
| 519e3e01ae | |||
| aec8f81358 | |||
| c1d6bf4366 | |||
| 9bf2b79d9e | |||
| 4d98408995 | |||
| 7b466388f9 | |||
| b926fb3c66 | |||
| 6c8d5c0d0e | |||
| 5a1d234260 | |||
| fd6d42c297 | |||
| 7310ad6e92 | |||
| 7e47b1348d | |||
| 1e3555a6b7 | |||
| 9a67ce5968 | |||
| 279d7955f8 | |||
| db977c0bf5 | |||
| ba6bc59818 | |||
| 6e8be0578c | |||
| 92f7d16b5e | |||
| 40bb3c2f5e | |||
| 56a6096221 | |||
| ee37b42a91 | |||
| 0806e61df4 | |||
| 279ffeeefa | |||
| 80c5ee2479 | |||
| 16208544e5 | |||
| 6afeb24fdb | |||
| e6357b81eb | |||
| dfc2efe8a6 | |||
| f28b96f431 | |||
| a10293f8f7 | |||
| b1f02f91d7 | |||
| e76fa45d86 | |||
| 06f43892a5 | |||
| a094332b0d | |||
| 7b8779f534 | |||
| 371bf20d19 | |||
| 0f633ddd15 | |||
| 7886ca7f5f | |||
| 9b4c11954d | |||
| a1b724f30a | |||
| 7c3b2fb9cc | |||
| acef68d67e | |||
| 7e393d5f1e | |||
| 955c31b165 | |||
| e307cd48ad | |||
| 25f8b9e451 | |||
| e8ba14a2c1 | |||
| 9670d3341c | |||
| cec9778fd5 | |||
| 7451db4a68 | |||
| e31777ec53 | |||
| 7aa0b3dc7a | |||
| e7b2d5dc01 | |||
| 47d728667d | |||
| e1f8989d54 | |||
| 1d8cb47830 | |||
| faaa7c37a9 | |||
| 0aff9d8df4 | |||
| 30c3f8c1ac | |||
| bcd2469e01 | |||
| 983c6ae73d | |||
| 6d8e1fe776 | |||
| 99b4921309 | |||
| 3c231c3c9e | |||
| 175c0a6236 | |||
| 0031ceb06c | |||
| e3cc5a63df | |||
| 3cb61402c2 | |||
| 5336c51199 | |||
| 52aa658aaa | |||
| d08a51d7e4 | |||
| d97a557ac3 | |||
| 8a68d9cded | |||
| b031f7e902 | |||
| 963ffecb96 | |||
| 8f8aaca818 | |||
| 801f92b7e7 | |||
| 44db45700e | |||
| 25902005f6 | |||
| ffec71e0d8 | |||
| 99a208110b | |||
| e56799c993 | |||
| 957eb300f8 | |||
| 626025d539 | |||
| 9e8a0a020f | |||
| 40f592eade | |||
| 5e899f0be4 | |||
| f2748284b1 | |||
| a15ce00934 | |||
| 9e3e80261b | |||
| c72c685434 | |||
| 0177a8d277 | |||
| b6a9b0a4c9 | |||
| f4f8bd8d42 | |||
| 6e4aeffc0c | |||
| dba256d384 | |||
| 910008e9e7 | |||
| 8cb9545c41 | |||
| 59c16da6fb | |||
| 630df5bbd2 | |||
| f550111400 | |||
| 77377195aa | |||
| 7e2e72bd40 | |||
| aa7a13bd02 | |||
| 5895058a17 | |||
| ffb60d5149 | |||
| 1e2cb279b0 | |||
| e7f766f5ba | |||
| 8de5aa9409 | |||
| bf28a4df49 | |||
| fe1a0ab371 | |||
| 01daccfaf7 | |||
| 94e861e298 | |||
| d36af2ed5c | |||
| 7104b33214 | |||
| 32998e5377 | |||
| af0c9ef092 | |||
| 3bc3b3d10e | |||
| f03f42ca4d | |||
| 79783abeb1 | |||
| 895b0bd602 | |||
| 2ee5ee92f8 | |||
| 3e619423b1 | |||
| b524e18bdf | |||
| 6aa4579db8 | |||
| 17fb86c0f1 | |||
| 62ecfe4873 | |||
| 04e55e6b9a | |||
| f432aa1090 | |||
| 7add104313 | |||
| 36de249066 | |||
| b7a54dcffd | |||
| 6bb28deab2 | |||
| 7f88d15c86 | |||
| 94c5014e23 | |||
| c5a8256500 | |||
| 5f39884bf7 | |||
| d96825a242 | |||
| 443a938091 | |||
| 6bc3197721 | |||
| 269cc91fd5 | |||
| c1ddea479d | |||
| 5f3a95962c | |||
| ee1a8e6a32 | |||
| eeae73296e | |||
| 4ca8357af4 | |||
| 8a5b8c87fb | |||
| 6ab04d7bbc | |||
| a5a1380636 | |||
| eeab1aef64 | |||
| 4e1c342e55 | |||
| d8ed259bce | |||
| 9f6cb5de4c | |||
| ba634118d7 | |||
| 63da091d36 | |||
| ad0dc88a33 | |||
| 147acf4b57 | |||
| 5085f3a15e | |||
| 22a95ad8ea | |||
| df4bd6a60c | |||
| 813e7b05e4 | |||
| ab8b486b4a | |||
| 590f666ec9 | |||
| 9adaee915b | |||
| bce0f06fe9 | |||
| 856ecb84a0 | |||
| 90ddc06c98 | |||
| 405abc4e95 | |||
| 549c59ecf5 | |||
| 0a485eafcb | |||
| e0c11956a6 | |||
| da6a9bf3eb | |||
| dacd11e1cc | |||
| fc854b4c77 | |||
| 4dcc1f0374 | |||
| fc57390242 | |||
| bd15ef0a0c | |||
| 967ecafc33 | |||
| 29576da985 | |||
| 200a2556ef | |||
| ae0ab5025e | |||
| aa74276b25 | |||
| b03112a5dd | |||
| a3f49df62d | |||
| aa2af3f6dd | |||
| 20dcbc593c | |||
| 472ba8c1fd | |||
| d8345a44a4 | |||
| a187cb6c9c | |||
| b89c0b35d1 | |||
| 7ffcc0a5e7 | |||
| bde43fbdfb | |||
| 3728b2208f | |||
| dc52a756ee | |||
| 98dc886841 | |||
| d0cf104e43 | |||
| d7ed2412f6 | |||
| 7d38f0e234 | |||
| 3e8d072d24 | |||
| 84ac771893 | |||
| 3a9e0b5be6 | |||
| 9694ff433f | |||
| 2e82e78b98 | |||
| aaef4bee27 | |||
| 4ca8569488 | |||
| 8377ada3e0 | |||
| 8a034d59ed | |||
| 8e492d8798 | |||
| 7974ef80d7 | |||
| 3664d86430 | |||
| 9adef80d6b | |||
| be57adaee7 | |||
| d117e442a4 | |||
| 8820bc0796 | |||
| 57a64de023 | |||
| 5ed689ceb0 | |||
| 25f1765f36 | |||
| 063bd58802 | |||
| 901c6b34fa | |||
| 5b2d6488a2 | |||
| f6f35415d1 | |||
| 6c6069e963 | |||
| 6219d82560 | |||
| 1dcd7a16ab | |||
| b60caeb9dd | |||
| 4c4768aaf3 | |||
| 2f4ac0a663 | |||
| 23a446f852 | |||
| ec48334a1a | |||
| f4c061d412 | |||
| 31a076d7b3 | |||
| 6bd43d986c | |||
| dd32a2f15a | |||
| c88c20820f | |||
| 86de510731 | |||
| 0b31fbf827 | |||
| 34ad1450eb | |||
| e6ba71390d | |||
| f0c8dbe0ec | |||
| bf046a8ccb | |||
| b05ba7683e | |||
| aedf8dad15 | |||
| 74ebb7c722 | |||
| 1307f66494 | |||
| 448a24cb36 | |||
| 7266f23450 | |||
| c0ad31acfc | |||
| 25d3a0de27 | |||
| 1e38bbfbc1 | |||
| 1c62e95812 | |||
| d453cc27a3 | |||
| 2c3e841d8a | |||
| 50668c462f | |||
| 8d1192e832 | |||
| 4a8e2e9ed4 | |||
| 12fc45220a | |||
| 6bce68fbe7 | |||
| d54f947c98 | |||
| 6c8bb3a22e | |||
| ed29ce5183 | |||
| a51d269b7c | |||
| 8283e4e6d6 | |||
| 23ce91eb55 | |||
| 545ac7fcfa | |||
| 3926ccccad | |||
| f431307ef2 | |||
| ca368e0f9b | |||
| 8afeb56c11 | |||
| 2a6f90c5f3 | |||
| 271031128e | |||
| b991f954d0 | |||
| f12bb3f80d | |||
| 6dc978e8d8 | |||
| 9f05a873bc | |||
| 703d498772 | |||
| ed3b9543bb | |||
| fc7efba7d8 | |||
| b3178fe8f4 | |||
| e36798a993 | |||
| a143605465 | |||
| d3ad35b21e | |||
| 68134941bf | |||
| 54d0fef559 | |||
| 7f9c47176a | |||
| 9060ac7897 | |||
| d9073e4a17 | |||
| de1c1d7cc2 | |||
| 6ff1bd5917 | |||
| a6b04f426e | |||
| fa49dbe2cb | |||
| 682eb04a52 | |||
| 77064fb09e | |||
| be8d93563a | |||
| d4a6a5216d | |||
| 1cb1427050 | |||
| e4f4eace1c | |||
| 30a98b7e8c | |||
| d36c8d95ad | |||
| 506bd0abcf | |||
| 8dd810c41d | |||
| d9d0dc5201 | |||
| 72880d9e03 | |||
| 6c7ec6eb1b | |||
| 705fc5d116 | |||
| d20b575b9b | |||
| c949beab9c | |||
| 3fb857c435 | |||
| 0a4f999ade | |||
| f0b7147881 | |||
| b36a42cd0a | |||
| 000309b47f | |||
| 5cb12988f0 | |||
| 50c4b749ec | |||
| 5db2734e6f | |||
| e9e5507483 | |||
| d63dc7adfb | |||
| 27db44a8db | |||
| 1a035e2866 | |||
| 887aa20116 | |||
| 5e03d86695 | |||
| 95075aa28e | |||
| 0260f0790a | |||
| 34d65ba292 | |||
| 27a77a15ed | |||
| 76025bfae1 | |||
| 4957faf482 | |||
| 0d8e16d5c8 | |||
| 07baed1581 | |||
| eab5da075a | |||
| 0d1bbb19ce | |||
| 58d6cbc6ac | |||
| 4d3b627839 | |||
| 49455c99ad | |||
| 31bb6bedbd | |||
| 8d54678ea1 | |||
| 590767c299 | |||
| ec1bd342b8 | |||
| b031c9e7f6 | |||
| ea0dfe83b7 | |||
| bdd90f2c57 | |||
| 288dac5d70 | |||
| 9d22e1c35e | |||
| ace2359e7b | |||
| 617e6510a5 | |||
| 26024770b8 | |||
| d556f58e34 | |||
| b6f302dfc0 | |||
| 8e9b5f14af | |||
| 3635c00143 | |||
| abc71baaa6 | |||
| 959aaebede | |||
| d17f8c5049 | |||
| 42a7201a70 | |||
| 1f1744a49a | |||
| fd7dbe5bd9 | |||
| 984549400d | |||
| cf0c49277e | |||
| 16c3f9fa9c | |||
| 2f2539cf34 | |||
| e66823d017 | |||
| 881c32a3df | |||
| ea0a361c35 | |||
| dc60f8bb7b | |||
| 9e92c9ea12 | |||
| a503a54240 | |||
| 265957712a | |||
| c26962bb71 | |||
| a428eddf93 | |||
| dc4f7eb2f9 | |||
| d54ac1ba91 | |||
| a3d46b18ac | |||
| e81dd05666 | |||
| 29394935e3 | |||
| df8acc4ed7 | |||
| 81928d4ab1 | |||
| 3ebf93e03d | |||
| 59e4032f1f | |||
| 8f15777427 | |||
| 748c4bf780 | |||
| befcf6d2b3 | |||
| 48236ecd3c | |||
| f340f84de7 | |||
| 40e19293f9 | |||
| f252f824a4 | |||
| 1d7e5a8130 | |||
| cb2ff92c2f | |||
| ef373ab54f | |||
| 9141a78c29 | |||
| 10a6370738 | |||
| 573009eeb6 | |||
| c3363712d9 | |||
| faa33d89a2 | |||
| f347458c53 | |||
| 530e6d9196 | |||
| b398e18e12 | |||
| 747e8370e0 | |||
| 2c67875781 | |||
| c96e8a8c19 | |||
| 5f203fc082 | |||
| b943c9b471 | |||
| 1a90a1daa8 | |||
| 72dfc743fd | |||
| 465307655b | |||
| 6ce71e6694 | |||
| 7f01b3b92a | |||
| 76950d56b9 | |||
| c11e0d02b3 | |||
| 4c798c1718 | |||
| 450d7e9ad4 | |||
| b8ab79c83e | |||
| 6934bdd533 | |||
| 84dedb73a5 | |||
| 8964aa5221 | |||
| 3481ae236c | |||
| 46adc5f8a4 | |||
| 5296df5899 | |||
| 13dad4be16 | |||
| b5d0c343b4 | |||
| b00b945264 | |||
| 3bda09e105 | |||
| 32d32c4e4a | |||
| 497441b54e | |||
| 9c564fd4c7 | |||
| 0c2263d0e9 | |||
| 3d4d30766d | |||
| 99d84d44fc | |||
| 41ba7077ad | |||
| 8a929a91c3 | |||
| 0604f06841 | |||
| 229924adf9 | |||
| df988b7c69 | |||
| e8106e2e34 | |||
| c21d3e24f8 | |||
| 2d87aa0753 | |||
| b2ad4dc9a0 | |||
| 370f2ea98f | |||
| a05ca565ff | |||
| 52255637f2 | |||
| 0fcaa3a2f5 | |||
| 0e2fa6eb9d | |||
| 1aac462c83 | |||
| 2a0edfd8f7 | |||
| 1f59a9f846 | |||
| 80c20a90ea | |||
| 56a35649fe | |||
| f07cea0b79 | |||
| 4c1b08a281 | |||
| 117f9eddcd | |||
| 7bbbfce482 | |||
| f37a7811f9 | |||
| 9173c10239 | |||
| 318b31550d | |||
| c18ebc63a6 | |||
| d704694272 | |||
| 1cfec3bdf7 | |||
| fe6ea6bc10 | |||
| d29c8df45e | |||
| 71f996af95 | |||
| d9722ad6b3 | |||
| 398fd8028c | |||
| 1345a3cfd3 | |||
| 7eb0b195b8 | |||
| 009caee82d | |||
| 3bdc805a22 | |||
| ac457792b4 | |||
| 1377b54b9e | |||
| 66418ffc8c | |||
| b4c4b1fb70 | |||
| ffe4a4b047 | |||
| 753ce45310 | |||
| fece0d73e7 | |||
| edce076e68 | |||
| 675d0a009a | |||
| 5d41b5a4db | |||
| fe53b135eb | |||
| 5b1c154ee2 | |||
| 816d882611 | |||
| 12bcb09051 | |||
| c59c69a85f | |||
| bdd0daaf6f | |||
| cfad7c8356 | |||
| b2b8a128d0 | |||
| 1cfad80ca2 | |||
| a5a80e41b8 | |||
| 152f8e92bf | |||
| 0323560b49 | |||
| d3bc84a2f7 | |||
| 8a82c259bd | |||
| 46009c7658 | |||
| 6f760308bd | |||
| c346f8f17d | |||
| af1d059fff | |||
| 5562b21a20 | |||
| 8f68f31877 | |||
| ce7e94030c | |||
| ccf5a1b972 | |||
| 0d5ae77efc | |||
| 1695096d18 | |||
| 6db0b7cf18 | |||
| 575b43b0d4 | |||
| 7b39b05894 | |||
| 8bea9e0a5e | |||
| 2255b32e45 | |||
| b62573ae8f | |||
| 44ed84f5cf | |||
| d008c834be | |||
| 2d3a914aee | |||
| 7324f4c3d1 | |||
| 50c8860a50 | |||
| 6456de7188 | |||
| 23c629f2aa | |||
| 2bf154f74f | |||
| b598ad1bc0 | |||
| ace24ad68e | |||
| 750c1a0f27 | |||
| 52d89bd66b | |||
| 8cfb9d35e9 | |||
| 2f529158a0 | |||
| 6e68ab6d9e | |||
| 7a3c55af35 | |||
| fb39d6304a | |||
| 4cb57d9059 | |||
| 42d69bd0e5 | |||
| f27b399f81 | |||
| a545a3938f | |||
| d1e352c9ee | |||
| 99be1e798b | |||
| 2132a28a17 | |||
| 8b1cc28783 | |||
| 78364ac830 | |||
| 6e5f5732b5 | |||
| 87844254d1 | |||
| 08ef9f69fb | |||
| 5fbd1b78e7 | |||
| 39f5eb753f | |||
| f4cbe3f300 | |||
| 70632e5541 | |||
| 0bba700105 | |||
| b71aaccff3 | |||
| 7271ae9611 | |||
| 6e32dff2ad | |||
| 8f7c898c08 | |||
| f4a9815f48 | |||
| 0f8d5c7e98 | |||
| 5e83596a1b | |||
| 6361213e07 | |||
| 9c59a5d9b6 | |||
| bb04844bd5 | |||
| 0b988176fa | |||
| a354f18a2d | |||
| a7ca0fec88 | |||
| 06eec508df | |||
| 10dc580a3a | |||
| 2f6ae3ef01 | |||
| 392e803905 | |||
| 83a5fb585b | |||
| c6205ffbe0 | |||
| c04737ce20 | |||
| 11b92172fe | |||
| 3a6c574376 | |||
| b21ce925fb | |||
| de9dcc4ed6 | |||
| 9e77dbfe20 | |||
| 4cee0676a4 | |||
| 8ad9d21db3 | |||
| 8ba8317eea | |||
| d221187f24 | |||
| db54ec294f | |||
| 1d39796e3f | |||
| cd6a318903 | |||
| 73090b98ab | |||
| 745de1abab | |||
| 961031efc1 | |||
| 2487595778 | |||
| 5c4863d504 | |||
| 5e3a658932 | |||
| cb4704c821 | |||
| cc0b7d1492 | |||
| f8ebbf8b08 | |||
| 8795f60bf1 | |||
| f00c0a9436 | |||
| 767bc71870 | |||
| 4c068e3e00 | |||
| 277d862172 | |||
| dbed6a47bb | |||
| 94f3749784 | |||
| 728e6d851e | |||
| 11e863545f | |||
| dde49f0bb4 | |||
| a37a75aecc | |||
| e43e3aeb1c | |||
| a8fe529814 | |||
| d9f5e2bb08 | |||
| dfa83b0ac8 | |||
| bd5cef1411 | |||
| cd70b48831 | |||
| 50ebf8088a | |||
| c5cfb7eb40 | |||
| bccaafda6d | |||
| bf0086d7b5 | |||
| 7e65938ca6 | |||
| 112eff2509 | |||
| d7837d9179 | |||
| 6cdd057f80 | |||
| 5a03b213fb | |||
| f270213246 | |||
| 2e1795c5ba | |||
| 732d6710d3 | |||
| edf384d2ee | |||
| c307640826 | |||
| a77b598f82 | |||
| 217420cfa5 | |||
| f2b9dff596 | |||
| ae945ed315 | |||
| 770c153c76 | |||
| 29c4a7e606 | |||
| 8875470b37 | |||
| 6e52364bcb | |||
| 7015d616b4 | |||
| 92e6da3260 | |||
| 9220b6f1d5 | |||
| 1d0d538d0c | |||
| 83052eafae | |||
| fa95c3c4a2 | |||
| 665dcf221b | |||
| 8f73dbd253 | |||
| 826312cbad | |||
| 72a18f2b3f | |||
| a6b5e3d0ae | |||
| 1b321f4fa3 | |||
| fbde0b9f35 | |||
| 0e5f5e54cc | |||
| cbb5902066 | |||
| 92ec1b0598 | |||
| a62fc3abff | |||
| 08f8e55446 | |||
| 68f54a3247 | |||
| 29c099fe56 | |||
| 76b81c7b35 | |||
| d6b33ffd6b | |||
| 16b9873fa8 | |||
| ba4a686d1c | |||
| 4be3d79e12 | |||
| 2569b09dbe | |||
| 5d71e69941 | |||
| 16163bf20b | |||
| f1a97fecbd | |||
| a050f82f0e | |||
| ef7beea334 | |||
| 3f4acb33f9 | |||
| 14822e6395 | |||
| e82db4ed38 | |||
| 87b7ea9cf3 | |||
| 787b1fceff | |||
| 140d6ad839 | |||
| 46e8e22236 | |||
| c386db2b33 | |||
| 8dad091c6b | |||
| 3365ccbb9c | |||
| 2ced230965 | |||
| 989d10a3e1 | |||
| 62d8c69774 | |||
| cf704257b0 | |||
| a6cb6f57d3 | |||
| 141c703ed5 | |||
| 796d58867b | |||
| 2f483ec8e8 | |||
| e338918773 | |||
| d9effc58cf | |||
| 05d03f97fc | |||
| 03e891c0e8 | |||
| 4dfe9d52e9 | |||
| 9e65692b69 | |||
| 0687c9a57a | |||
| ffe1287016 | |||
| 75b7e7260f | |||
| d631e081bc | |||
| db5843d904 | |||
| 5ec16153f7 | |||
| 8c873ccdc8 | |||
| c95088f8d5 | |||
| 519fa55df7 | |||
| b8dda033ed | |||
| 0359e9c5c7 | |||
| d822b4a62a | |||
| d9e8c953b1 | |||
| 9eca502026 | |||
| cd0efe3edb | |||
| 8146e9cbcd | |||
| 5d95275024 | |||
| 49a97eea4b | |||
| 36e9c27e9c | |||
| 6e5153cd07 | |||
| c73da864c8 | |||
| 071bb75700 | |||
| 99374de340 | |||
| db7ae4ed5d | |||
| e61f481881 | |||
| 396a3ad2fc | |||
| be235ddc38 | |||
| 9e72ecd93d | |||
| 8e0bd936eb | |||
| 9d0270dcd6 | |||
| 713415c354 | |||
| 786550572e | |||
| 46caeddc81 | |||
| 71bfde2bfe | |||
| 76771b845a | |||
| a74e239e28 | |||
| 6e763b0b42 | |||
| 2f41ece017 | |||
| 01cd5fe0d5 | |||
| ed12ff7bb3 | |||
| f1386bb60d | |||
| 417bd06e76 | |||
| 91e46e3cf8 | |||
| deb5139c4d | |||
| 862ac5d014 | |||
| 028235d421 | |||
| 143d399849 | |||
| 375f171e47 | |||
| 387edcf4b2 | |||
| 011cd37cfb | |||
| 0d4254f319 | |||
| 4c407c2850 | |||
| 829e2d6c5d | |||
| a31c4bd474 | |||
| 17f24dc377 | |||
| de3e9f2809 | |||
| 4442a282e1 | |||
| 261010f23d | |||
| ede44ca6ee | |||
| 452a953234 | |||
| 2b122562ad | |||
| 6891bc3da3 | |||
| b31b8cd7f0 | |||
| e1379ac5ce | |||
| 0ef3f75d7a | |||
| 407a9e5be0 | |||
| 892bb9bf30 | |||
| 47ac871a12 | |||
| a38c3e7f6d | |||
| 08818355d1 | |||
| 0a68afef00 | |||
| 2c0783e327 | |||
| c2e5e45c84 | |||
| 014236c861 | |||
| 610fd7561b | |||
| d6f4480a4f | |||
| 28a6ac09ad | |||
| 86e4d24476 | |||
| 913a697ab2 | |||
| ebef2b1e44 | |||
| a61457b422 | |||
| 8f7f1135df | |||
| 89612c10c9 | |||
| d55bfb32f1 | |||
| d2b72cf496 | |||
| 8d90fffd46 | |||
| b84af27a86 | |||
| b45f28f3e9 | |||
| bfa1b5656a | |||
| 47f946cd65 | |||
| 970e7bfcda | |||
| a81c7a7cd6 | |||
| b0e1bd239f | |||
| 53ca41717a | |||
| 6a5bee0cdd | |||
| fd3ae51f83 | |||
| 5e5954a808 | |||
| add8540909 | |||
| 06a302aed0 | |||
| 147432d38d | |||
| 2a003ff72b | |||
| 8660d3324d | |||
| 6c59b73ae5 | |||
| 80218c1eca | |||
| f24d96d59f | |||
| d14bd49f46 | |||
| 1a692a0873 | |||
| 631a1a4ddc | |||
| 57df7601d9 | |||
| f7650000aa | |||
| 6f93c2d9b2 | |||
| 1654764968 | |||
| 1a1b8416e2 | |||
| 36c66d52a6 | |||
| 68fe43d488 | |||
| 877b9ee23b | |||
| 80ff93beeb | |||
| b9ddd2812b | |||
| ba54b56de4 | |||
| 85be67bc2d | |||
| ae20e01d2c | |||
| d094e8c3fc | |||
| f009fe1f63 | |||
| 2007fe5f49 | |||
| 84989ffa04 | |||
| 31b629a19c | |||
| e762d9e274 | |||
| 6833267b19 | |||
| 05f2833388 | |||
| 0d026ef18d | |||
| b756d93891 | |||
| f54513586d | |||
| 6c519c237e | |||
| 4ffde4db98 | |||
| 41847d31e7 | |||
| 24ce25bb5c | |||
| e051b69e80 | |||
| 59283d1164 | |||
| 0de32a5edc | |||
| 4f80066dcb | |||
| 04ddc8003f | |||
| 3213f98d66 | |||
| 1f16f85c51 | |||
| c03cb3a11c | |||
| 62e29a6546 | |||
| 3574b065d6 | |||
| c0c47f41be | |||
| 37761d580f | |||
| e075c8e691 | |||
| 0c61ca1a6b | |||
| 1846fa1f54 | |||
| 579ce20cad | |||
| 12e4bcba5d | |||
| b4f57dee3b | |||
| f11673ae3f | |||
| a27af7dd7e | |||
| 2b26a3cc14 | |||
| 47c4849694 | |||
| 30a4adf331 | |||
| 117a721166 | |||
| 1a219e62ba | |||
| c8d54b324b | |||
| 0ac2971fc1 | |||
| 348a40201b | |||
| 9f20ddc800 | |||
| 6f1cc2c1e5 | |||
| 601cd95277 | |||
| 8e9ce59ef2 | |||
| d76ef8e3cf | |||
| c19ffafd8d | |||
| 996a99ad75 | |||
| affb926d44 | |||
| c506e534aa | |||
| 9994315070 | |||
| 4f0d89ef8b | |||
| aab984618d | |||
| 8b662bc6b5 | |||
| 03ce7a8db3 | |||
| 033e7928b5 | |||
| b095f2a158 | |||
| 196c0e0ebc | |||
| 8ab309630b | |||
| 42bac47a71 | |||
| 3bc4de2236 | |||
| a6e4b45a38 | |||
| 28e97ccaf2 | |||
| 255781c029 | |||
| 7f5635ea8c | |||
| 4f18ec726c | |||
| 263622d628 | |||
| 1dfd2443ac | |||
| 881bd53f60 | |||
| ec4404b1ba | |||
| badaeac81f | |||
| 618d5ddaff | |||
| 4ed74af868 | |||
| 123d9af7d0 | |||
| 4f17b30915 | |||
| 1fc265b0aa | |||
| afae9b8d17 | |||
| 481be44879 | |||
| b8530b0f0b | |||
| 69de79684f | |||
| 6e6fd057b5 | |||
| 4b0ebf2b80 | |||
| ee82c32119 | |||
| 3fe6731035 | |||
| 1c3f3b5705 | |||
| def1ccffc4 | |||
| fa2e531343 | |||
| 814ddbc6cc | |||
| 267e8dcfb6 | |||
| 49ec1561f8 | |||
| e2dc612153 | |||
| 8f225431fe | |||
| 194be5e0b7 | |||
| 6788a05dd1 | |||
| 6a7066ac2f | |||
| ec5ff4e973 | |||
| fe6d460531 | |||
| 9cb97af10f | |||
| 1c784eea3d | |||
| 59dd33a461 | |||
| 97ebd912dc | |||
| 742fcc060c | |||
| 3ad5cb8a23 | |||
| 0d1f12e31a | |||
| a8ddf8f66d | |||
| f7a9c0a248 | |||
| 190badb395 | |||
| 3d91ab6c31 | |||
| c15b8d71bc | |||
| 5a707dba8a | |||
| ffd2fcde6b | |||
| 8e4056c1e4 | |||
| 1554e2b135 | |||
| 4715cbb70d | |||
| fd1611079a | |||
| 8edc03df64 | |||
| 9f5c0af5b8 | |||
| 6d6eeba5d5 | |||
| 5dfb64ef71 | |||
| e5bda7add7 | |||
| 77f9b336bd | |||
| cf930d0dde | |||
| f01c94e8bc | |||
| 0d774527b4 | |||
| 58ba9496d0 | |||
| 1993e94e53 | |||
| 3bcc06ed09 | |||
| 2f6ce88e28 | |||
| cd1dec9fc7 | |||
| 05872d7650 | |||
| 1dcee2ffa2 | |||
| 5f622efb77 | |||
| 52e8326d54 | |||
| 436532bed7 | |||
| d15e789200 | |||
| 98942f5528 | |||
| c7c21dc122 | |||
| 4500c1d1a4 | |||
| b8b983dded | |||
| d6a6673971 | |||
| 0580fe8db8 | |||
| c727e24138 | |||
| b83698ebf5 | |||
| 3fbbaa5130 | |||
| 2f48b840ae | |||
| efdee11d5a | |||
| 4c87e11aeb | |||
| e881e008b8 | |||
| 1b2837915d | |||
| d076a6724f | |||
| 386af71c39 | |||
| 49f277192c | |||
| 5974a6276b | |||
| e06a390771 | |||
| b34e204676 | |||
| 755d990dfd | |||
| 7185358b98 | |||
| 3843ec1e02 | |||
| cfc5631d5d | |||
| e64555aca0 | |||
| ef52ebb529 | |||
| c98136ca4f | |||
| 65f44d24ca | |||
| 44f20782fd | |||
| 9b1d76a5d0 | |||
| 21b5074ce8 | |||
| 0b8825fecb | |||
| 3d3c20e507 | |||
| 67a282f19f | |||
| 92023b533a | |||
| c1d14c150e | |||
| aa656c74d5 | |||
| e39b7ffe30 | |||
| 1897148abc | |||
| b76118802a | |||
| 8266aa3343 | |||
| ab0c349261 | |||
| d5e0e66426 | |||
| c5b3107f83 | |||
| 1a0a64e4de | |||
| 6bd9805bcc | |||
| f74c2af65c | |||
| 9531bdf674 | |||
| 76e705e7ee | |||
| d35211328e | |||
| b7bbd81dda | |||
| 9836dd5d10 | |||
| 2109ad320d | |||
| c026121c0e | |||
| ee0c87f7b1 | |||
| 709fb93a22 | |||
| b38cd0a48d | |||
| 264435c32d | |||
| c285929ad3 | |||
| 1cbea8157d | |||
| 0a10334f1b | |||
| f0d5a6ebac | |||
| db7086b5e6 | |||
| 0e92280b33 | |||
| 0d7255158a | |||
| 33564b68dd | |||
| ba942b952a | |||
| bd7f28896e | |||
| 18fe124696 | |||
| ea3a3b6e1c | |||
| e6c06aacff | |||
| 1aee92cd5c | |||
| 40c4cad491 | |||
| 013d46fb02 | |||
| f0f465411f | |||
| 32ce83475d | |||
| ec0d3f5b5d | |||
| 75294b9146 | |||
| 26a0eb68ef | |||
| b983e29fb0 | |||
| 68dadabc29 | |||
| ed9fd3f0e0 | |||
| fa9573436a | |||
| 6d2058c3b7 | |||
| 0d7f93b877 | |||
| f022c9d510 | |||
| 5964a06386 | |||
| f14dc4a4e9 | |||
| fd56e2534c | |||
| 08962a74ab | |||
| f850d36c52 | |||
| c5fb161477 | |||
| bfc2fab33f | |||
| ec9d6c4fd2 | |||
| 6135d61e3d | |||
| a677242a2c | |||
| 6602f30112 | |||
| a4b8dc18c1 | |||
| c0d4741f88 | |||
| b33718180c | |||
| 3872393b29 | |||
| 1d72a7df99 | |||
| 5455908772 | |||
| 8882192fac | |||
| 7b77491c06 | |||
| 20bf214d6e | |||
| 8ab3e63aeb | |||
| 0dc03214c5 | |||
| 362e98b43d | |||
| 193e085cf0 | |||
| e0df2a342b | |||
| ba19ccac43 | |||
| d7261b7a78 | |||
| 0d80173efd | |||
| 930f07d15e | |||
| 66df7389d2 | |||
| c7bf0b6ddd | |||
| 0bc361adeb | |||
| 4fff523a6d | |||
| 67e09fb342 | |||
| c360806f47 | |||
| 7b74b73b08 | |||
| e9a851c0d4 | |||
| b13b169149 | |||
| 455329a745 | |||
| a68b76c8b4 | |||
| 96e3899216 | |||
| 771ab5ea9a | |||
| 3c87e6b270 | |||
| 6d8afec510 | |||
| 89e25657d8 | |||
| 29387f1fcf | |||
| 58e885c052 | |||
| 984dfcd7e1 | |||
| 3785479086 | |||
| 8ed280907c | |||
| d742671205 | |||
| 87e72c28a4 | |||
| 4dee357362 | |||
| 431f4b9b0d | |||
| dd5b7825d5 | |||
| 02bc48925a | |||
| 4eb505755e | |||
| 83e94a70ea | |||
| 8a150b27c3 | |||
| 1a51451ec2 | |||
| 41e51bfb77 | |||
| 7e1d9bc768 | |||
| ba065ec1d8 | |||
| fe057a91c8 | |||
| d2c36eefc9 | |||
| 28d56bab04 | |||
| 2500eff90d | |||
| 153446b3a1 | |||
| 391f5caaa2 | |||
| cc0df92444 | |||
| 03910d67c3 | |||
| fec5cc864e | |||
| cb78362713 | |||
| 4c5b1a6ff4 | |||
| 83c5727698 | |||
| 80838ff1e9 | |||
| 29e8d072b7 | |||
| d7592f01e1 | |||
| 392f283d9e | |||
| bcd738ebbb | |||
| 8020c52c48 | |||
| 3f566e541d | |||
| be4a631dc8 | |||
| 0bfdf908c1 | |||
| 6f2fc23f77 | |||
| f3a47c7e70 | |||
| 36349ffabb | |||
| b13f7366cf | |||
| 9181bcd9a7 | |||
| 7dbc1d894b | |||
| 5720445d15 | |||
| a90027521d | |||
| e02d400bf6 | |||
| efadb8fd31 | |||
| a19d06561b | |||
| 0b685d11c9 | |||
| 28f019d672 | |||
| bf5cbfffc2 | |||
| fe021e7c51 | |||
| c42fb54bc6 | |||
| 9382b68781 | |||
| 178198a417 | |||
| 7068e90771 | |||
| 1c762f23d0 | |||
| fd2b9a6e21 | |||
| db43910288 | |||
| f248c0460e | |||
| b8e3c0ceb4 | |||
| b5053d889e | |||
| 12ba7776b3 | |||
| 7817e88d03 | |||
| 8dec65853d | |||
| 88e3cb3be1 | |||
| fa702b48e3 | |||
| 299dcf6686 | |||
| 27f9ae5bbb | |||
| 9cb3a853f1 | |||
| 95c8ef4148 | |||
| a41bb52014 | |||
| 914cd7221e | |||
| 2dfc0a58ab | |||
| 0c9f3c638a | |||
| a966d6acf1 | |||
| 1e0c38b5f9 | |||
| d3323d6550 | |||
| ebed0b9f20 | |||
| f654a453dc | |||
| 10decf94cc | |||
| 96dd4817f1 | |||
| 72906cdc6a | |||
| fba4375be0 | |||
| 75120676ad | |||
| 7daf63fd3f | |||
| 014de25f6f | |||
| 3fc6535012 | |||
| 4fc0a32572 | |||
| dcc704a357 | |||
| bd8acbde97 | |||
| 112b10c19d | |||
| d89e561a85 | |||
| 49c1da79c8 | |||
| 0a72f00175 | |||
| 1af5820db0 | |||
| c117491549 | |||
| d8748f4270 | |||
| c0ba6e13e4 | |||
| c34daf1a35 | |||
| d461b53235 | |||
| c3ee14eb67 | |||
| 869fb8e327 | |||
| fbbc3024d6 | |||
| f1ba0c0aa7 | |||
| 54340ab4bf | |||
| 39732eee5e | |||
| a9e4526a6d | |||
| 57a6d2abf9 | |||
| d6246941ac | |||
| 2eb91f9b91 | |||
| 34ae413607 | |||
| ee9f8c184b | |||
| 7a84afcbdb | |||
| b8a16ea99d | |||
| 095466d5c7 | |||
| 89cfa22c3f | |||
| 1f18050930 | |||
| 537b78d564 | |||
| 717fd57ce1 | |||
| 3fb7786868 | |||
| 17ecfc9765 | |||
| 5326260a76 | |||
| e7522f4bdf | |||
| 504deeff42 | |||
| b7785b64cf | |||
| f914cb6858 | |||
| 91051d2521 | |||
| 51536a7acd | |||
| 263ccab6e3 | |||
| 9f87755dcb | |||
| 60b4cca5e5 | |||
| d2718e99a4 | |||
| 69a00c0ab3 | |||
| 3272d23917 | |||
| 7f0545cae7 | |||
| 68f35deb86 | |||
| c4f4035072 | |||
| a7d8845952 | |||
| a3378393b0 | |||
| 3dfe0ad478 | |||
| 9a3b7a4f3f | |||
| 78579b1103 | |||
| 7d50344512 | |||
| 7a00c12065 | |||
| af71e67681 | |||
| b3e20fc324 | |||
| bd1014abb6 | |||
| 7f76664a5d | |||
| 0a5a80b05d | |||
| 2d63da0660 | |||
| 8387527d2e | |||
| 5d03ba7d63 | |||
| 0ece50c122 | |||
| f2ac297252 | |||
| 0ca8ae17d4 | |||
| 88ca87cf9e | |||
| 0d69d228e4 | |||
| a3afe95306 | |||
| 9fb4af8658 | |||
| 9bb6ba9311 | |||
| faa42ba341 | |||
| 596827a912 | |||
| 89b4292445 | |||
| dd88737414 | |||
| 5456cfc304 | |||
| 1e66096ea7 | |||
| 2b6ae3908c | |||
| 1924612479 | |||
| 2af5bdeaab | |||
| b28565b38d | |||
| fec602362b | |||
| 6753c5f45a | |||
| 2f3c108d42 | |||
| ce6d99bdb4 | |||
| 86d4125893 | |||
| 3a18f00379 | |||
| e6274904a7 | |||
| 3677395444 | |||
| 22ba35b3b5 | |||
| 9c1ab9979b | |||
| eaa463e1c9 | |||
| 6984be48c3 | |||
| b739bd3d79 | |||
| 23f3e4396c | |||
| c264750924 | |||
| c155f0a5d5 | |||
| 76734f086d | |||
| 4f2d1172dd | |||
| 75caf4e297 | |||
| 509ab8261f | |||
| 1e05b40d4f | |||
| 451390f835 | |||
| 58cce9d2f8 | |||
| 2eb6e3b0ea | |||
| fb1181ed26 | |||
| 6d5e1d529d | |||
| 0e0ca08924 | |||
| 5d948a67a8 | |||
| 6a4db2ecab | |||
| f700273624 | |||
| 0c198e0ccc | |||
| 71ffbbc420 | |||
| 4fd09b889d | |||
| 4cb2a3eebe | |||
| c25186b1f6 | |||
| 779033d0bc | |||
| 3e31560e7d | |||
| d23d7e8775 | |||
| f6fdf5cb7f | |||
| 1879ccd27d | |||
| 08c0796719 | |||
| edc7994ce5 | |||
| bcfcfbd064 | |||
| 9e79b3258d | |||
| 243873cd2d | |||
| c7b8a4b0c1 | |||
| e39e0c7140 | |||
| d4a3f11dbb | |||
| 0962f266b3 | |||
| 69e4d3fdad | |||
| c0908f463a | |||
| b00a61a17b | |||
| 553c2f886a | |||
| 4fd9c5772a | |||
| 04e0e06d85 | |||
| 4d7829d72b | |||
| 6b751aac57 | |||
| 813349fd23 | |||
| 16a2744782 | |||
| 7b6870db22 | |||
| 3e38e7d52c | |||
| 8142d3474d | |||
| 8773649de6 | |||
| c117920ff9 | |||
| c8dd2a3eb8 | |||
| 90b1817e92 | |||
| d6c3ff5997 | |||
| 984ec25132 | |||
| a7bff34784 | |||
| a6e7afbc91 | |||
| 33f1d63b64 | |||
| f95e171e11 | |||
| c82b50b212 | |||
| 2b402b77f1 | |||
| adcb551020 | |||
| 2680aabe06 | |||
| d5c0533b74 | |||
| 609307668b | |||
| cdaf36572a | |||
| 033c8d5d51 | |||
| 6216ec1d6a | |||
| 6c9c67f6c5 | |||
| 5bd32b5521 | |||
| 549336f75b | |||
| f0e75f30b3 | |||
| 144c09f175 | |||
| ee50c0f97c | |||
| ade921bf02 | |||
| 676cacff04 | |||
| a3097d5e25 | |||
| fd78148558 | |||
| a4d79d7375 | |||
| df04e8183d | |||
| c43c484a62 | |||
| 0608c35669 | |||
| 7dd4d06e26 | |||
| 1ee0310b86 | |||
| cc0a52038f | |||
| 6aed1fe231 | |||
| 680608fe18 | |||
| ec6acbc602 | |||
| cb7ee4c5d2 | |||
| 88d5798f45 | |||
| fcc22a0aa3 | |||
| aabefff298 | |||
| ed25c64e97 | |||
| b7dc870c2d | |||
| 9bea608843 | |||
| 9db1732c36 | |||
| 39f1a70174 | |||
| 1810440355 | |||
| 37ac8f179e | |||
| 626a09328f | |||
| 8d489d0d77 | |||
| 776f3db0d7 | |||
| 6046057b88 | |||
| 7e85d9e549 | |||
| 01c8a8b1c2 | |||
| c9bf6ac9ae | |||
| 62e4d69be9 | |||
| 62ac733b09 | |||
| c3b3e1b1b9 | |||
| a791e96e00 | |||
| e87f5521c1 | |||
| 366a708f3a | |||
| 70ba662574 | |||
| b389abd99f | |||
| 4aa2d14fe3 | |||
| af7de75ad4 | |||
| d461ebbda1 | |||
| 55ef94abcd | |||
| afaf489d99 | |||
| 20e4cbfd13 | |||
| f3b8c9f34e | |||
| 45e8ff25a5 | |||
| 268e322e1c | |||
| d3bcba6a05 | |||
| cc4ef1944d | |||
| 5aa8486265 | |||
| fd181673cd | |||
| 62c9547c4e | |||
| cdd117bfb9 | |||
| 304ba57dad | |||
| 69eaaa4177 | |||
| 452ac52fcb | |||
| 40cf489290 | |||
| 891d6be4a6 | |||
| 5d45ce5cf7 | |||
| a0f2241f3a | |||
| aa513bf7d3 | |||
| b2d65febc8 | |||
| 23a6d326e8 | |||
| 5b2f1b6d8b | |||
| b4e9ad031b | |||
| 8b7ebcf040 | |||
| af05296631 | |||
| 29d693de2d | |||
| 51ac5172f5 | |||
| 24ce1ef5e7 | |||
| f6d1e269d1 | |||
| 62c2f5228d | |||
| 9882d9683b | |||
| 45ce89ee1f | |||
| bfb9df1553 | |||
| a5f79204ce | |||
| e322613d84 | |||
| fbb60f5191 | |||
| 899e7d2f39 | |||
| 8e2aa07747 | |||
| a0d262cd76 | |||
| b43a7edee4 | |||
| 7760bbd77c | |||
| 9c0f1b02a7 | |||
| 4ecfff4d8d | |||
| ac03b89f38 | |||
| 620174aea9 | |||
| ab50d28bc4 | |||
| b5318602d1 | |||
| bff2a63ea2 | |||
| aacfb8820e | |||
| 98e8c031d0 | |||
| beb4319d1e | |||
| 2558243c83 | |||
| b670e8d1ac | |||
| 68f8358f06 | |||
| db5a099097 | |||
| ce33ffb62a | |||
| 59a2fb9cfd | |||
| 75bba319de | |||
| f78e9261f3 | |||
| 5f77562333 | |||
| 5c4f01a68d | |||
| 35f6f998e6 | |||
| 6737a3ae09 | |||
| 09559bee8c | |||
| f487ea27a8 | |||
| a3d95f239a | |||
| 023c06e178 | |||
| 414a6c1c9e | |||
| 910e18fb22 | |||
| ac441fd1cf | |||
| 0c328372b5 | |||
| 55ef60a6d4 | |||
| c33584e683 | |||
| ee8c7453bd | |||
| 0330369603 | |||
| 3f7b642c7d | |||
| eb6c51426a | |||
| 0337bdb9fd | |||
| 7aedc62058 | |||
| bfc835cbbf | |||
| 5c6ba30c48 | |||
| 8fe4824ed2 | |||
| d40cb3bd55 | |||
| 4bcd3ac5d7 | |||
| e2b8e9dea9 | |||
| 572314bf3f | |||
| 14d303d331 | |||
| 24ffaa0738 | |||
| 5d9b6d056d | |||
| 5c28ff15ba | |||
| 06ceb2f2a1 | |||
| 7373e1dd8b | |||
| 4b1a9e714d | |||
| 9d76136358 | |||
| b3502420ad | |||
| dd7ac7cca9 | |||
| 31dfa18e9b | |||
| 3e785008d3 | |||
| 6b7c7f755c | |||
| c55a8a8703 | |||
| 64c97308ac | |||
| 3551b0b95a | |||
| 9f16b5c4af | |||
| 9777e549cb | |||
| fbfced1b93 | |||
| 1a84b4681c | |||
| 4bf81b8e1c | |||
| c282e7fdb4 | |||
| d339ee3135 | |||
| 1de95de299 | |||
| 96c998a1d7 | |||
| b5413c0156 | |||
| 7371c195ff | |||
| 0866a1996b | |||
| 41f44c4e78 | |||
| 131712c3bd | |||
| bae12aaab7 | |||
| 74d5844d8c | |||
| c87908266a | |||
| f788d76b8c | |||
| 41031e572e | |||
| f8a0864c1b | |||
| 949587334c | |||
| 0bc6a1a7f1 | |||
| 0d9cbfe927 | |||
| 8742a524c3 | |||
| 79bf2297b5 | |||
| 32e9e23630 | |||
| 7f1cecba92 | |||
| efd30c61c3 | |||
| 4c97b11207 | |||
| 58ea0ab745 | |||
| 3547c71ad5 | |||
| 044d6b2ce2 | |||
| a0b26b6c06 | |||
| 8e3bfde439 | |||
| 6507de959b | |||
| 56d09bf3b5 | |||
| 232754b978 | |||
| 75ef603308 | |||
| a5a2fcee4d | |||
| f86d57bfe3 | |||
| 615615b1df | |||
| aeba0ce170 | |||
| 5ce60aad53 | |||
| dbc01de9a0 | |||
| dfaf3f24fc | |||
| 14b0527e79 | |||
| f0148c3161 | |||
| 6a5e3d924d | |||
| 664a82e7c9 | |||
| e2763b4826 | |||
| afb29b19c2 | |||
| 8d60343940 | |||
| 67a77f1880 | |||
| c933974174 | |||
| 19715903fb | |||
| c88f72fd15 | |||
| 7818596271 | |||
| 9cb8d7bca6 | |||
| 46f9256114 | |||
| c26ef87202 | |||
| 89fee5b835 | |||
| f5795eb01b | |||
| dbf0c9f016 | |||
| 586b43048f | |||
| 63b9ee61d2 | |||
| 3b9eff7f34 | |||
| 59668c5fc1 | |||
| 3ed786fb5c | |||
| 0cd5eb5472 | |||
| ff571b96cb | |||
| 36b852e6bf | |||
| f0c21c7203 | |||
| 0516d8260c | |||
| 1418f57b96 | |||
| b24fb59c94 | |||
| 8fcf2bcd59 | |||
| 079b808a56 | |||
| a4e01e28db | |||
| ec1ef9099f | |||
| ac724c7e6c | |||
| ec25835525 | |||
| d4841a641c | |||
| 5612460720 | |||
| 465ea6429f | |||
| ed9057ca83 | |||
| 14ced962db | |||
| 1aff6b862d | |||
| ef490c4220 | |||
| 0dda83cbbc | |||
| fa4efec3b5 | |||
| 814eabb88e | |||
| 95021e4977 | |||
| d17fb7ebf0 | |||
| df9aa9ac32 | |||
| 9110517893 | |||
| 8204c7deb6 | |||
| 6662f8985e | |||
| a2b305ed3b | |||
| ce3d3a850c | |||
| 212b674bc2 | |||
| 2980a6b4bb | |||
| 435c0a9e82 | |||
| 4102cd7c91 | |||
| b4b603819d | |||
| 20e3707e69 | |||
| fc6eeaaea8 | |||
| 41799955ce | |||
| efb4ec9cb8 | |||
| 4dbda29f82 | |||
| befaa3c501 | |||
| f41edf9e21 | |||
| 754f10f0b0 | |||
| 5d331fdf69 | |||
| cbf1dbe2cb | |||
| 3177de92fb | |||
| 3878890783 | |||
| 61594f7873 | |||
| f412b5e0cd | |||
| f14d594a1a | |||
| f0279d23d3 |
@@ -0,0 +1,29 @@
|
|||||||
|
# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike
|
||||||
|
#
|
||||||
|
# for clang-format-10.0.1 from https://github.com/upx/upx-stubtools/releases
|
||||||
|
---
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
#AlignConsecutiveAssignments: true
|
||||||
|
AlwaysBreakTemplateDeclarations: true
|
||||||
|
ColumnLimit: 100
|
||||||
|
IndentWidth: 4
|
||||||
|
SortIncludes: false
|
||||||
|
SpaceAfterCStyleCast: true
|
||||||
|
Standard: Cpp03
|
||||||
|
StatementMacros: [
|
||||||
|
ACCCHK_ASSERT,
|
||||||
|
ACCCHK_ASSERT_IS_SIGNED_T,
|
||||||
|
ACCCHK_ASSERT_IS_UNSIGNED_T,
|
||||||
|
ACCCHK_ASSERT_SIGN_T,
|
||||||
|
ACC_BLOCK_BEGIN,
|
||||||
|
ACC_COMPILE_TIME_ASSERT,
|
||||||
|
ACC_COMPILE_TIME_ASSERT_HEADER,
|
||||||
|
ACC_CXX_DISABLE_NEW_DELETE,
|
||||||
|
ACC_CXX_TRIGGER_FUNCTION,
|
||||||
|
ACC_CXX_TRIGGER_FUNCTION_IMPL,
|
||||||
|
CLANG_FORMAT_DUMMY_STATEMENT,
|
||||||
|
COMPILE_TIME_ASSERT,
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1,
|
||||||
|
]
|
||||||
|
...
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
_darcs
|
|
||||||
B
|
|
||||||
ChangeLog.cvs*
|
|
||||||
build
|
|
||||||
doxygen
|
|
||||||
maint
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# see https://editorconfig.org/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[{GNUmakefile*,MMakefile*,Makefile*,Makevars*,*.mk}]
|
||||||
|
indent_size = 8
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.S]
|
||||||
|
indent_size = 8
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# make GitHub language detection more accurate, see https://github.com/github/linguist
|
||||||
|
|
||||||
|
src/*.h linguist-language=C++
|
||||||
|
src/*/*.h linguist-language=C++
|
||||||
|
|
||||||
|
src/stub/**/*.ash linguist-language=Assembly
|
||||||
|
src/stub/**/*.asm linguist-language=Assembly
|
||||||
|
src/stub/**/*.S linguist-language=Assembly
|
||||||
|
|
||||||
|
src/stub/tmp/** linguist-vendored
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This issue tracker is **ONLY** used for reporting bugs.
|
||||||
|
Please use [stackoverflow](https://stackoverflow.com) for supporting issues.
|
||||||
|
|
||||||
|
<!---
|
||||||
|
|
||||||
|
IF YOU REMOVE THIS TEMPLATE WE WILL CLOSE YOUR ISSUE WITHOUT RESPONSE.
|
||||||
|
Just read it and fill in the details we're asking, it saves so much of our time. Thanks!
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## What's the problem (or question)?
|
||||||
|
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||||
|
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||||
|
|
||||||
|
## What should have happened?
|
||||||
|
<!--- If you're describing a bug, tell us what should happen -->
|
||||||
|
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||||
|
|
||||||
|
## Do you have an idea for a solution?
|
||||||
|
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||||
|
<!--- or ideas how to implement the addition or change -->
|
||||||
|
|
||||||
|
## How can we reproduce the issue?
|
||||||
|
<!--- Provide unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant -->
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
4.
|
||||||
|
|
||||||
|
## Please tell us details about your environment.
|
||||||
|
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||||
|
* UPX version used (`upx --version`):
|
||||||
|
* Host Operating System and version:
|
||||||
|
* Host CPU architecture:
|
||||||
|
* Target Operating System and version:
|
||||||
|
* Target CPU architecture:
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This issue tracker is **ONLY** used for requesting sensible features.
|
||||||
|
Please use [stackoverflow](https://stackoverflow.com) for supporting issues.
|
||||||
|
|
||||||
|
<!---
|
||||||
|
|
||||||
|
IF YOU REMOVE THIS TEMPLATE WE WILL CLOSE YOUR ISSUE WITHOUT RESPONSE.
|
||||||
|
Just read it and fill in the details we're asking, it saves so much of our time. Thanks!
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## What's the problem (or question)?
|
||||||
|
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||||
|
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||||
|
|
||||||
|
## What should have happened?
|
||||||
|
<!--- If you're describing a bug, tell us what should happen -->
|
||||||
|
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||||
|
|
||||||
|
## Do you have an idea for a solution?
|
||||||
|
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||||
|
<!--- or ideas how to implement the addition or change -->
|
||||||
|
|
||||||
|
## How can we reproduce the issue?
|
||||||
|
<!--- Provide unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant -->
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
4.
|
||||||
|
|
||||||
|
## Please tell us details about your environment.
|
||||||
|
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||||
|
* UPX version used (`upx --version`):
|
||||||
|
* Host Operating System and version:
|
||||||
|
* Host CPU architecture:
|
||||||
|
* Target Operating System and version:
|
||||||
|
* Target CPU architecture:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
version: 2
|
||||||
|
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: 'github-actions'
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
# Check for updates to GitHub Actions every weekday
|
||||||
|
interval: 'daily'
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
UPX PULL REQUEST NOTES
|
||||||
|
======================
|
||||||
|
|
||||||
|
Handling pull requests is actually quite time consuming, so please
|
||||||
|
|
||||||
|
- if you want to contribute **a real C++ code bug-fix** then open an issue
|
||||||
|
on the main UPX issue tracker first
|
||||||
|
|
||||||
|
- if you want to contribute **a new feature** then by all means open an issue
|
||||||
|
on the main UPX issue tracker first before starting any coding!
|
||||||
|
|
||||||
|
- please refuse the temptation to "improve" the docs, scripts, CI, makefiles,
|
||||||
|
cmake build system, spelling errors, etc - we will NOT merge this; only open
|
||||||
|
an issue if you're sure there is a **real bug**
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Security Context
|
||||||
|
|
||||||
|
IMPORTANT NOTE: UPX inherits the security context of any files it handles.
|
||||||
|
|
||||||
|
This means that packing, unpacking, or even testing or listing a file requires
|
||||||
|
the same security considerations as actually executing the file.
|
||||||
|
|
||||||
|
Use UPX on trusted files only!
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| --------- | ------------------ |
|
||||||
|
| git HEAD | :white_check_mark: |
|
||||||
|
| any other | :x: |
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
# ...lots of outdated/unneeded stuff from the old Travis/Circle/AppVeyor CI days...
|
||||||
|
|
||||||
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
|
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
else
|
||||||
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
fi
|
||||||
|
source "$argv0dir/travis_init.sh" || exit 1
|
||||||
|
|
||||||
|
# create dirs
|
||||||
|
cd / || exit 1
|
||||||
|
mkbuilddirs $upx_BUILDDIR $ucl_BUILDDIR $upx_testsuite_BUILDDIR $zlib_BUILDDIR
|
||||||
|
cd / && cd "$upx_SRCDIR" || exit 1
|
||||||
|
|
||||||
|
echo
|
||||||
|
print_settings
|
||||||
|
echo
|
||||||
|
echo "$CC --version"; $CC --version
|
||||||
|
echo "$CXX --version"; $CXX --version
|
||||||
|
echo
|
||||||
|
|
||||||
|
# check whitespace
|
||||||
|
if [[ $TRAVIS_OS_NAME == linux ]]; then
|
||||||
|
cd / && cd $upx_SRCDIR || exit 1
|
||||||
|
echo "Checking source code for whitespace violations..."
|
||||||
|
bash ./misc/scripts/check_whitespace.sh || exit 1
|
||||||
|
echo " Passed."
|
||||||
|
fi # linux
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
#
|
||||||
|
# rebuild UPX stubs (needs upx-stubtools)
|
||||||
|
#
|
||||||
|
|
||||||
|
if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
|
||||||
|
if [[ -f "$HOME/local/bin/bin-upx/upx-stubtools-check-version" ]]; then
|
||||||
|
bin_upx=$(readlink -en -- "$HOME/local/bin/bin-upx")
|
||||||
|
elif [[ -f "$HOME/.local/bin/bin-upx/upx-stubtools-check-version" ]]; then
|
||||||
|
bin_upx=$(readlink -en -- "$HOME/.local/bin/bin-upx")
|
||||||
|
else
|
||||||
|
bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20210104")
|
||||||
|
fi
|
||||||
|
cd / && cd "$upx_SRCDIR" || exit 1
|
||||||
|
extra_subdirs=()
|
||||||
|
extra_subdirs+=( src/stub/src/arch/amd64 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/arm/v4a )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/arm/v4t )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/arm64/v8 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/i386 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/m68k/m68000 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/m68k/m68020 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/mips/r3000 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/powerpc/32 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/powerpc/64 )
|
||||||
|
extra_subdirs+=( src/stub/src/arch/powerpc/64le )
|
||||||
|
make -C src/stub maintainer-clean
|
||||||
|
for d in ${extra_subdirs[@]}; do
|
||||||
|
make -C $d -f Makefile.extra maintainer-clean
|
||||||
|
git status $d || true
|
||||||
|
done
|
||||||
|
git status src/stub/src || true
|
||||||
|
git status || true
|
||||||
|
failed=0
|
||||||
|
for d in ${extra_subdirs[@]}; do
|
||||||
|
PATH="$bin_upx:$PATH" make -C $d -f Makefile.extra || failed=1
|
||||||
|
done
|
||||||
|
PATH="$bin_upx:$PATH" make -C src/stub all || failed=1
|
||||||
|
if [[ $failed != 0 ]]; then
|
||||||
|
echo "UPX-ERROR: FATAL: rebuild-stubs failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! git diff --quiet; then
|
||||||
|
git status || true
|
||||||
|
git diff || true
|
||||||
|
echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git status
|
||||||
|
if [[ $BM_X == rebuild-stubs ]]; then
|
||||||
|
echo "X=rebuild-stubs done. Exiting."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
unset bin_upx extra_subdirs d failed
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 1
|
||||||
@@ -0,0 +1,273 @@
|
|||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
# ...lots of outdated/unneeded stuff from the old Travis/Circle/AppVeyor CI days...
|
||||||
|
|
||||||
|
#set -x # debug
|
||||||
|
umask 022
|
||||||
|
export GIT_PAGER=
|
||||||
|
|
||||||
|
# rename short variables to more readable Build-Matrix BM_ names
|
||||||
|
# C is COMPILER
|
||||||
|
# B is BUILD_OPTIONS
|
||||||
|
# T is TESTSUITE_OPTIONS
|
||||||
|
# X is EXTRA_OPTIONS
|
||||||
|
BM_CROSS=$CROSS; BM_C=$C; BM_B=$B; BM_T=$T; BM_X=$X
|
||||||
|
unset CROSS C B T X
|
||||||
|
[[ -z $BM_C ]] && BM_C=gcc
|
||||||
|
[[ -z $BM_B ]] && BM_B=release
|
||||||
|
|
||||||
|
# just in case, unset variable for passing extra UPX options
|
||||||
|
export UPX=
|
||||||
|
# un-export some vars
|
||||||
|
declare +x UPX_AUTOMATIC_BUILDS_SSL_KEY UPX_AUTOMATIC_BUILDS_SSL_IV
|
||||||
|
|
||||||
|
# compatibility wrappers
|
||||||
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
|
# use GNU coreutils ("brew install coreutils")
|
||||||
|
chmod() {
|
||||||
|
gchmod "$@"
|
||||||
|
}
|
||||||
|
date() {
|
||||||
|
gdate "$@"
|
||||||
|
}
|
||||||
|
readlink() {
|
||||||
|
greadlink "$@"
|
||||||
|
}
|
||||||
|
sha256sum() {
|
||||||
|
gsha256sum "$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
|
openssl() {
|
||||||
|
/usr/bin/openssl "$@"
|
||||||
|
}
|
||||||
|
sort() {
|
||||||
|
/usr/bin/sort "$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set CC and CXX from BM_C and BM_CROSS
|
||||||
|
if [[ -z $CC_OVERRIDE ]]; then
|
||||||
|
CC=false CXX=false SCAN_BUILD=false
|
||||||
|
AR=ar SIZE=size
|
||||||
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
|
BUILD_LOCAL_UCL=1
|
||||||
|
BUILD_LOCAL_ZLIB=1
|
||||||
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
|
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
||||||
|
fi
|
||||||
|
upx_exeext=.exe
|
||||||
|
# dir c:\cygwin
|
||||||
|
case $BM_C in
|
||||||
|
gcc-m32 | gcc-4.9-m32)
|
||||||
|
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
||||||
|
gcc-m64 | gcc-4.9-m64)
|
||||||
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
|
msvc | msvc-*)
|
||||||
|
AR="link -lib"; CC="cl"; CXX="cl" ;; # standard system compiler
|
||||||
|
esac
|
||||||
|
fi # APPVEYOR_JOB_ID
|
||||||
|
if [[ -n $BM_CROSS ]]; then
|
||||||
|
BUILD_LOCAL_UCL=1
|
||||||
|
BUILD_LOCAL_ZLIB=1
|
||||||
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
|
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
||||||
|
fi
|
||||||
|
cat /etc/os-release || true
|
||||||
|
if grep -E -q '^PRETTY_NAME="?Ubuntu .*12\.04' /etc/os-release; then
|
||||||
|
case $BM_CROSS-$BM_C in
|
||||||
|
arm-linux-gnueabi-gcc | arm-linux-gnueabi-gcc-4.6)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabi"
|
||||||
|
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
||||||
|
arm-linux-gnueabihf-gcc | arm-linux-gnueabihf-gcc-4.6)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabihf"
|
||||||
|
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
||||||
|
i[36]86-w64-mingw32-gcc | i[36]86-w64-mingw32-gcc-4.6)
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
|
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
||||||
|
x86_64-w64-mingw32-gcc | x86_64-w64-mingw32-gcc-4.6)
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
|
esac
|
||||||
|
elif grep -E -q '^PRETTY_NAME="?Ubuntu 16\.04' /etc/os-release; then
|
||||||
|
case $BM_CROSS-$BM_C in
|
||||||
|
aarch64-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-aarch64 -L /usr/aarch64-linux-gnu"
|
||||||
|
x=aarch64-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
arm-linux-gnueabi-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabi"
|
||||||
|
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
arm-linux-gnueabihf-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabihf"
|
||||||
|
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
i[36]86-w64-mingw32-gcc-5)
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
|
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
||||||
|
mips-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-mips -L /usr/mips-linux-gnu"
|
||||||
|
x=mips-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
mipsel-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-mipsel -L /usr/mipsel-linux-gnu"
|
||||||
|
x=mipsel-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
powerpc-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc -L /usr/powerpc-linux-gnu"
|
||||||
|
x=powerpc-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
powerpc64-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc64 -L /usr/powerpc64-linux-gnu"
|
||||||
|
x=powerpc64-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
powerpc64le-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc64le -L /usr/powerpc64le-linux-gnu"
|
||||||
|
x=powerpc64le-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
s390x-linux-gnu-gcc-5)
|
||||||
|
[[ -z $upx_qemu ]] && upx_qemu="qemu-s390x -L /usr/s390x-linux-gnu"
|
||||||
|
x=s390x-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
||||||
|
x86_64-w64-mingw32-gcc-5)
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine"
|
||||||
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
|
esac
|
||||||
|
elif grep -E -q '^PRETTY_NAME="?Ubuntu 20\.04' /etc/os-release; then
|
||||||
|
case $BM_CROSS-$BM_C in
|
||||||
|
x86_64-w64-mingw32-gcc-9)
|
||||||
|
export upx_EXTRA_CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1"
|
||||||
|
export upx_EXTRA_LDFLAGS="-static"
|
||||||
|
upx_exeext=.exe
|
||||||
|
[[ -z $upx_wine ]] && upx_wine="wine64"
|
||||||
|
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi # BM_CROSS
|
||||||
|
if [[ $CC == "false" ]]; then # generic
|
||||||
|
if [[ -z $BM_CROSS ]]; then
|
||||||
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
|
case $BM_C in
|
||||||
|
clang | clang-m?? | clang-[6789][0-9][0-9]-m?? | clang-1[0-1][0-9][0-9]-m??)
|
||||||
|
CC="clang"; CXX="clang++" ;; # standard system compiler
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
case $BM_C in
|
||||||
|
clang | clang-m?? | clang-3.4-m??)
|
||||||
|
CC="clang"; CXX="clang++" ;; # standard system compiler
|
||||||
|
clang-[3456].[0-9]-m??)
|
||||||
|
v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
||||||
|
clang-[789]-m??)
|
||||||
|
v=${BM_C:6:1}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
||||||
|
clang-1[0-9]-m??)
|
||||||
|
v=${BM_C:6:2}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
||||||
|
gcc | gcc-m?? | gcc-mx32)
|
||||||
|
CC="gcc"; CXX="g++" ;; # standard system compiler
|
||||||
|
gcc-[34].[0-9]-m?? | gcc-[34].[0-9]-mx32)
|
||||||
|
v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
|
||||||
|
gcc-[56789]-m?? | gcc-[56789]-mx32)
|
||||||
|
v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
|
||||||
|
gcc-1[0-9]-m?? | gcc-1[0-9]-mx32)
|
||||||
|
v=${BM_C:4:2}; CC="gcc-$v"; CXX="g++-$v" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi # generic
|
||||||
|
case $BM_C in
|
||||||
|
clang*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
|
||||||
|
clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
|
||||||
|
gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
|
||||||
|
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
|
||||||
|
gcc*-mx32) CC="$CC -mx32"; CXX="$CXX -mx32"; BUILD_LOCAL_UCL=1; BUILD_LOCAL_ZLIB=1 ;;
|
||||||
|
esac
|
||||||
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
|
CC="$CC -std=gnu89"
|
||||||
|
fi
|
||||||
|
unset v x
|
||||||
|
export AR CC CXX
|
||||||
|
fi # CC_OVERRIDE
|
||||||
|
|
||||||
|
# source dirs
|
||||||
|
[[ -z $upx_SRCDIR ]] && upx_SRCDIR=$(readlink -mn -- $argv0dir/..)
|
||||||
|
[[ -z $ucl_SRCDIR ]] && ucl_SRCDIR=$(readlink -mn -- $upx_SRCDIR/../deps/ucl-1.03)
|
||||||
|
[[ -z $upx_testsuite_SRCDIR ]] && upx_testsuite_SRCDIR=$(readlink -mn -- $upx_SRCDIR/../deps/upx-testsuite)
|
||||||
|
[[ -z $zlib_SRCDIR ]] && zlib_SRCDIR=$(readlink -mn -- $upx_SRCDIR/../deps/zlib-1.2.11)
|
||||||
|
|
||||||
|
# build dirs
|
||||||
|
mkbuilddirs() {
|
||||||
|
local d
|
||||||
|
for d in "$@"; do
|
||||||
|
mkdir -p -v "$d" || exit 1
|
||||||
|
[[ -f "$d/.mfxnobackup" ]] || touch "$d/.mfxnobackup"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
# search for an existing $toptop_builddir
|
||||||
|
if [[ -z $toptop_builddir ]]; then
|
||||||
|
for d in . ..; do
|
||||||
|
for subdir in "local" appveyor circle github gitlab travis .; do
|
||||||
|
dd=$d/build/$subdir
|
||||||
|
if [[ -d $dd ]]; then
|
||||||
|
toptop_builddir=$(readlink -en -- "$dd")
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
unset d subdir dd
|
||||||
|
fi
|
||||||
|
[[ -z $toptop_builddir ]] && toptop_builddir=$(readlink -mn -- ./build)
|
||||||
|
[[ -z $toptop_bdir ]] && toptop_bdir=$(readlink -mn -- "$toptop_builddir/${BM_CROSS:+$BM_CROSS-}$BM_C/$BM_B")
|
||||||
|
[[ -z $upx_BUILDDIR ]] && upx_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx")
|
||||||
|
[[ -z $ucl_BUILDDIR ]] && ucl_BUILDDIR=$(readlink -mn -- "$toptop_bdir/ucl-1.03")
|
||||||
|
[[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx-testsuite")
|
||||||
|
[[ -z $zlib_BUILDDIR ]] && zlib_BUILDDIR=$(readlink -mn -- "$toptop_bdir/zlib-1.2.11")
|
||||||
|
[[ -z $lcov_OUTPUTDIR ]] && lcov_OUTPUTDIR=$(readlink -mn -- "$toptop_bdir/.lcov-results")
|
||||||
|
unset toptop_builddir toptop_bdir
|
||||||
|
|
||||||
|
# ensure absolute directories
|
||||||
|
make_absolute() {
|
||||||
|
local d
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
if [[ -n ${!1} ]]; then
|
||||||
|
d=$(readlink -mn -- "${!1}")
|
||||||
|
eval $1="$d"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
for var_prefix in ucl upx upx_testsuite zlib; do
|
||||||
|
for var_suffix in _BUILDDIR _SRCDIR; do
|
||||||
|
make_absolute ${var_prefix}${var_suffix}
|
||||||
|
done
|
||||||
|
done
|
||||||
|
make_absolute lcov_OUTPUTDIR
|
||||||
|
unset var_prefix var_suffix
|
||||||
|
|
||||||
|
print_header() {
|
||||||
|
local x='==========='; x="$x$x$x$x$x$x$x"
|
||||||
|
echo -e "\n${x}\n${1}\n${x}\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_settings() {
|
||||||
|
local v var_prefix var_suffix
|
||||||
|
# Build Matrix
|
||||||
|
for v in TRAVIS_OS_NAME BM_CROSS BM_C BM_B BM_T; do
|
||||||
|
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
||||||
|
done
|
||||||
|
# BM_C related
|
||||||
|
for v in AR CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS LIBS SCAN_BUILD; do
|
||||||
|
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
||||||
|
v=EXTRA_${v}
|
||||||
|
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
||||||
|
done
|
||||||
|
# directories and other info
|
||||||
|
for v in TRAVIS_XCODE_SDK UPX_UCLDIR lcov_OUTPUTDIR; do
|
||||||
|
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
||||||
|
done
|
||||||
|
for var_prefix in ucl upx upx_testsuite zlib; do
|
||||||
|
for var_suffix in _BUILDDIR _SRCDIR; do
|
||||||
|
v=${var_prefix}${var_suffix}
|
||||||
|
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
##env | LC_ALL=C sort
|
||||||
|
}
|
||||||
|
|
||||||
|
true
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
########## begin .sha256sums.recreate
|
||||||
|
expected_sha256sums__t010_decompressed="\
|
||||||
|
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
|
||||||
|
24808d572483f4cd713d66894b3da406755038737007a78b076528e6407e3132 *amd64-linux.elf/upx-3.95
|
||||||
|
d88eaad0528bcecec9f51cbe015a117c8cf350a3f6d8308f2b0517d4fd19d189 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
f7279729eb975e4238f8b8ee56fefa41ccbeb35ef0ffe4c34f8047baab78fff5 *arm-linux.elf/upx-3.95
|
||||||
|
e09df2a69f88c692138447f274ba7f99cdd11f8696c71ac8d3761606c95ab5c5 *arm-wince.pe/upx-3.91.exe
|
||||||
|
ce81113f8a4ff1cd806811cb80ab8bea5c9c6fbced47451c7f07e50700f9817b *arm64-linux.elf/upx-3.95
|
||||||
|
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
|
||||||
|
84b90eb0d617571fe4885639925b35ca6a61060cb2616bb5bf729b4d701653e4 *armeb-linux.elf/upx-3.95
|
||||||
|
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
7d331e508449497f64cd47abdd3f00f70307f508ad3fd692d333feb97beccead *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
|
||||||
|
a1f3e5ffa7b2cfebe1e475ac1f4c7683b1b8b4e292aa0d04386cc0314dd162c9 *i386-linux.elf/upx-3.95
|
||||||
|
e90fb09a808334c2674996760d42c82f8352e3f671f6b66c11481e772785c4d2 *i386-win32.pe/upx-3.91.exe
|
||||||
|
07bd50c1d80f6ff651228e6fc0ba3a583a472915772244f232696b34156a9d27 *i386-win32.pe/upx-3.95.exe
|
||||||
|
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
8902f38ec3d95d8e077e3ab5fdbb5bad408859913a35deb87041f4f053cd6605 *mips-linux.elf/upx-3.95
|
||||||
|
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
|
||||||
|
dd1496bc4e9c32a5d5dd47e3eaabf7b134ca001d48807eebfd3d5e28c8a2ab58 *mipsel-linux.elf/upx-3.95
|
||||||
|
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
||||||
|
2bc00a51daa0bada19a8fa1bd2c227a8596844fa1b0aa3611087f195072700e2 *powerpc-linux.elf/upx-3.95
|
||||||
|
a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t020_canonicalized="\
|
||||||
|
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
|
||||||
|
24808d572483f4cd713d66894b3da406755038737007a78b076528e6407e3132 *amd64-linux.elf/upx-3.95
|
||||||
|
d88eaad0528bcecec9f51cbe015a117c8cf350a3f6d8308f2b0517d4fd19d189 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
f7279729eb975e4238f8b8ee56fefa41ccbeb35ef0ffe4c34f8047baab78fff5 *arm-linux.elf/upx-3.95
|
||||||
|
e09df2a69f88c692138447f274ba7f99cdd11f8696c71ac8d3761606c95ab5c5 *arm-wince.pe/upx-3.91.exe
|
||||||
|
ce81113f8a4ff1cd806811cb80ab8bea5c9c6fbced47451c7f07e50700f9817b *arm64-linux.elf/upx-3.95
|
||||||
|
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
|
||||||
|
84b90eb0d617571fe4885639925b35ca6a61060cb2616bb5bf729b4d701653e4 *armeb-linux.elf/upx-3.95
|
||||||
|
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
7d331e508449497f64cd47abdd3f00f70307f508ad3fd692d333feb97beccead *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
|
||||||
|
a1f3e5ffa7b2cfebe1e475ac1f4c7683b1b8b4e292aa0d04386cc0314dd162c9 *i386-linux.elf/upx-3.95
|
||||||
|
e90fb09a808334c2674996760d42c82f8352e3f671f6b66c11481e772785c4d2 *i386-win32.pe/upx-3.91.exe
|
||||||
|
07bd50c1d80f6ff651228e6fc0ba3a583a472915772244f232696b34156a9d27 *i386-win32.pe/upx-3.95.exe
|
||||||
|
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
8902f38ec3d95d8e077e3ab5fdbb5bad408859913a35deb87041f4f053cd6605 *mips-linux.elf/upx-3.95
|
||||||
|
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
|
||||||
|
dd1496bc4e9c32a5d5dd47e3eaabf7b134ca001d48807eebfd3d5e28c8a2ab58 *mipsel-linux.elf/upx-3.95
|
||||||
|
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
||||||
|
2bc00a51daa0bada19a8fa1bd2c227a8596844fa1b0aa3611087f195072700e2 *powerpc-linux.elf/upx-3.95
|
||||||
|
a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
|
||||||
|
60cf1528ad264c8f4d766443fae02fd0a7bf46247c896c53a19bbd90b800e918 *amd64-linux.elf/upx-3.91
|
||||||
|
a4aa078f2dbb381a6132b85ba53df5ac9ede069a43adc542aec25263ffb21ce0 *amd64-linux.elf/upx-3.95
|
||||||
|
4af65a302afd863073401a11c37246965d7b4ba101edb57d6e3547216ac3c8f7 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
fef37f59ada02f3d3555c2393fcd0fa12f644c4a57e98d0859fa4f919c243ce3 *arm-linux.elf/upx-3.95
|
||||||
|
ee4878808c92fc90867775ed1fccb4da94097d8e493c771ed75dffab6da6b167 *arm-wince.pe/upx-3.91.exe
|
||||||
|
911f5f56fa4f208d047eb00f9b5686993e7011d5bc17c90fab06b42b470583b0 *arm64-linux.elf/upx-3.95
|
||||||
|
c0a2eb27fbd6507a047d2f08f668c07d54a277d16394e437105f2b27dde434c1 *armeb-linux.elf/upx-3.91
|
||||||
|
e149178f6ce710ee151c2b11b8d2d6d8e99d65c1c640147f3e7aa1df60f0b438 *armeb-linux.elf/upx-3.95
|
||||||
|
badd40b58323cf5825fbd6627fe27a1ee2f1e787ea59b28e7795aa3b2799b887 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
52b2d1bd52747bc14784dea187159c424ee58a02758fa4f7548cfb6dff80d699 *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
b4bbba7e71afc2986b6cb9f17a0e14929b68f83345045bf30dc2c5761b91bda8 *i386-linux.elf/upx-3.91
|
||||||
|
faa00110c0a70a7fe455e61cdb97a9483cf6e578cb13033e8995d887543db69b *i386-linux.elf/upx-3.95
|
||||||
|
055135feb800114b4c2bdd9de28e845611f1390a1668ef3e20897d23d1fa8614 *i386-win32.pe/upx-3.91.exe
|
||||||
|
59748c9f0eb3eef2b54a54dbf274459cb28b5e9b12ba69993a6250c869f5ea89 *i386-win32.pe/upx-3.95.exe
|
||||||
|
84158c951fa65d6c53c9dcced158f8cd1b566e83f2109aeac7d6247338c48098 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
7522c07537da37c370c0dd925fc1b93eb53e329219dd6e21259281a871767779 *mips-linux.elf/upx-3.95
|
||||||
|
7b9258b0c97f733ca602d8f4ea08619ee430fd8802d046051f10ae68576c7756 *mipsel-linux.elf/upx-3.91
|
||||||
|
75c1c61ce3c53888525a9bf5b3e51b86f1fcbdc91151e6b4b19041b15dc1e5c8 *mipsel-linux.elf/upx-3.95
|
||||||
|
782df126832daeba48f8c86f0ca12626e4257a57b0bdfaa7439f3607f3954b33 *powerpc-linux.elf/upx-3.91
|
||||||
|
743a676ec7aac4d51e0473911a67b711987d0ec0fda8668a6f0808edcb906343 *powerpc-linux.elf/upx-3.95
|
||||||
|
b5dd587c58d013dcdf7551f8a2b8427cbd37f6e76c54e735baf68ee2a49fba9a *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
|
||||||
|
b8185a6b0ec81e5e0a3f741fe49c5635934f45a84e2154147100410496c9a880 *amd64-linux.elf/upx-3.91
|
||||||
|
8977f05b4b52c5ce1bdf32dee5c5d790640d79ea42ad83401826c261d9249866 *amd64-linux.elf/upx-3.95
|
||||||
|
bcd8749ba0c502fa7b21bcec9e531f3b7a178cb8757407d6b682d4ff1952d2a0 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
f32239666d98211182580a9badf1cab01197b51d8a3a358c26e3fa248a0ef776 *arm-linux.elf/upx-3.95
|
||||||
|
8261c22417294e3f0506d8f41154945e3f0b7d2a67e532af318d5795cd8f9c22 *arm-wince.pe/upx-3.91.exe
|
||||||
|
6e60054ace6510309426893dcf683b4c6da88f3fbd97e7149e23bc4bf8c88003 *arm64-linux.elf/upx-3.95
|
||||||
|
52496fee0654d4a46e778a01c3bc17f4f25f885291241f5237f0824f5b9a0cb3 *armeb-linux.elf/upx-3.91
|
||||||
|
48434abf0b96e57f421db5a9c45b04eebf105420a500656859d6fdbd3c5d99bf *armeb-linux.elf/upx-3.95
|
||||||
|
0d7c87e490dff9a41a9c3b317e2529f2d1b1926844a47c48b42ef8bd7d212a4d *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
75f42a83bddfc1923e32a6725a153219b1a37ecf4fd30876599341fd77de321d *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
2c50b4a2649ea7d4c1ca7d5c541107b878942ab61ef850ce5bdbb7bc6da8d777 *i386-linux.elf/upx-3.91
|
||||||
|
134dfa566532c1432be87a45d7d28333e79e7fbbe12b5c27fb02e24a550eb9c5 *i386-linux.elf/upx-3.95
|
||||||
|
3d04162e902e0f311493955df2dd60fa018b60003d4394d638abda22fa88a7fb *i386-win32.pe/upx-3.91.exe
|
||||||
|
1972dca6a741124271a291565d001af92cfb379d11a7efa54680a3f96d5f02b4 *i386-win32.pe/upx-3.95.exe
|
||||||
|
9751dfa351aa5076523c6bac013cf48b34267947fd1f057109fe141ead815d52 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
b80bc9585ccb586c3adc6c712110838366e61cefaf41a36a54e4eef8351d43c4 *mips-linux.elf/upx-3.95
|
||||||
|
4b87450050446b03f2d88c79efe2cf87e403f82e9f1f47cb3e99a82b1678f91a *mipsel-linux.elf/upx-3.91
|
||||||
|
0fcf1b3c72d4af95562dec2e2588816199b2a5086d848548bd9648456c64200d *mipsel-linux.elf/upx-3.95
|
||||||
|
7fc8fa7a67899917fbeffade2e7bfb32c6a395e781274901230cfca51ce33516 *powerpc-linux.elf/upx-3.91
|
||||||
|
ce6d87922a0d203fba0ff90e263e80237379dbf8daf3ae83d7d0cd9eb19c3360 *powerpc-linux.elf/upx-3.95
|
||||||
|
204cf8575465fb406dfd0520cc6bc103988074676123c2255e36952ab8d5c82f *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
|
||||||
|
8a7ec7f638e95156177a29a32c5a6a3cad2e3e970ca031bc28a55991428bab46 *amd64-linux.elf/upx-3.91
|
||||||
|
a1e9f15306809e6a65952d49163d50e11fc8dbe1094847e487c1509c5d642883 *amd64-linux.elf/upx-3.95
|
||||||
|
6a557025f93fbf869be7cae692959f96f250a5675195c53f26c17ef0d95246e7 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
b2a5d5cd936205a1d2c87019cfd1ead7d22268acc8be08963b358c807f7b0b2d *arm-linux.elf/upx-3.95
|
||||||
|
3be544b1ae2bdd70c764eb6f3424e83e49dc70991f21cd1bbb4aa892a706dfcd *arm-wince.pe/upx-3.91.exe
|
||||||
|
046e3639cff25a8d5d9c817aa314f0885667ccd71eaf17ebc87574dfdd1e0020 *arm64-linux.elf/upx-3.95
|
||||||
|
cc38f1ee23b97e107a2da9ec87358345b35e9bdb222791929b24f21838bffd03 *armeb-linux.elf/upx-3.91
|
||||||
|
1fa4a8c3eca8dfdc5464d1f020ea3eec75fedb037a3dd73a343655479464717b *armeb-linux.elf/upx-3.95
|
||||||
|
1c777079d1b35fa3ee68cb4e36822091fdbf4ea4c7ed149da1c34424b082b39d *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
d65c3d9c8850802bb66d51b26fdd905beaf1b72b7ba8550ec11788b7136b0204 *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
f2511747fac635a1d70b2364dfcdc91da517aec2c87d8d017557738e87d84061 *i386-linux.elf/upx-3.91
|
||||||
|
e74cdd10bf5f37249278634bf1055adaa0527bbe4735c4cdf7a54663b67db985 *i386-linux.elf/upx-3.95
|
||||||
|
4d21e45a321a78de433d96170a3e39daeee2ab18c646f2fca0ae1367b356ea63 *i386-win32.pe/upx-3.91.exe
|
||||||
|
3e1a705b3c6859d7812e4d8b42fd6201563356614b7f0ec16718cddb8bec1e82 *i386-win32.pe/upx-3.95.exe
|
||||||
|
9a812916dfa09e821f9b3233b98b6740d39751ed0dc63e8edfd8b59f262b4218 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
eea25f8bec855536168c1e9f1b960c807ce46f9758878fdff2d23065d8007d14 *mips-linux.elf/upx-3.95
|
||||||
|
e37c0ce8513131e4e1ebeaaa999d258be95bde655b60fc9c575b3648a0b07c14 *mipsel-linux.elf/upx-3.91
|
||||||
|
c46b272e068276601d8ebc3a7765f2e3cafd279b3f5aff6fb4af4d4869afd387 *mipsel-linux.elf/upx-3.95
|
||||||
|
390eba4b44e6e3e3e5b726ca7d087eee4a90af0c194d6cb7633da5e0e5d8dec5 *powerpc-linux.elf/upx-3.91
|
||||||
|
b21ed94586b7254c96fcd64034e73ce8cb8851c92bb27d4d5eb377cf16c56aa2 *powerpc-linux.elf/upx-3.95
|
||||||
|
52f53a9d7fa0b38ce1276101bb8be59d31f54a959ca0ae0a2708dd3083d0483c *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t140_compress_lzma_2_no_filter="\
|
||||||
|
804324e788c9cafe63899ec5a63d77e3a51cce3b0750b1c8b34998b67a748fe4 *amd64-linux.elf/upx-3.91
|
||||||
|
289966c134b6a8205ab24985ece406825e752f585cde562dd89e5dfd6b85d685 *amd64-linux.elf/upx-3.95
|
||||||
|
85334ab36776fbc83d7f9b323e398045709a84227cc060ec1b11416e47b7d670 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
662c325309248481d6badea5e1f029199e016805e71493f293b4cc1ddaaf7312 *arm-linux.elf/upx-3.95
|
||||||
|
6702553672b3c82c5202568995e147ff0add3d313cf947c11715e28619e0d8a4 *arm-wince.pe/upx-3.91.exe
|
||||||
|
18911ee9b594bd26afc0e8613cf7b2ea1c94a7802e34f7cc8f73219ce073b549 *arm64-linux.elf/upx-3.95
|
||||||
|
8406d036dbd9cdccaad665b6ef1a7c2dd19444e68cc22356862981f8bb887705 *armeb-linux.elf/upx-3.91
|
||||||
|
88309cf1e9ced304ae7075a1936fe5ca36252b02778122b7c68a945552e5d985 *armeb-linux.elf/upx-3.95
|
||||||
|
97333fc14e57dfa8e1e5253d5e1fef192be15ab244c8f8fcb085df6df84a6af9 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
35695a112da8561ce23421e143a175b208cbfb111147d0d1b66076204eccb786 *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
18573567330d45620d03eb4f429ef961237e699d4f3e6996b821a4b06b41cfaa *i386-linux.elf/upx-3.91
|
||||||
|
e29d386a052212dec3c772afc82a082935c45f2082f534a703cac1a3df526624 *i386-linux.elf/upx-3.95
|
||||||
|
41bdbc2c6a81afbd84bd76c0f86aefbe2910e9d134ad7f4d8546d75faf0bb9f2 *i386-win32.pe/upx-3.91.exe
|
||||||
|
86d64438184889bed06efcb58acb4474ca0a5f9e6f68b13454dc0c3769994953 *i386-win32.pe/upx-3.95.exe
|
||||||
|
3a5d8cc9d5614d78739b1b3eaf2f5fce1607fb27c9229da88580faedd48a1e32 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
621d84c8fb8f51d97846d6db10b42cf761fffc33f5ed62a30a4c1ce12a7581ab *mips-linux.elf/upx-3.95
|
||||||
|
9de8d51d185935276faa5aea301d6cb027acad0eb61061a0e9c21aacc931b045 *mipsel-linux.elf/upx-3.91
|
||||||
|
0f8fb6ae0e8a62cc1d349ced9beb18be5eaf82fd90960250eea8c184d0cc8140 *mipsel-linux.elf/upx-3.95
|
||||||
|
577584395dc5cc88a5302b69d5492a10da5eb2712bb22f4ad09b222af287f401 *powerpc-linux.elf/upx-3.91
|
||||||
|
1287341561dde2168d79165e0ebb15bfd5e404b28f2defd5163e7b658bb1b9eb *powerpc-linux.elf/upx-3.95
|
||||||
|
132c287fa13771b9a251d02d007fb5606acc298afc8defb556eafe05c4a6eea5 *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t150_compress_ucl_2_all_filters="\
|
||||||
|
c5bc7dc605b6d6fad71e796260d9b533a4a39ff2664bc1164d1e33a4f52bcd8d *amd64-linux.elf/upx-3.91
|
||||||
|
543e5484080f84ca511d4d7a3ff86a6b06aeaefc17c5dd65dff859c1d15d5c1f *amd64-linux.elf/upx-3.95
|
||||||
|
16b7f3c5b0aa1854edecc1519b9b8b9fb8869f7b8b295aa6a42f684750f641b9 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
b4919e7441869d45b98454abd935cd5dbef06bb3a0382f852f3552e6f8ba9768 *arm-linux.elf/upx-3.95
|
||||||
|
32f7fd369c33f4c70fcb7e6ece14f3cb532845a2410af8fa9d6e23b380428a3a *arm-wince.pe/upx-3.91.exe
|
||||||
|
6a91fb2df9366591530bd4d4e240e7cb0316de19bc437b93adb00dec26fa9227 *arm64-linux.elf/upx-3.95
|
||||||
|
839dca66684e5fe8da1a81507c427b450d3af00014a06cf1e728091b412d4439 *armeb-linux.elf/upx-3.91
|
||||||
|
98fc09fded3e4c4e377ad7b1cb109d0115ce34c215762ef85810841b2b1c6973 *armeb-linux.elf/upx-3.95
|
||||||
|
765d81de304b2e60ee51da124677ba3d762da34df2f0e7989c8e967aa130754c *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
2d4429efc2161399e07e7bafd94b0e8631f8afdc2dc27f823b8983ad9cc74ffd *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
e9c041cdf4da72fabba9a402eaffe35a2ffd59caaa629580a6fdf61a3810ec01 *i386-linux.elf/upx-3.91
|
||||||
|
a6905f887a7f9c28657b9afe62121b2c2e4372594654b75fe3f6c77c2fe608dc *i386-linux.elf/upx-3.95
|
||||||
|
f0e2972e405a0d72c09fca7e63a56bb5c3658af558253151234431a7f7be4df0 *i386-win32.pe/upx-3.91.exe
|
||||||
|
1dd5519f77e84d824b97d480fcc3ce03c9302411af4bfedc720970f0da42511f *i386-win32.pe/upx-3.95.exe
|
||||||
|
eb475239ee1e22b9fde001334f2e4b9198e69e5cbf1dad4799e9689ee3f4b4a3 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
c7b5aa7015d3aebfb26dbfc07cccaf27c95635eb3059bbe3b63ea4464d348ca0 *mips-linux.elf/upx-3.95
|
||||||
|
1665df73de7d6295054a6586f36a3539d04970036ed589a13d15889bac0531dc *mipsel-linux.elf/upx-3.91
|
||||||
|
dd6725bcff72b27b292670eef5e165e5150916c11147a782b648e954cdfb0951 *mipsel-linux.elf/upx-3.95
|
||||||
|
68fe23ad35bb80fe99d3d83ca5856aabe5816fe415f70ac9e94a241283972088 *powerpc-linux.elf/upx-3.91
|
||||||
|
bc2ae2af43c3e07b3877b0f9c569db3a11b4b5fe593bdd86702ff6e9e5bbf26a *powerpc-linux.elf/upx-3.95
|
||||||
|
9081f42953e76c5c2985dc5ed4eb6db8569ac9cac1935181031d06251c9e2b75 *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
|
||||||
|
31ebcdb8bc47adecd530ed4856fd980d2d1f9634223633e881c0bada9df5833e *amd64-linux.elf/upx-3.91
|
||||||
|
f68db730964b5616e18166679e5f145f284153c3fb60ca6c5221565b73496fed *amd64-linux.elf/upx-3.95
|
||||||
|
fb77031bf3378bf36f8e5578f613ef270469b45b3092115302cfa5f0263f3ea2 *amd64-win64.pe/upx-3.95.exe
|
||||||
|
51056aab220ba9f8d8e1cba1493d1ffb06276b6528a6ea17f6a53592c0e2b918 *arm-linux.elf/upx-3.95
|
||||||
|
1cd0e34cd590faaad5e315b0a6b2005b1af4cbc198804ee985407cabe9593d5f *arm-wince.pe/upx-3.91.exe
|
||||||
|
80de1405d287740715346529a8d28110d79ad6ddac7d22e53b03f0b9e2b5b494 *arm64-linux.elf/upx-3.95
|
||||||
|
8f6baca1ba513b7bcc0ddea296567955232deeee17033e4b556c742415aef820 *armeb-linux.elf/upx-3.91
|
||||||
|
39e0c345678d189a792e4abbfda523c5447eb272a66744cade79981c146e9539 *armeb-linux.elf/upx-3.95
|
||||||
|
98ef45954db27ffa8acbabb7a8abe8ecc61027e62dd0f7d94fb1af4c4a0fa8b8 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
b0b518e4e34c87812550eae4aa19717a571337bae3839d132188ccb20f6f7752 *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
5c4ca76139f3206c8f5902f2c5f02cd510df5275dbf857a6ad323316eea77ed4 *i386-linux.elf/upx-3.91
|
||||||
|
edf9302620e1c640dd7614305fbe8e897dbfa29805b674390448ee4d88f3f9ee *i386-linux.elf/upx-3.95
|
||||||
|
4b766a3851c2452be06e937a85e8bcd482d8c57e929552abe7276f550f57009a *i386-win32.pe/upx-3.91.exe
|
||||||
|
71efdedb51745d68fa20b533dd5a19a21ec92a6a07fa9fcb8e052f474b513cc1 *i386-win32.pe/upx-3.95.exe
|
||||||
|
0a1bbeeac1a56ac01fe6528e36822793b723bed1b578a922a7ad37a16549fec6 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
721a41418323ff67c2a90f61eab8c7f0ee45a5fa2a4a4d83d0240b487b045ea3 *mips-linux.elf/upx-3.95
|
||||||
|
38c129ba9a0d7f8909070532901aa70dc19d58890ca1dbbd3ec7419a401cc9f0 *mipsel-linux.elf/upx-3.91
|
||||||
|
1ec691975942533d9bb288948fc283cfe57e0e09853bd02149af63b9788b6be5 *mipsel-linux.elf/upx-3.95
|
||||||
|
daee5df21ce65551309573a121db90255b6f034eac7988c4cb34bed6834086ce *powerpc-linux.elf/upx-3.91
|
||||||
|
d27dffec68b530d2a8ffb5d440ec9ebe3772d45aaa699329dbb4b0a850cbbfff *powerpc-linux.elf/upx-3.95
|
||||||
|
b021e58ff550aa160c83c122e03b63c1baf28808a584a9aefac4268a77095bec *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
|
||||||
|
0ad79f9b86da588e67877e59921cc501ca515dc50d27c077f73ef3fb2c303ecb *amd64-linux.elf/upx-3.91
|
||||||
|
5e46d16f080ce4f7b7f317cd3c76b513a70fab1fafb10fbdb72c01d3006b2369 *amd64-linux.elf/upx-3.95
|
||||||
|
8610b878784b51dfcab58e33536e9812cc69951a8d22c3fad9d4c2583f6bb6ac *amd64-win64.pe/upx-3.95.exe
|
||||||
|
cd02bf210f1d183bdc53f4442a36114b7385b165130b74bcce830703f8c7d9d7 *arm-linux.elf/upx-3.95
|
||||||
|
d4a6895180ebaaecff91374a58101370db5a8817c1ad1f99876cec02aab6c561 *arm-wince.pe/upx-3.91.exe
|
||||||
|
1ea76b4fe1cb058d3e0fade6139fe3c5d2745eb3becf0eddf557194e500648e6 *arm64-linux.elf/upx-3.95
|
||||||
|
4f7d97f65cecd626654d3fc34201da60899905b826d395fc6dee7bd6d742363c *armeb-linux.elf/upx-3.91
|
||||||
|
c5bbe69225f5d75e88ab176a91e148e9ed3733530d0ee9ed22a85aae201d7231 *armeb-linux.elf/upx-3.95
|
||||||
|
11130e38b33a063737685110740a16f95f30661480c0f8bf582e4b7fa751f5b7 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
||||||
|
6f613b3b96147068eb8e1d577537cc8a16011600b79a80d3584c6c115de8b063 *i386-dos32.djgpp2.coff/upx-3.95.exe
|
||||||
|
a1529b3e26fe8d101dbcb12338de0b9fc31324614fa5020e0807e3fdad5e9ad4 *i386-linux.elf/upx-3.91
|
||||||
|
d8e019fff654dcffc9c55bcf171dd932f166fb401dd5884cf69e7db253740a60 *i386-linux.elf/upx-3.95
|
||||||
|
264093035fbddf27a4e5c9d612ddc60fa7466c8b2254df56a28dded096afd438 *i386-win32.pe/upx-3.91.exe
|
||||||
|
159918923abe10dd3a63aaf5c1c5a6a048a4a97a278587ec9ba6f72aa12b8d45 *i386-win32.pe/upx-3.95.exe
|
||||||
|
38262d29ae5c51b6dc18d6b992f041ee602b0b8c601003ef423e4f8693eb1ad0 *m68k-atari.tos/upx-3.91.ttp
|
||||||
|
6c543e309067db3bbd45d219b0d7c9ebc0df9c5db851530877031edc8a8b62dc *mips-linux.elf/upx-3.95
|
||||||
|
ba36e7b3566e666d3b381b8b52068a93525d411df7ef2ec8a8073c942c0a5d95 *mipsel-linux.elf/upx-3.91
|
||||||
|
ada7b5da780d7ee3c0e5339dcdebb1d2cf989f19b2b5728f10685563061291de *mipsel-linux.elf/upx-3.95
|
||||||
|
efdd95af6a52c517ec00d0f16555ed3b1fe96ab3156219c58b62a1259585efd8 *powerpc-linux.elf/upx-3.91
|
||||||
|
adbb1cecaa29295f2c1433fc95d2a0c610b62a5d3fe153a59c6b908597771014 *powerpc-linux.elf/upx-3.95
|
||||||
|
6201d061df42316e2550e0848343b595708e75cebcc8cd03c272a5b0def610c1 *powerpc64le-linux.elf/upx-3.95
|
||||||
|
"
|
||||||
|
########## end .sha256sums.recreate
|
||||||
@@ -0,0 +1,307 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
#
|
||||||
|
# very first version of the upx-testsuite
|
||||||
|
#
|
||||||
|
|
||||||
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
|
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
else
|
||||||
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
fi
|
||||||
|
source "$argv0dir/travis_init.sh" || exit 1
|
||||||
|
|
||||||
|
if [[ $BM_T =~ (^|\+)SKIP($|\+) ]]; then
|
||||||
|
echo "UPX testsuite SKIPPED."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [[ $BM_X == rebuild-stubs ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# convenience
|
||||||
|
[[ -f $upx_exe ]] && upx_exe=$(readlink -en -- "$upx_exe")
|
||||||
|
|
||||||
|
# create dirs
|
||||||
|
cd / || exit 1
|
||||||
|
if [[ ! -d "$upx_testsuite_SRCDIR/files/packed" ]]; then
|
||||||
|
echo 'invalid or missing $upx_testsuite_SRCDIR:'
|
||||||
|
echo ' please git clone https://github.com/upx/upx-testsuite'
|
||||||
|
echo ' and set (export) the envvar upx_testsuite_SRCDIR to the local file path'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mkbuilddirs "$upx_testsuite_BUILDDIR"
|
||||||
|
cd / && cd "$upx_testsuite_BUILDDIR" || exit 1
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // support functions
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
testsuite_header() {
|
||||||
|
local x='==========='; x="$x$x$x$x$x$x$x"
|
||||||
|
echo -e "\n${x}\n${1}\n${x}\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
testsuite_split_f() {
|
||||||
|
fd=$(dirname "$1")
|
||||||
|
fb=$(basename "$1")
|
||||||
|
fsubdir=$(basename "$fd")
|
||||||
|
# sanity checks
|
||||||
|
if [[ ! -f $1 || -z $fsubdir || -z $fb ]]; then
|
||||||
|
fd= fb= fsubdir=
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
testsuite_check_sha() {
|
||||||
|
(cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
||||||
|
echo
|
||||||
|
cat $1/.sha256sums.current
|
||||||
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
||||||
|
echo "UPX-ERROR: $1 FAILED: checksum mismatch"
|
||||||
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
||||||
|
exit_code=99
|
||||||
|
let num_errors+=1 || true
|
||||||
|
all_errors="${all_errors} $1"
|
||||||
|
#exit 99
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
testsuite_check_sha_decompressed() {
|
||||||
|
(cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
||||||
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
||||||
|
cat $1/.sha256sums.current
|
||||||
|
echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch"
|
||||||
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
||||||
|
exit 98
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
testsuite_use_canonicalized=1
|
||||||
|
testsuite_run_compress() {
|
||||||
|
testsuite_header $testdir
|
||||||
|
local files f
|
||||||
|
if [[ $testsuite_use_canonicalized == 1 ]]; then
|
||||||
|
files=t020_canonicalized/*/*
|
||||||
|
else
|
||||||
|
files=t010_decompressed/*/*
|
||||||
|
fi
|
||||||
|
for f in $files; do
|
||||||
|
testsuite_split_f $f
|
||||||
|
[[ -z $fb ]] && continue
|
||||||
|
echo "# $f"
|
||||||
|
mkdir -p $testdir/$fsubdir $testdir/.decompressed/$fsubdir
|
||||||
|
$upx_run -qq --prefer-ucl "$@" $f -o $testdir/$fsubdir/$fb
|
||||||
|
$upx_run -qq -d $testdir/$fsubdir/$fb -o $testdir/.decompressed/$fsubdir/$fb
|
||||||
|
done
|
||||||
|
testsuite_check_sha $testdir
|
||||||
|
$upx_run -qq -l $testdir/*/*
|
||||||
|
$upx_run -qq --file-info $testdir/*/*
|
||||||
|
$upx_run -q -t $testdir/*/*
|
||||||
|
if [[ $testsuite_use_canonicalized == 1 ]]; then
|
||||||
|
# check that after decompression the file matches the canonicalized version
|
||||||
|
cp t020_canonicalized/.sha256sums.expected $testdir/.decompressed/
|
||||||
|
testsuite_check_sha_decompressed $testdir/.decompressed
|
||||||
|
rm -rf "./$testdir/.decompressed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // expected checksums
|
||||||
|
# //
|
||||||
|
# // To ease maintenance of this script in case of updates this section
|
||||||
|
# // can be automatically re-created from the current checksums -
|
||||||
|
# // see call of function recreate_expected_sha256sums below.
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
recreate_expected_sha256sums() {
|
||||||
|
local o=$1
|
||||||
|
local files f d
|
||||||
|
echo "########## begin .sha256sums.recreate" > "$o"
|
||||||
|
files=*/.sha256sums.current
|
||||||
|
for f in $files; do
|
||||||
|
d=$(dirname "$f")
|
||||||
|
echo "expected_sha256sums__${d}="'"\' >> "$o"
|
||||||
|
cat "$f" >> "$o"
|
||||||
|
echo '"' >> "$o"
|
||||||
|
done
|
||||||
|
echo "########## end .sha256sums.recreate" >> "$o"
|
||||||
|
}
|
||||||
|
|
||||||
|
source "$argv0dir/travis_testsuite_1-expected_sha256sums.sh" || exit 1
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // init
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
#set -x # debug
|
||||||
|
exit_code=0
|
||||||
|
num_errors=0
|
||||||
|
all_errors=
|
||||||
|
|
||||||
|
if [[ $BM_T =~ (^|\+)ALLOW_FAIL($|\+) ]]; then
|
||||||
|
echo "ALLOW_FAIL"
|
||||||
|
set +e
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -z $upx_exe && -f $upx_BUILDDIR/upx.out ]] && upx_exe=$upx_BUILDDIR/upx.out
|
||||||
|
[[ -z $upx_exe && -f $upx_BUILDDIR/upx.exe ]] && upx_exe=$upx_BUILDDIR/upx.exe
|
||||||
|
if [[ -z $upx_exe ]]; then exit 1; fi
|
||||||
|
upx_run=$upx_exe
|
||||||
|
if [[ $BM_T =~ (^|\+)qemu($|\+) && -n $upx_qemu ]]; then
|
||||||
|
upx_run="$upx_qemu $upx_qemu_flags -- $upx_exe"
|
||||||
|
fi
|
||||||
|
if [[ $BM_T =~ (^|\+)wine($|\+) && -n $upx_wine ]]; then
|
||||||
|
upx_run="$upx_wine $upx_wine_flags $upx_exe"
|
||||||
|
fi
|
||||||
|
if [[ $BM_T =~ (^|\+)valgrind($|\+) ]]; then
|
||||||
|
if [[ -z $upx_valgrind ]]; then
|
||||||
|
upx_valgrind="valgrind"
|
||||||
|
fi
|
||||||
|
if [[ -z $upx_valgrind_flags ]]; then
|
||||||
|
#upx_valgrind_flags="--leak-check=full --show-reachable=yes"
|
||||||
|
#upx_valgrind_flags="-q --leak-check=no --error-exitcode=1"
|
||||||
|
upx_valgrind_flags="--leak-check=no --error-exitcode=1"
|
||||||
|
fi
|
||||||
|
upx_run="$upx_valgrind $upx_valgrind_flags $upx_exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then
|
||||||
|
(cd / && cd "$upx_BUILDDIR" && lcov -d . --zerocounters)
|
||||||
|
fi
|
||||||
|
|
||||||
|
export UPX="--prefer-ucl --no-color --no-progress"
|
||||||
|
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
|
||||||
|
export UPX_DEBUG_DOCTEST_VERBOSE=0
|
||||||
|
|
||||||
|
# let's go
|
||||||
|
if ! $upx_run --version-short; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi
|
||||||
|
if ! $upx_run -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi
|
||||||
|
if ! $upx_run --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi
|
||||||
|
rm -rf ./testsuite_1
|
||||||
|
mkbuilddirs testsuite_1
|
||||||
|
cd testsuite_1 || exit 1
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // decompression tests
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
testdir=t010_decompressed
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
|
||||||
|
testsuite_header $testdir
|
||||||
|
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.9[15]*; do
|
||||||
|
testsuite_split_f $f
|
||||||
|
[[ -z $fb ]] && continue
|
||||||
|
echo "# $f"
|
||||||
|
mkdir -p $testdir/$fsubdir
|
||||||
|
$upx_run -qq -d $f -o $testdir/$fsubdir/$fb
|
||||||
|
done
|
||||||
|
testsuite_check_sha $testdir
|
||||||
|
|
||||||
|
# run one pack+unpack step to canonicalize the files
|
||||||
|
testdir=t020_canonicalized
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
|
||||||
|
testsuite_header $testdir
|
||||||
|
for f in t010_decompressed/*/*; do
|
||||||
|
testsuite_split_f $f
|
||||||
|
[[ -z $fb ]] && continue
|
||||||
|
echo "# $f"
|
||||||
|
mkdir -p $testdir/$fsubdir/.packed
|
||||||
|
$upx_run -qq --prefer-ucl -1 $f -o $testdir/$fsubdir/.packed/$fb
|
||||||
|
$upx_run -qq -d $testdir/$fsubdir/.packed/$fb -o $testdir/$fsubdir/$fb
|
||||||
|
done
|
||||||
|
testsuite_check_sha $testdir
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // compression tests
|
||||||
|
# // info: we use fast compression levels because we want to
|
||||||
|
# // test UPX and not the compression libraries
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
case $UPX_TESTSUITE_FAST in
|
||||||
|
[0-7]) ;;
|
||||||
|
*) UPX_TESTSUITE_FAST=999 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 1 ]]; then
|
||||||
|
testdir=t110_compress_ucl_nrv2b_3_no_filter
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress --nrv2b -3 --no-filter
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 2 ]]; then
|
||||||
|
testdir=t120_compress_ucl_nrv2d_3_no_filter
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress --nrv2d -3 --no-filter
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 3 ]]; then
|
||||||
|
testdir=t130_compress_ucl_nrv2e_3_no_filter
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress --nrv2e -3 --no-filter
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 4 ]]; then
|
||||||
|
testdir=t140_compress_lzma_2_no_filter
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress --lzma -2 --no-filter
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 5 ]]; then
|
||||||
|
testdir=t150_compress_ucl_2_all_filters
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress -2 --all-filters
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 6 ]]; then
|
||||||
|
testdir=t160_compress_all_methods_1_no_filter
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress --all-methods -1 --no-filter
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $UPX_TESTSUITE_FAST -ge 7 ]]; then
|
||||||
|
testdir=t170_compress_all_methods_no_lzma_5_no_filter
|
||||||
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
||||||
|
time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
|
||||||
|
fi
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // summary
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
# recreate checksums from current version for an easy update in case of changes
|
||||||
|
recreate_expected_sha256sums .sha256sums.recreate
|
||||||
|
|
||||||
|
testsuite_header "UPX testsuite summary"
|
||||||
|
if ! $upx_run --version-short; then
|
||||||
|
echo "UPX-ERROR: upx --version-short FAILED"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
echo "upx_exe='$upx_exe'"
|
||||||
|
if [[ $upx_run != "$upx_exe" ]]; then
|
||||||
|
echo "upx_run='$upx_run'"
|
||||||
|
fi
|
||||||
|
if [[ -f $upx_exe ]]; then
|
||||||
|
ls -l "$upx_exe"
|
||||||
|
file "$upx_exe" || true
|
||||||
|
fi
|
||||||
|
echo "upx_testsuite_SRCDIR='$upx_testsuite_SRCDIR'"
|
||||||
|
echo "upx_testsuite_BUILDDIR='$upx_testsuite_BUILDDIR'"
|
||||||
|
echo ".sha256sums.{expected,current}:"
|
||||||
|
cat */.sha256sums.expected | LC_ALL=C sort | wc
|
||||||
|
cat */.sha256sums.current | LC_ALL=C sort | wc
|
||||||
|
echo
|
||||||
|
if [[ $exit_code == 0 ]]; then
|
||||||
|
echo "UPX testsuite passed. All done."
|
||||||
|
else
|
||||||
|
echo "UPX-ERROR: UPX testsuite FAILED:${all_errors}"
|
||||||
|
echo "UPX-ERROR: UPX testsuite FAILED with $num_errors error(s). See log file."
|
||||||
|
fi
|
||||||
|
exit $exit_code
|
||||||
@@ -0,0 +1,271 @@
|
|||||||
|
# Support for GitHub Actions -- https://github.com/features/actions
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
# note: GitHub Actions runner images are frequently updated, and
|
||||||
|
# unfortunately this sometimes breaks builds in mysterious ways...
|
||||||
|
# see https://github.com/actions/runner-images.git
|
||||||
|
|
||||||
|
name: 'CI'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
- '!appveyor*'
|
||||||
|
- '!gitlab*'
|
||||||
|
- '!travis*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
UPX_CMAKE_BUILD_FLAGS: --verbose
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
job-rebuild-and-verify-stubs:
|
||||||
|
name: 'Rebuild stubs'
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: 'Install extra packages'
|
||||||
|
run: |
|
||||||
|
uname -a; pwd; id; umask
|
||||||
|
cd ..; mkdir -p deps; cd deps; mkdir packages
|
||||||
|
# for ubuntu-22.04: install python2
|
||||||
|
##export DEBIAN_FRONTEND=noninteractive
|
||||||
|
##sudo apt-get install -y --no-install-recommends python2-minimal
|
||||||
|
# manually install compat libs from Ubuntu 16.04
|
||||||
|
wget -q 'http://mirror.enzu.com/ubuntu/pool/main/g/gmp/libgmp10_6.1.0+dfsg-2_amd64.deb'
|
||||||
|
wget -q 'http://mirror.enzu.com/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb'
|
||||||
|
for f in *.deb; do dpkg -x $f ./packages; done
|
||||||
|
sudo mv -v -n ./packages/usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/
|
||||||
|
sudo ldconfig
|
||||||
|
wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20210104/bin-upx-20210104.tar.xz | tar -xJ
|
||||||
|
- name: 'Check out code'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with: { submodules: true }
|
||||||
|
- name: 'Rebuild and verify stubs'
|
||||||
|
run: |
|
||||||
|
env C=gcc X=rebuild-stubs TRAVIS_OS_NAME=linux bash ./.github/travis_build.sh
|
||||||
|
- name: 'Check source code formatting'
|
||||||
|
run: |
|
||||||
|
bash ./misc/scripts/check_whitespace_git.sh
|
||||||
|
env UPX_CLANG_FORMAT="$PWD/../deps/bin-upx-20210104/clang-format-10.0.1" make -C src clang-format
|
||||||
|
if ! git diff --quiet; then git diff; exit 1; fi
|
||||||
|
|
||||||
|
job-linux-cmake:
|
||||||
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
|
name: ${{ format('{0} cmake', matrix.os) }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- { os: ubuntu-20.04 }
|
||||||
|
- { os: ubuntu-22.04 }
|
||||||
|
steps:
|
||||||
|
- name: 'Check out code'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with: { submodules: true }
|
||||||
|
- name: 'Build cmake debug-gcc'
|
||||||
|
run: 'make build/debug-gcc'
|
||||||
|
- name: 'Build cmake release-gcc'
|
||||||
|
run: 'make build/release-gcc'
|
||||||
|
- name: 'Build cmake debug-clang'
|
||||||
|
run: 'make build/debug-clang'
|
||||||
|
- name: 'Build cmake release-clang'
|
||||||
|
run: 'make build/release-clang'
|
||||||
|
- name: 'Make artifact'
|
||||||
|
run: |
|
||||||
|
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||||
|
mkdir -p "tmp/artifact/$N"
|
||||||
|
(cd build && cp -ai --parents */upx "../tmp/artifact/$N")
|
||||||
|
(cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||||
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.artifact_name }}
|
||||||
|
path: tmp/artifact
|
||||||
|
- name: 'Run basic tests'
|
||||||
|
run: |
|
||||||
|
make -C build/debug-gcc test
|
||||||
|
make -C build/release-gcc test
|
||||||
|
make -C build/debug-clang test
|
||||||
|
make -C build/release-clang test
|
||||||
|
|
||||||
|
job-macos-cmake:
|
||||||
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
|
name: ${{ format('{0} cmake', matrix.os) }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- { os: macos-11, gcc: gcc-10, gxx: 'g++-10' }
|
||||||
|
# { os: macos-12, gcc: gcc-11, gxx: 'g++-11' } # disable gcc - XCode 14.0 ld bug
|
||||||
|
- { os: macos-12 }
|
||||||
|
steps:
|
||||||
|
- name: 'Check out code'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with: { submodules: true }
|
||||||
|
- name: 'Build cmake debug-gcc'
|
||||||
|
if: ${{ matrix.gcc != '' }}
|
||||||
|
run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
||||||
|
- name: 'Build cmake release-gcc'
|
||||||
|
if: ${{ matrix.gcc != '' }}
|
||||||
|
run: 'make build/release-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
||||||
|
- name: 'Build cmake debug-clang'
|
||||||
|
run: 'make build/debug-clang'
|
||||||
|
- name: 'Build cmake release-clang'
|
||||||
|
run: 'make build/release-clang'
|
||||||
|
- name: 'Make artifact'
|
||||||
|
run: |
|
||||||
|
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||||
|
mkdir -p "tmp/artifact/$N"
|
||||||
|
(cd build && rsync -R -a */upx "../tmp/artifact/$N/")
|
||||||
|
(cd tmp/artifact && gtar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||||
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.artifact_name }}
|
||||||
|
path: tmp/artifact
|
||||||
|
- name: 'Run basic tests'
|
||||||
|
run: |
|
||||||
|
make -C build/debug-clang test
|
||||||
|
make -C build/release-clang test
|
||||||
|
|
||||||
|
job-windows-cmake:
|
||||||
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
|
name: ${{ format('{0} cmake', matrix.os) }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# windows-2019 used to work but got broken with the 20220821.1
|
||||||
|
# runner-image update; disable for now
|
||||||
|
# see https://github.com/actions/runner-images.git
|
||||||
|
####- { os: windows-2019 }
|
||||||
|
- { os: windows-2022 }
|
||||||
|
steps:
|
||||||
|
- name: 'Check out code'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with: { submodules: true }
|
||||||
|
- name: 'Inspect runner-image settings'
|
||||||
|
# see https://github.com/actions/runner-images.git
|
||||||
|
if: ${{ false }}
|
||||||
|
run: |
|
||||||
|
Get-Command bash; Get-Command cmake; Get-Command make
|
||||||
|
bash --version; cmake --version; make --version
|
||||||
|
Get-Command cl -ErrorAction SilentlyContinue
|
||||||
|
- name: 'Build cmake debug'
|
||||||
|
run: 'make build/debug'
|
||||||
|
- name: 'Build cmake release'
|
||||||
|
run: 'make build/release'
|
||||||
|
- name: 'Make artifact'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||||
|
mkdir -p "tmp/artifact/$N"
|
||||||
|
(cd build && cp -ai --parents */*/upx.exe "../tmp/artifact/$N")
|
||||||
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.artifact_name }}
|
||||||
|
path: tmp/artifact
|
||||||
|
- name: 'Run basic tests'
|
||||||
|
run: |
|
||||||
|
cmake --build build/debug --config Debug --target RUN_TESTS
|
||||||
|
cmake --build build/release --config Release --target RUN_TESTS
|
||||||
|
|
||||||
|
job-windows-toolchains:
|
||||||
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
C: ${{ matrix.C }}
|
||||||
|
B: release
|
||||||
|
H: 'd:\a\upx'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- { name: amd64-win64-msvc-14.2, os: windows-2019, C: msvc-14.2-x64, A: x64 }
|
||||||
|
- { name: amd64-win64-msvc-14.3, os: windows-2022, C: msvc-14.3-x64, A: x64 }
|
||||||
|
- { name: i386-win32-msvc-14.2, os: windows-2019, C: msvc-14.2-x86, A: x86 }
|
||||||
|
- { name: i386-win32-msvc-14.3, os: windows-2022, C: msvc-14.3-x86, A: x86 }
|
||||||
|
steps:
|
||||||
|
- name: 'Check out code'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with: { submodules: true }
|
||||||
|
- name: 'Prepare sources'
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
where bash & where cat & where chmod & where cmp & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar & where touch
|
||||||
|
git config --global core.autocrlf input
|
||||||
|
git --version & bash --version
|
||||||
|
cd %H%
|
||||||
|
md build build\%C% deps
|
||||||
|
cd deps
|
||||||
|
git clone --depth=1 https://github.com/upx/upx-testsuite
|
||||||
|
- name: 'Set up Developer Command Prompt'
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
with:
|
||||||
|
arch: ${{ matrix.A }}
|
||||||
|
- name: 'Build'
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
@REM setup directories following the VPATH build in travis_build.sh
|
||||||
|
where cl & where link
|
||||||
|
set BDIR=%H%\build\%C%\%B%
|
||||||
|
md %BDIR% %BDIR%\ucl %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib
|
||||||
|
set DEFS=-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
|
||||||
|
git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt
|
||||||
|
@REM ===== build UCL =====
|
||||||
|
cd %BDIR%\ucl
|
||||||
|
set s=%H%\upx\vendor\ucl
|
||||||
|
cl -MT -J -O2 -W4 %DEFS% -I%s%\include -I%s% -c %s%\src\*.c
|
||||||
|
link -lib -out:ucl.lib *.obj
|
||||||
|
@REM ===== build zlib =====
|
||||||
|
cd %BDIR%\zlib
|
||||||
|
cl -MT -J -O2 -W3 %DEFS% -c %H%\upx\vendor\zlib\*.c
|
||||||
|
link -lib -out:zlib.lib *.obj
|
||||||
|
@REM ===== build UPX =====
|
||||||
|
cd %BDIR%\upx
|
||||||
|
set s=%H%\upx\src
|
||||||
|
cat .GITREV.txt
|
||||||
|
set /p GITREV=<.GITREV.txt
|
||||||
|
cl -MT -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -I%H%\upx\vendor -Feupx.exe %s%\*.cpp %s%\util\*.cpp %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link setargv.obj
|
||||||
|
- name: 'Make artifact'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.name }}
|
||||||
|
mkdir -p "tmp/artifact/$N/$B"
|
||||||
|
cp -ai ../build/$C/$B/upx/upx*.exe "tmp/artifact/$N/$B"
|
||||||
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.artifact_name }}
|
||||||
|
path: tmp/artifact
|
||||||
|
- name: 'Run basic tests'
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = 'stop'
|
||||||
|
$ErrorView = 'NormalView'
|
||||||
|
cd $Env:H\build\$Env:C\$Env:B\upx
|
||||||
|
$Env:UPX = "--no-color --no-progress"
|
||||||
|
.\upx.exe --version
|
||||||
|
.\upx.exe upx.exe -o upx_packed.exe
|
||||||
|
dir *.exe
|
||||||
|
.\upx.exe -l upx_packed.exe
|
||||||
|
.\upx.exe -t upx_packed.exe
|
||||||
|
.\upx_packed.exe --version
|
||||||
|
- name: 'Run test suite'
|
||||||
|
run: |
|
||||||
|
bash ./.github/travis_testsuite_1.sh
|
||||||
|
|
||||||
|
# vim:set ts=2 sw=2 et:
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# see https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues
|
||||||
|
# see https://github.com/actions/stale
|
||||||
|
|
||||||
|
# Automatically closing issues is far from perfect, but then we only
|
||||||
|
# have limited resources and this approach favors issues that people
|
||||||
|
# actually care about.
|
||||||
|
#
|
||||||
|
# also see:
|
||||||
|
# "Should I Stale or Should I Close? An Analysis of a Bot that Closes
|
||||||
|
# Abandoned Issues and Pull Request".
|
||||||
|
# https://igorwiese.com/images/papers/Paper_BotSE_19.pdf
|
||||||
|
|
||||||
|
name: 'Close inactive issues'
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 6 * * 4"
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
close-issues:
|
||||||
|
name: 'Close inactive issues'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v6
|
||||||
|
with:
|
||||||
|
operations-per-run: 300
|
||||||
|
exempt-all-milestones: true
|
||||||
|
exempt-issue-labels: 'blocker,enhancement'
|
||||||
|
days-before-stale: 60
|
||||||
|
days-before-close: 30
|
||||||
|
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Please remove the stale label or add a comment or this issue will be closed in 30 days.'
|
||||||
|
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Please remove the stale label or add a comment or this PR will be closed in 30 days.'
|
||||||
|
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.'
|
||||||
|
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.'
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "devel", "devel4", "devel5", "master" ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ "devel", "devel4", "devel5" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '20 1 * * 3'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'cpp' ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with: { submodules: true }
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
name: 'Close pull requests'
|
||||||
|
on:
|
||||||
|
#pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
close-pull-requests:
|
||||||
|
name: 'Close pull requests'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- name: 'Close pull requests'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh pr list --repo='${{ github.repository }}' --state=open --json=number | jq '.[].number' | xargs -r -n1 -- gh pr close --repo='${{ github.repository }}'
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
/.hg*
|
||||||
|
/.vscode*
|
||||||
|
/Makevars.global*
|
||||||
|
/build*
|
||||||
|
/maint*
|
||||||
|
/vendor*
|
||||||
|
|
||||||
|
.depend
|
||||||
|
GNUmakefile
|
||||||
|
MMakefile
|
||||||
|
Makevars.local*
|
||||||
|
tmp-testsuite*
|
||||||
|
|
||||||
|
*.a
|
||||||
|
*.d
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*.lib
|
||||||
|
*.map
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.out
|
||||||
|
*.py[cdo]
|
||||||
|
*.so
|
||||||
|
*.swp
|
||||||
|
*.ttp
|
||||||
|
|
||||||
|
doc/*.man
|
||||||
|
doc/*.ps
|
||||||
|
doc/*.tex
|
||||||
|
|
||||||
|
src/stub/**/.*-stamp
|
||||||
|
src/stub/**/MMakefile
|
||||||
|
src/stub/tmp*/*.bin
|
||||||
|
src/stub/tmp*/*.bin.bindump
|
||||||
|
src/stub/tmp*/*.bin.disasm
|
||||||
|
src/stub/tmp*/*.d
|
||||||
|
src/stub/tmp*/*.o
|
||||||
|
src/stub/tmp*/*.o.disasm
|
||||||
|
src/stub/tmp*/mips.r3000-*.[is]
|
||||||
|
src/stub/tmp*/mipsel.r3000-*.[is]
|
||||||
|
src/stub/src/**/tmp*/*
|
||||||
|
|
||||||
|
src/stub/tools/armpe/armpe_tester.exe
|
||||||
|
src/stub/tools/armpe/armpe_tester.out
|
||||||
|
|
||||||
|
src/stub/tools/sstrip/amd64-linux-sstrip
|
||||||
|
src/stub/tools/sstrip/i386-linux-sstrip
|
||||||
|
src/stub/tools/sstrip/sstrip
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
[submodule "vendor/doctest"]
|
||||||
|
path = vendor/doctest
|
||||||
|
url = https://github.com/upx/upx-vendor-doctest.git
|
||||||
|
branch = upx-vendor
|
||||||
|
shallow = true
|
||||||
|
[submodule "vendor/lzma-sdk"]
|
||||||
|
path = vendor/lzma-sdk
|
||||||
|
url = https://github.com/upx/upx-vendor-lzma-sdk.git
|
||||||
|
branch = upx-vendor
|
||||||
|
shallow = true
|
||||||
|
[submodule "vendor/ucl"]
|
||||||
|
path = vendor/ucl
|
||||||
|
url = https://github.com/upx/upx-vendor-ucl.git
|
||||||
|
branch = upx-vendor
|
||||||
|
shallow = true
|
||||||
|
[submodule "vendor/zlib"]
|
||||||
|
path = vendor/zlib
|
||||||
|
url = https://github.com/upx/upx-vendor-zlib.git
|
||||||
|
branch = upx-vendor
|
||||||
|
shallow = true
|
||||||
+272
@@ -0,0 +1,272 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
|
||||||
|
|
||||||
|
# compilation config options
|
||||||
|
option(UPX_CONFIG_DISABLE_GITREV "Do not compile with default Git version info.")
|
||||||
|
option(UPX_CONFIG_DISABLE_SANITIZE "Do not compile with default sanitize options.")
|
||||||
|
option(UPX_CONFIG_DISABLE_WERROR "Do not compile with default -Werror option.")
|
||||||
|
# test config options
|
||||||
|
option(UPX_CONFIG_DISABLE_SELF_PACK_TEST "Do not test packing UPX with itself") # see below
|
||||||
|
|
||||||
|
#***********************************************************************
|
||||||
|
# init
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
|
# Disallow in-source builds. Note that you will still have to manually
|
||||||
|
# clean up a few files if you accidentally try an in-source build.
|
||||||
|
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
|
||||||
|
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
if(",${CMAKE_SOURCE_DIR}," STREQUAL ",${CMAKE_BINARY_DIR},")
|
||||||
|
message(FATAL_ERROR "ERROR: In-source builds are not allowed, please use an extra build dir.")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
# determine git revision
|
||||||
|
set(GITREV_SHORT "")
|
||||||
|
set(GITREV_PLUS "")
|
||||||
|
set(GIT_DESCRIBE "")
|
||||||
|
find_package(Git)
|
||||||
|
if(GIT_FOUND AND NOT UPX_CONFIG_DISABLE_GITREV)
|
||||||
|
execute_process(
|
||||||
|
RESULT_VARIABLE result
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" rev-parse --short=12 HEAD
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
OUTPUT_VARIABLE GITREV_SHORT
|
||||||
|
)
|
||||||
|
string(LENGTH "${GITREV_SHORT}" l)
|
||||||
|
if(${result} EQUAL 0 AND ${l} EQUAL 12)
|
||||||
|
execute_process(RESULT_VARIABLE result COMMAND "${GIT_EXECUTABLE}" diff --quiet)
|
||||||
|
if(NOT ${result} EQUAL 0)
|
||||||
|
set(GITREV_PLUS "+")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(GITREV_SHORT "")
|
||||||
|
endif()
|
||||||
|
execute_process(
|
||||||
|
RESULT_VARIABLE result
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" describe --match "v*.*.*" --tags --dirty
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
OUTPUT_VARIABLE GIT_DESCRIBE
|
||||||
|
)
|
||||||
|
if(GIT_DESCRIBE MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-g(.+)$")
|
||||||
|
set(GIT_DESCRIBE "${CMAKE_MATCH_1}-devel.${CMAKE_MATCH_2}+git-${CMAKE_MATCH_3}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git") # extra check
|
||||||
|
set(GITREV_SHORT "")
|
||||||
|
endif()
|
||||||
|
if(GITREV_SHORT)
|
||||||
|
message(STATUS "UPX_VERSION_GITREV = \"${GITREV_SHORT}${GITREV_PLUS}\"")
|
||||||
|
if(GIT_DESCRIBE)
|
||||||
|
message(STATUS "UPX_VERSION_GIT_DESCRIBE = \"${GIT_DESCRIBE}\"")
|
||||||
|
endif()
|
||||||
|
elseif(UPX_CONFIG_DISABLE_GITREV)
|
||||||
|
message(STATUS "UPX_VERSION_GITREV: disabled")
|
||||||
|
else()
|
||||||
|
message(STATUS "UPX_VERSION_GITREV: not set")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(upx VERSION 4.0.1 LANGUAGES C CXX)
|
||||||
|
|
||||||
|
# set default build type to "Release"
|
||||||
|
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
if(is_multi_config)
|
||||||
|
set(c "${CMAKE_CONFIGURATION_TYPES}")
|
||||||
|
list(INSERT c 0 "Release")
|
||||||
|
list(INSERT c 1 "Debug")
|
||||||
|
if (CMAKE_BUILD_TYPE)
|
||||||
|
list(INSERT c 0 "${CMAKE_BUILD_TYPE}")
|
||||||
|
endif()
|
||||||
|
list(REMOVE_DUPLICATES c)
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES "${c}" CACHE STRING "List of supported configuration types." FORCE)
|
||||||
|
elseif(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#***********************************************************************
|
||||||
|
# targets and compilation flags
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
|
file(GLOB ucl_SOURCES "vendor/ucl/src/*.c")
|
||||||
|
list(SORT ucl_SOURCES)
|
||||||
|
add_library(upx_vendor_ucl STATIC ${ucl_SOURCES})
|
||||||
|
set_property(TARGET upx_vendor_ucl PROPERTY C_STANDARD 11)
|
||||||
|
|
||||||
|
file(GLOB zlib_SOURCES "vendor/zlib/*.c")
|
||||||
|
list(SORT zlib_SOURCES)
|
||||||
|
add_library(upx_vendor_zlib STATIC ${zlib_SOURCES})
|
||||||
|
set_property(TARGET upx_vendor_zlib PROPERTY C_STANDARD 11)
|
||||||
|
|
||||||
|
file(GLOB upx_SOURCES "src/*.cpp" "src/util/*.cpp")
|
||||||
|
list(SORT upx_SOURCES)
|
||||||
|
add_executable(upx ${upx_SOURCES})
|
||||||
|
#target_compile_features(upx PRIVATE cxx_std_14)
|
||||||
|
set_property(TARGET upx PROPERTY CXX_STANDARD 14)
|
||||||
|
target_link_libraries(upx upx_vendor_ucl upx_vendor_zlib)
|
||||||
|
|
||||||
|
if(UPX_CONFIG_DISABLE_WERROR)
|
||||||
|
set(warn_Werror "")
|
||||||
|
set(warn_WX "")
|
||||||
|
else()
|
||||||
|
set(warn_Werror -Werror)
|
||||||
|
set(warn_WX -WX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
# use -O2 instead of -O3 to reduce code size
|
||||||
|
string(REGEX REPLACE "(^| )-O3( |$$)" "\\1-O2\\2" a "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
|
string(REGEX REPLACE "(^| )-O3( |$$)" "\\1-O2\\2" b "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "${a}" CACHE STRING "Flags used by the C compiler during RELEASE builds." FORCE)
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "${b}" CACHE STRING "Flags used by the CXX compiler during RELEASE builds." FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
# disable silly warnings about using "deprecated" POSIX functions like fopen()
|
||||||
|
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
|
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
else()
|
||||||
|
# protect against security threats caused by misguided compiler "optimizations"
|
||||||
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
add_definitions(-fno-delete-null-pointer-checks)
|
||||||
|
endif()
|
||||||
|
add_definitions(-fno-strict-aliasing -fno-strict-overflow -funsigned-char)
|
||||||
|
# disable overambitious auto-vectorization until this actually gains something
|
||||||
|
add_definitions(-fno-tree-vectorize)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(upx_sanitize_target t)
|
||||||
|
if(NOT UPX_CONFIG_DISABLE_SANITIZE AND NOT MSVC)
|
||||||
|
# default sanitizer for Debug builds
|
||||||
|
target_compile_options(${t} PRIVATE $<$<CONFIG:Debug>:-fsanitize=undefined -fsanitize-undefined-trap-on-error -fstack-protector-all>)
|
||||||
|
# default sanitizer for Release builds
|
||||||
|
target_compile_options(${t} PRIVATE $<$<CONFIG:Release>:-fstack-protector>)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
set(t upx_vendor_ucl)
|
||||||
|
target_include_directories(${t} PRIVATE vendor/ucl/include vendor/ucl)
|
||||||
|
upx_sanitize_target(${t})
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_options(${t} PRIVATE -J -W4 ${warn_WX})
|
||||||
|
else()
|
||||||
|
target_compile_options(${t} PRIVATE -Wall -Wextra -Wvla ${warn_Werror})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(t upx_vendor_zlib)
|
||||||
|
upx_sanitize_target(${t})
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_options(${t} PRIVATE -DHAVE_STDARG_H -DHAVE_VSNPRINTF -J -W3 ${warn_WX})
|
||||||
|
else()
|
||||||
|
target_compile_options(${t} PRIVATE -DHAVE_STDARG_H -DHAVE_UNISTD_H -DHAVE_VSNPRINTF)
|
||||||
|
# clang-15: -Wno-strict-prototypes is needed to silence the new -Wdeprecated-non-prototype warning
|
||||||
|
target_compile_options(${t} PRIVATE -Wall -Wextra -Wvla -Wno-strict-prototypes ${warn_Werror})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(t upx)
|
||||||
|
target_include_directories(${t} PRIVATE vendor)
|
||||||
|
target_compile_definitions(${t} PRIVATE $<$<CONFIG:Debug>:DEBUG=1>)
|
||||||
|
if(GITREV_SHORT)
|
||||||
|
target_compile_definitions(${t} PRIVATE UPX_VERSION_GITREV="${GITREV_SHORT}${GITREV_PLUS}")
|
||||||
|
if(GIT_DESCRIBE)
|
||||||
|
target_compile_definitions(${t} PRIVATE UPX_VERSION_GIT_DESCRIBE="${GIT_DESCRIBE}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
upx_sanitize_target(${t})
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_options(${t} PRIVATE -EHsc -J -W4 ${warn_WX})
|
||||||
|
else()
|
||||||
|
target_compile_options(${t} PRIVATE
|
||||||
|
-Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith
|
||||||
|
-Wshadow -Wvla -Wwrite-strings ${warn_Werror}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#***********************************************************************
|
||||||
|
# "make test"
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
add_test(NAME upx-version COMMAND upx --version)
|
||||||
|
add_test(NAME upx-help COMMAND upx --help)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_CROSSCOMPILING AND NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST)
|
||||||
|
# NOTE: these tests can only work if the host executable format is supported by UPX!
|
||||||
|
function(upx_add_test)
|
||||||
|
set(name ${ARGV0})
|
||||||
|
list(REMOVE_AT ARGV 0)
|
||||||
|
add_test(NAME ${name} COMMAND ${ARGV})
|
||||||
|
set_tests_properties(${name} PROPERTIES RUN_SERIAL TRUE) # run these tests sequentially
|
||||||
|
endfunction()
|
||||||
|
set(exe ${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
|
set(upx_self_exe "$<TARGET_FILE:upx>")
|
||||||
|
set(fo "--force-overwrite")
|
||||||
|
upx_add_test(upx-self-pack upx -3 ${upx_self_exe} ${fo} -o upx-packed${exe})
|
||||||
|
upx_add_test(upx-self-pack-n2b upx -3 --nrv2b ${upx_self_exe} ${fo} -o upx-packed-n2b${exe})
|
||||||
|
upx_add_test(upx-self-pack-n2d upx -3 --nrv2d ${upx_self_exe} ${fo} -o upx-packed-n2d${exe})
|
||||||
|
upx_add_test(upx-self-pack-n2e upx -3 --nrv2e ${upx_self_exe} ${fo} -o upx-packed-n2e${exe})
|
||||||
|
upx_add_test(upx-self-pack-lzma upx -3 --lzma ${upx_self_exe} ${fo} -o upx-packed-lzma${exe})
|
||||||
|
upx_add_test(upx-list upx -l upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe})
|
||||||
|
upx_add_test(upx-fileinfo upx --fileinfo upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe})
|
||||||
|
upx_add_test(upx-test upx -t upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe})
|
||||||
|
upx_add_test(upx-unpack upx -d upx-packed${exe} ${fo} -o upx-unpacked${exe})
|
||||||
|
upx_add_test(upx-run-unpacked ./upx-unpacked${exe} --version-short)
|
||||||
|
upx_add_test(upx-run-packed ./upx-packed${exe} --version-short)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#***********************************************************************
|
||||||
|
# "make install"
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
|
# installation prefix and directories
|
||||||
|
if(NOT CMAKE_INSTALL_PREFIX)
|
||||||
|
message(FATAL_ERROR "ERROR: CMAKE_INSTALL_PREFIX is not defined.")
|
||||||
|
endif()
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
if(DEFINED CMAKE_INSTALL_FULL_BINDIR)
|
||||||
|
install(TARGETS upx DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
|
||||||
|
install(FILES
|
||||||
|
COPYING LICENSE NEWS README THANKS doc/upx-doc.html doc/upx-doc.txt
|
||||||
|
DESTINATION "${CMAKE_INSTALL_FULL_DOCDIR}"
|
||||||
|
)
|
||||||
|
install(FILES doc/upx.1 DESTINATION "${CMAKE_INSTALL_FULL_MANDIR}/man1")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#***********************************************************************
|
||||||
|
# finally print some info about the build configuration
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/maint/src/CMakeLists.extra.txt")
|
||||||
|
include("${CMAKE_CURRENT_SOURCE_DIR}/maint/src/CMakeLists.extra.txt")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(print_var v)
|
||||||
|
if(${v})
|
||||||
|
message(STATUS "${v} = ${${v}}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
print_var(CMAKE_BUILD_TYPE)
|
||||||
|
print_var(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
print_var(CMAKE_INSTALL_PREFIX)
|
||||||
|
print_var(CMAKE_CROSSCOMPILING)
|
||||||
|
print_var(CMAKE_C_COMPILER_ID)
|
||||||
|
print_var(CMAKE_C_COMPILER_VERSION)
|
||||||
|
print_var(CMAKE_C_COMPILER_ARCHITECTURE_ID)
|
||||||
|
print_var(CMAKE_C_PLATFORM_ID)
|
||||||
|
print_var(CMAKE_C_COMPILER_ABI)
|
||||||
|
print_var(CMAKE_CXX_COMPILER_ID)
|
||||||
|
print_var(CMAKE_CXX_COMPILER_VERSION)
|
||||||
|
print_var(CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
|
||||||
|
print_var(CMAKE_CXX_PLATFORM_ID)
|
||||||
|
print_var(CMAKE_CXX_COMPILER_ABI)
|
||||||
|
if (CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release)$")
|
||||||
|
message(WARNING "WARNING: unsupported CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}; please use \"Debug\" or \"Release\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# vim:set ft=cmake ts=4 sw=4 tw=0 et:
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
|||||||
General Public License applies to most of the Free Software
|
General Public License applies to most of the Free Software
|
||||||
Foundation's software and to any other program whose authors commit to
|
Foundation's software and to any other program whose authors commit to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
your programs, too.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
|||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
|||||||
License. (Exception: if the Program itself is interactive but
|
License. (Exception: if the Program itself is interactive but
|
||||||
does not normally print such an announcement, your work based on
|
does not normally print such an announcement, your work based on
|
||||||
the Program is not required to print an announcement.)
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
These requirements apply to the modified work as a whole. If
|
||||||
identifiable sections of that work are not derived from the Program,
|
identifiable sections of that work are not derived from the Program,
|
||||||
and can be reasonably considered independent and separate works in
|
and can be reasonably considered independent and separate works in
|
||||||
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
|||||||
access to copy the source code from the same place counts as
|
access to copy the source code from the same place counts as
|
||||||
distribution of the source code, even though third parties are not
|
distribution of the source code, even though third parties are not
|
||||||
compelled to copy the source along with the object code.
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
except as expressly provided under this License. Any attempt
|
except as expressly provided under this License. Any attempt
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
@@ -225,7 +225,7 @@ impose that choice.
|
|||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
This section is intended to make thoroughly clear what is believed to
|
||||||
be a consequence of the rest of this License.
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
original copyright holder who places the Program under this License
|
original copyright holder who places the Program under this License
|
||||||
@@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|||||||
POSSIBILITY OF SUCH DAMAGES.
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
|||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) 19yy <name of author>
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
|||||||
This General Public License does not permit incorporating your program into
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
consider it more useful to permit linking proprietary applications with the
|
consider it more useful to permit linking proprietary applications with the
|
||||||
library. If this is what you want to do, use the GNU Library General
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
|
|||||||
@@ -1,36 +1,89 @@
|
|||||||
# Toplevel Makefile for UPX
|
#
|
||||||
|
# UPX top-level Makefile - needs GNU make and CMake >= 3.13
|
||||||
|
#
|
||||||
|
|
||||||
SHELL = /bin/sh
|
# NOTE: if you only have CMake 3.10 then you can invoke cmake manually like this:
|
||||||
|
# mkdir -p build/release
|
||||||
|
# cd build/release
|
||||||
|
# cmake ../..
|
||||||
|
# cmake --build .
|
||||||
|
|
||||||
srcdir = .
|
CMAKE = cmake
|
||||||
top_srcdir = .
|
UPX_CMAKE_BUILD_FLAGS += --parallel
|
||||||
|
ifneq ($(VERBOSE),)
|
||||||
|
UPX_CMAKE_BUILD_FLAGS += --verbose
|
||||||
|
endif
|
||||||
|
|
||||||
|
# check git submodules
|
||||||
|
ifeq ($(wildcard ./vendor/doctest/doctest/.),)
|
||||||
|
$(error ERROR: missing git submodule; run 'git submodule update --init')
|
||||||
|
endif
|
||||||
|
ifeq ($(wildcard ./vendor/lzma-sdk/C/.),)
|
||||||
|
$(error ERROR: missing git submodule; run 'git submodule update --init')
|
||||||
|
endif
|
||||||
|
ifeq ($(wildcard ./vendor/ucl/include/.),)
|
||||||
|
$(error ERROR: missing git submodule; run 'git submodule update --init')
|
||||||
|
endif
|
||||||
|
ifeq ($(wildcard ./vendor/zlib/crc32.c),)
|
||||||
|
$(error ERROR: missing git submodule; run 'git submodule update --init')
|
||||||
|
endif
|
||||||
|
|
||||||
default:
|
#***********************************************************************
|
||||||
@echo "UPX info: please choose a target for 'make'"
|
# default
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
all mostlyclean clean distclean maintainer-clean:
|
__check_cache = $(if $(wildcard $1/CMakeCache.txt),@true,)
|
||||||
$(MAKE) -C src/stub/util/sstrip $@
|
run_config = $(call __check_cache,$1) $(CMAKE) -S . -B $1 $(UPX_CMAKE_CONFIG_FLAGS) -DCMAKE_BUILD_TYPE=$2
|
||||||
$(MAKE) -C src/stub $@
|
run_build = $(CMAKE) --build $1 $(UPX_CMAKE_BUILD_FLAGS) --config $2
|
||||||
$(MAKE) -C src $@
|
|
||||||
$(MAKE) -C doc $@
|
|
||||||
|
|
||||||
dist: distclean
|
.DEFAULT_GOAL = build/release
|
||||||
false
|
|
||||||
|
|
||||||
zip:
|
build/debug: PHONY
|
||||||
cd .. && rm -f upx-current.zip && zip -r upx-current.zip upx
|
$(call run_config,$@,Debug)
|
||||||
|
$(call run_build,$@,Debug)
|
||||||
|
|
||||||
cvs-admin-ko:
|
build/release: PHONY
|
||||||
cvs admin -ko .
|
$(call run_config,$@,Release)
|
||||||
cvs update -P -d
|
$(call run_build,$@,Release)
|
||||||
|
|
||||||
ChangeLog:
|
# shortcuts
|
||||||
perl $(srcdir)/scripts/cvs2cl.pl --utc -f ChangeLog.cvs
|
debug: build/debug
|
||||||
|
release: build/release
|
||||||
|
|
||||||
|
#***********************************************************************
|
||||||
|
# some pre-defined build configurations
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
# force building with gcc/g++
|
||||||
.PHONY: dist cvs-admin-ko ChangeLog
|
build/%-gcc: export CC=gcc
|
||||||
|
build/%-gcc: export CXX=g++
|
||||||
|
build/debug-gcc: PHONY
|
||||||
|
$(call run_config,$@,Debug)
|
||||||
|
$(call run_build,$@,Debug)
|
||||||
|
build/release-gcc: PHONY
|
||||||
|
$(call run_config,$@,Release)
|
||||||
|
$(call run_build,$@,Release)
|
||||||
|
|
||||||
.NOEXPORT:
|
# force building with clang/clang++
|
||||||
|
build/%-clang: export CC=clang
|
||||||
|
build/%-clang: export CXX=clang++
|
||||||
|
build/debug-clang: PHONY
|
||||||
|
$(call run_config,$@,Debug)
|
||||||
|
$(call run_build,$@,Debug)
|
||||||
|
build/release-clang: PHONY
|
||||||
|
$(call run_config,$@,Release)
|
||||||
|
$(call run_build,$@,Release)
|
||||||
|
|
||||||
|
# cross compiler: Windows mingw-w64
|
||||||
|
build/%-cross-mingw64: export CC=x86_64-w64-mingw32-gcc
|
||||||
|
build/%-cross-mingw64: export CXX=x86_64-w64-mingw32-g++
|
||||||
|
# disable sanitize to avoid link errors on GitHub CI
|
||||||
|
build/%-cross-mingw64: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1
|
||||||
|
build/debug-cross-mingw64: PHONY
|
||||||
|
$(call run_config,$@,Debug)
|
||||||
|
$(call run_build,$@,Debug)
|
||||||
|
build/release-cross-mingw64: PHONY
|
||||||
|
$(call run_config,$@,Release)
|
||||||
|
$(call run_build,$@,Release)
|
||||||
|
|
||||||
|
.PHONY: PHONY
|
||||||
|
|||||||
@@ -2,16 +2,229 @@
|
|||||||
User visible changes for UPX
|
User visible changes for UPX
|
||||||
==================================================================
|
==================================================================
|
||||||
|
|
||||||
[ UNSTABLE BETA VERSION - please see README.1ST for some more info ]
|
Changes in 4.0.1 (16 Nov 2022):
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/8
|
||||||
|
|
||||||
|
Changes in 4.0.0 (28 Oct 2022):
|
||||||
|
* Switch to semantic versioning
|
||||||
|
* SECURITY NOTES: emphasize the security context in the docs
|
||||||
|
* Support easy building from source code with CMake
|
||||||
|
* Support easy rebuilding the stubs from source with Podman/Docker
|
||||||
|
* Add integrated doctest C++ testing framework
|
||||||
|
* Add support for EFI files (PE x86; Kornel Pal)
|
||||||
|
* win32/pe and win64/pe: set correct SizeOfHeaders in the PE header
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/6
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/7
|
||||||
|
|
||||||
|
Changes in 3.96 (23 Jan 2020):
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/5
|
||||||
|
|
||||||
|
Changes in 3.95 (26 Aug 2018):
|
||||||
|
* Flag --android-shlib to work around bad design in Android
|
||||||
|
* Flag --force-pie when ET_DYN main program is not marked as DF_1_PIE
|
||||||
|
* Better compatibility with varying layout of address space on Linux
|
||||||
|
* Support for 4 PT_LOAD layout in ELF generated by binutils-2.31
|
||||||
|
* bug fixes, particularly better diagnosis of malformed input
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/4
|
||||||
|
|
||||||
|
Changes in 3.94 (12 May 2017):
|
||||||
|
* Add support for arm64-linux (aka "aarch64").
|
||||||
|
* Add support for --lzma compression on 64-bit PowerPC (Thierry Fauck).
|
||||||
|
* For Mach, "upx -d" will unpack a prefix of the file (and warn).
|
||||||
|
* Various improvements to the ELF formats.
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/3
|
||||||
|
|
||||||
|
Changes in 3.93 (29 Jan 2017):
|
||||||
|
* Fixed some win32/pe and win64/pe regressions introduced in 3.92
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/2
|
||||||
|
|
||||||
|
Changes in 3.92 (11 Dec 2016):
|
||||||
|
* INFO: UPX has moved to GitHub - the new home page is https://upx.github.io
|
||||||
|
* IMPORTANT: all PE formats: internal changes: reunited the diverged source
|
||||||
|
files - please report all regressions into the bug tracker and try UPX 3.91
|
||||||
|
in case of problems.
|
||||||
|
* Support Apple MacOS 10.12 "Sierra", including more-robust de-compression.
|
||||||
|
* Explicitly diagnose Go-language bad PT_LOAD; recommend hemfix.c.
|
||||||
|
https://sourceforge.net/p/upx/bugs/195/ https://github.com/pwaller/goupx
|
||||||
|
* Fix CERT-FI Case 829767 UPX command line tools segfaults.
|
||||||
|
Received by UPX Team on 2015-May-08; originally reported
|
||||||
|
by Codenomicon to NCSC-FI on 2015-01-08.
|
||||||
|
The vulnerabilities were discovered by Joonas Kuorilehto and
|
||||||
|
Antti Häyrynen from Codenomicon.
|
||||||
|
* bug fixes - see https://github.com/upx/upx/milestone/1
|
||||||
|
|
||||||
|
Changes in 3.91 (30 Sep 2013):
|
||||||
|
* Added experimental support for Windows 64-bit PE files, based on
|
||||||
|
work by Stefan Widmann. Please use for testing only!
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
==================================================================
|
||||||
|
|
||||||
|
Changes in 3.09 (18 Feb 2013):
|
||||||
|
* New option --preserve-build-id for GNU ELF.
|
||||||
|
* Allow for code signing and LC_UUID on Mac OS X executables.
|
||||||
|
* Allow non-contiguous LC_SEGMENTs and 0==.vmsize for Mach-O.
|
||||||
|
* Allow zero-filled final page in PackUnix::canUnpack().
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.08 (12 Dec 2011):
|
||||||
|
* Fix allocation in runtime stub for darwin.macho-entry (i386 and amd64).
|
||||||
|
* Compress shared library on ELF i386 only [ld.so threatens even this case].
|
||||||
|
* Attempt to support ELF on QNX 6.3.0 for armel (experimental).
|
||||||
|
* Better diagnostic when ELF -fPIC is needed.
|
||||||
|
* PT_NOTE improvements for *BSD.
|
||||||
|
* Preserve more ELF .e_flags on ARM.
|
||||||
|
* Minor code improvements for ELF stubs.
|
||||||
|
* Defend against another flavor of corrupt PE header.
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.07 (08 Sep 2010):
|
||||||
|
* win32/pe: fixed relocation handling for files with *no* TLS callbacks
|
||||||
|
[severe bug introduced in 3.06]
|
||||||
|
|
||||||
|
Changes in 3.06 (04 Sep 2010):
|
||||||
|
* win32/pe: TLS callback support contributed by Stefan Widmann. Thanks!
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.05 (27 Apr 2010):
|
||||||
|
* i386-linux and amd64-linux support shared libraries (DT_INIT must
|
||||||
|
exist, all info needed by runtime loader must be first in .text, etc.)
|
||||||
|
* Linux /proc/self/exe now is preserved by default, by leaving behind
|
||||||
|
one page. New compress-time option --unmap-all-pages is available.
|
||||||
|
* Withdraw support for shared libraries on Darwin (Apple Mac OS X)
|
||||||
|
because upx does not understand enough about .dylib.
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.04 (27 Sep 2009):
|
||||||
|
* new format Mach/AMD64 supports 64-bit programs on Apple Macintosh.
|
||||||
|
* new formats Dylib/i386 and Dylib/ppc32 support shared libraries
|
||||||
|
[such as browser plugins] on Darwin (Apple Macintosh). An existing
|
||||||
|
-init function (LC_ROUTINES command) is required.
|
||||||
|
* new format vmlinuz/armel for Debian NSLU2 (etc.) linux kernel
|
||||||
|
* bvmlinuz boot protocol 2.08 for 386 Linux kernel
|
||||||
|
* Extended ABI version 4 for armel-eabi ARM Linux ELF
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.03 (27 Apr 2008):
|
||||||
|
* implement cache flushing for PowerPC (esp. model 440)
|
||||||
|
* fix cache flushing on MIPS (>3 MiB compressed, or with holes)
|
||||||
|
* fix MIPS big-endian
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.02 (16 Dec 2007):
|
||||||
|
* fix unmapping on arm-linux.elf
|
||||||
|
* fix error checking in mmap for i386-linux.elf [triggered by -fPIE]
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.01 (31 Jul 2007):
|
||||||
|
* new options --no-mode, --no-owner and --no-time to disable preservation
|
||||||
|
of mode (file permissions), file ownership and timestamps.
|
||||||
|
* dos/exe: fixed an incorrect error message caused by a bug in
|
||||||
|
relocation handling
|
||||||
|
* new format linux/mipsel supports ELF on [32-bit] R3000
|
||||||
|
* fix argv[0] on PowerPC with --lzma
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 3.00 (27 Apr 2007):
|
||||||
|
* watcom/le & tmt/adam: fixed a problem when using certain filters
|
||||||
|
|
||||||
|
Changes in 2.93 beta (08 Mar 2007):
|
||||||
|
* new formats Mach/i386 and Mach/fat support Mac OS X i686 and
|
||||||
|
Universal binaries [i686 and PowerPC only]
|
||||||
|
* dos/exe: LZMA is now also supported for 16-bit dos/exe. Please note that
|
||||||
|
you have to explicitly use '--lzma' even for '--ultra-brute' here
|
||||||
|
because runtime decompression is about 30 times slower than NRV -
|
||||||
|
which is really noticeable on old machines.
|
||||||
|
* dos/exe: fixed a rarely occurring bug in relocation handling
|
||||||
|
* win32/pe & arm/pe: better icon compression handling
|
||||||
|
|
||||||
|
Changes in 2.92 beta (23 Jan 2007):
|
||||||
|
* new option '--ultra-brute' which tries even more variants
|
||||||
|
* slightly improved compression ratio for some files when
|
||||||
|
using '--brute' or '--ultra-brute'
|
||||||
|
* bug fixes
|
||||||
|
|
||||||
|
Changes in 2.91 beta (29 Nov 2006):
|
||||||
|
* assorted bug fixes
|
||||||
|
* arm/pe: fix "missing" icon & version info resource problem for wince 5
|
||||||
|
* win32/pe & arm/pe: added option --compress-icons=3 to compress all icons
|
||||||
|
|
||||||
|
Changes in 2.90 beta (08 Oct 2006):
|
||||||
|
* LZMA algorithm support for most of the 32-bit and 64-bit file formats;
|
||||||
|
use new option '--lzma' to enable
|
||||||
|
* new format: BSD/elf386 supporting FreeBSD, NetBSD and OpenBSD
|
||||||
|
via auto-detection of PT_NOTE or EI_OSABI
|
||||||
|
* arm/pe: all the NRV compression methods are now supported
|
||||||
|
(only NRV2D is missing in thumb mode)
|
||||||
|
* linux/elf386, linux/ElfAMD: remember /proc/self/exe in environment
|
||||||
|
* major source code changes: the runtime decompression stubs are now
|
||||||
|
built from internal ELF objects
|
||||||
|
|
||||||
|
==================================================================
|
||||||
|
|
||||||
|
Changes in 2.03 (07 Nov 2006):
|
||||||
|
* bvmlinuz/386: fix for kernels not at 0x100000; also allow x86_64
|
||||||
|
* linux/elf386: work around Linux kernel bug (0-length .bss needs PF_W)
|
||||||
|
|
||||||
|
Changes in 2.02 (13 Aug 2006):
|
||||||
|
* linux/386: work around Linux kernel bug (".bss" requires PF_W)
|
||||||
|
* linux/ppc32, mach/ppc32: compressed programs now work on a 405 CPU
|
||||||
|
* vmlinuz/386: fixed zlib uncompression problem on DOS
|
||||||
|
|
||||||
|
Changes in 2.01 (06 Jun 2006):
|
||||||
|
* arm/pe: better DLL support
|
||||||
|
* dos/exe: device driver support added
|
||||||
|
* linux/386: Fix --force-execve for PaX, grSecurity, and strict SELinux.
|
||||||
|
/tmp must support execve(); therefore /tmp cannot be mounted 'noexec'.
|
||||||
|
* win32/pe & arm/pe: added new option '--keep-resource=' for
|
||||||
|
excluding selected resources from compression
|
||||||
|
|
||||||
|
Changes in 2.00 (27 Apr 2006):
|
||||||
|
* linux/386: the stub now prints an error message if some strict
|
||||||
|
SELinux mode does prevent runtime decompression and execution
|
||||||
|
(for a fully SELinux-compatible but otherwise inferior compression
|
||||||
|
format you can use the '--force-execve' option)
|
||||||
|
* linux/386: worked around a problem where certain Linux kernels
|
||||||
|
clobber the %ebx register during a syscall
|
||||||
|
* win32/pe: disable filters for files with broken PE headers
|
||||||
|
|
||||||
|
Changes in 1.96 beta (13 Apr 2006):
|
||||||
|
* arm/pe: added filter support
|
||||||
|
* win32/pe: removed an unnecessary check so that Delphi 2006 and
|
||||||
|
Digital Mars C++ programs finally are supported
|
||||||
|
|
||||||
|
Changes in 1.95 beta (09 Apr 2006):
|
||||||
|
* arm/pe: added DLL support
|
||||||
|
* arm/pe: added thumb mode stub support
|
||||||
|
* arm/pe: added unpacking support
|
||||||
|
* win32/pe: really worked around R6002 runtime errors
|
||||||
|
|
||||||
|
Changes in 1.94 beta (11 Mar 2006):
|
||||||
|
* new format: added support for arm/pe (ARM executables running on WinCE)
|
||||||
|
* new format: added support for linux elf/amd64
|
||||||
|
* new format: added support for linux elf/ppc32
|
||||||
|
* new format: added support for mach/ppc32 (Apple Mac OS X)
|
||||||
|
* win32/pe: hopefully working "load config" support
|
||||||
|
* win32/pe: R6002 runtime errors worked around
|
||||||
|
* win32/pe: the stub now clears the dirty stack
|
||||||
|
|
||||||
|
Changes in 1.93 beta (07 Feb 2005):
|
||||||
|
* vmlinuz/386: fixes to support more kernels
|
||||||
|
|
||||||
|
Changes in 1.92 beta (20 Jul 2004):
|
||||||
|
* win32/pe: added option '--strip-loadconf' to strip the SEH load
|
||||||
|
config section [NOTE: this option is obsolete since UPX 1.94]
|
||||||
|
* win32/pe: try to detect .NET (win32/net) files [not yet supported by UPX]
|
||||||
|
* vmlinux/386: new format that directly supports building Linux kernels
|
||||||
|
* source code: now compiles cleanly under Win64
|
||||||
|
|
||||||
Changes in 1.91 beta (30 Jun 2004):
|
Changes in 1.91 beta (30 Jun 2004):
|
||||||
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
|
|
||||||
* djgpp2/coff: added support for recent binutils versions
|
* djgpp2/coff: added support for recent binutils versions
|
||||||
* linux/elf386, linux/sh386: lots of improvements
|
* linux/elf386, linux/sh386: lots of improvements
|
||||||
* vmlinuz/386: added support for recent kernels
|
* vmlinuz/386: added support for recent kernels
|
||||||
* watcom/le: don't crash on files without relocations
|
* watcom/le: don't crash on files without relocations
|
||||||
* win32/pe: stricter checks of some PE values
|
* win32/pe: stricter checks of some PE values
|
||||||
* option `--brute' now implies `--crp-ms=999999'.
|
* option '--brute' now implies '--crp-ms=999999'.
|
||||||
* source code: much improved portability using ACC, the
|
* source code: much improved portability using ACC, the
|
||||||
Automatic Compiler Configuration
|
Automatic Compiler Configuration
|
||||||
* source code: compile fixes for strict ISO C++ compilers
|
* source code: compile fixes for strict ISO C++ compilers
|
||||||
@@ -19,17 +232,15 @@ Changes in 1.91 beta (30 Jun 2004):
|
|||||||
* re-synced with upx 1.25 branch
|
* re-synced with upx 1.25 branch
|
||||||
|
|
||||||
Changes in 1.90 beta (11 Nov 2002):
|
Changes in 1.90 beta (11 Nov 2002):
|
||||||
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
|
|
||||||
* implemented several new options for finer compression control:
|
* implemented several new options for finer compression control:
|
||||||
`--all-methods', `--all-filters' and `--brute'
|
'--all-methods', '--all-filters' and '--brute'
|
||||||
* ps1/exe: new format - UPX now supports PlayStation One programs
|
* ps1/exe: new format - UPX now supports PlayStation One programs
|
||||||
* linux/386: added the option `--force-execve'
|
* linux/386: added the option '--force-execve'
|
||||||
* vmlinuz/386: better kernel detection and sanity checks
|
* vmlinuz/386: better kernel detection and sanity checks
|
||||||
* re-synced with upx 1.24 branch
|
* re-synced with upx 1.24 branch
|
||||||
* documentation updates
|
* documentation updates
|
||||||
|
|
||||||
Changes in 1.11 beta (20 Dec 2000):
|
Changes in 1.11 beta (20 Dec 2000):
|
||||||
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
|
|
||||||
* vmlinuz/386: new format - UPX now supports bootable linux kernels
|
* vmlinuz/386: new format - UPX now supports bootable linux kernels
|
||||||
* linux/elf386: added the new ELF direct-to-memory executable format - no
|
* linux/elf386: added the new ELF direct-to-memory executable format - no
|
||||||
more temp files are needed for decompression!
|
more temp files are needed for decompression!
|
||||||
@@ -69,9 +280,9 @@ Changes in 1.22 (27 Jun 2002)
|
|||||||
Digital Mars C++ and Watcom C++
|
Digital Mars C++ and Watcom C++
|
||||||
|
|
||||||
Changes in 1.21 (01 Jun 2002)
|
Changes in 1.21 (01 Jun 2002)
|
||||||
* New option `--crp-ms=' for slightly better compression at the cost
|
* New option '--crp-ms=' for slightly better compression at the cost
|
||||||
of higher memory requirements during compression.
|
of higher memory requirements during compression.
|
||||||
Try `upx --best --crp-ms=100000'. See the docs for more info.
|
Try 'upx --best --crp-ms=100000'. See the docs for more info.
|
||||||
* source code: portability fixes
|
* source code: portability fixes
|
||||||
* source code: compile fixes for g++ 3.0 and g++ 3.1
|
* source code: compile fixes for g++ 3.0 and g++ 3.1
|
||||||
|
|
||||||
@@ -85,7 +296,6 @@ Changes in 1.20 (23 May 2001)
|
|||||||
our unstable development releases 1.1x and 1.9x]
|
our unstable development releases 1.1x and 1.9x]
|
||||||
|
|
||||||
Changes in 1.08 (30 Apr 2001)
|
Changes in 1.08 (30 Apr 2001)
|
||||||
* INFO: http://upx.sourceforge.net now is the new permanent UPX home page
|
|
||||||
* new native port to atari/tos
|
* new native port to atari/tos
|
||||||
* win32/pe: shortened the identstring
|
* win32/pe: shortened the identstring
|
||||||
* source code: portability fixes - UPX now builds cleanly under m68k CPUs
|
* source code: portability fixes - UPX now builds cleanly under m68k CPUs
|
||||||
@@ -110,7 +320,7 @@ Changes in 1.05 (24 Jan 2001)
|
|||||||
at the unstable UPX 1.1x beta versions for that)
|
at the unstable UPX 1.1x beta versions for that)
|
||||||
|
|
||||||
Changes in 1.04 (19 Dec 2000)
|
Changes in 1.04 (19 Dec 2000)
|
||||||
* dos/exe: fixed an internal error when using `--no-reloc'
|
* dos/exe: fixed an internal error when using '--no-reloc'
|
||||||
* win32/pe: fixed a rare bug in the relocation handling code
|
* win32/pe: fixed a rare bug in the relocation handling code
|
||||||
* some tunings for the default compression level
|
* some tunings for the default compression level
|
||||||
|
|
||||||
@@ -118,7 +328,7 @@ Changes in 1.03 (30 Nov 2000)
|
|||||||
* linked with a new version of the NRV compression library:
|
* linked with a new version of the NRV compression library:
|
||||||
- improved compression ratio a little bit
|
- improved compression ratio a little bit
|
||||||
- overall significantly faster compression
|
- overall significantly faster compression
|
||||||
- much faster when using high compression levels like `-9' or `--best'
|
- much faster when using high compression levels like '-9' or '--best'
|
||||||
- much faster with large files
|
- much faster with large files
|
||||||
* atari/tos: added support for FreeMiNT
|
* atari/tos: added support for FreeMiNT
|
||||||
* the 32-bit DOS version now uses the new CWSDSTUB extender
|
* the 32-bit DOS version now uses the new CWSDSTUB extender
|
||||||
@@ -126,7 +336,7 @@ Changes in 1.03 (30 Nov 2000)
|
|||||||
Changes in 1.02 (13 Sep 2000)
|
Changes in 1.02 (13 Sep 2000)
|
||||||
* watcom/le: fixed a problem with the Causeway extender
|
* watcom/le: fixed a problem with the Causeway extender
|
||||||
* win32/pe: don't automatically strip relocs if they seem needed
|
* win32/pe: don't automatically strip relocs if they seem needed
|
||||||
* support multiple backup generations when using `-k'
|
* support multiple backup generations when using '-k'
|
||||||
* updated the console screen driver
|
* updated the console screen driver
|
||||||
|
|
||||||
Changes in 1.01 (09 Apr 2000)
|
Changes in 1.01 (09 Apr 2000)
|
||||||
@@ -154,10 +364,12 @@ Changes in 0.99.1 (29 Feb 2000)
|
|||||||
|
|
||||||
Changes in 0.99 (25 Feb 2000)
|
Changes in 0.99 (25 Feb 2000)
|
||||||
* FULL SOURCE CODE RELEASED UNDER THE TERMS OF THE GNU GPL
|
* FULL SOURCE CODE RELEASED UNDER THE TERMS OF THE GNU GPL
|
||||||
* win32/pe: changed default to `--strip-relocs=1'
|
* win32/pe: changed default to '--strip-relocs=1'
|
||||||
* dos/com and dos/sys: fixed a bad decompressor problem
|
* dos/com and dos/sys: fixed a bad decompressor problem
|
||||||
* linux/386: the counter for the progress indicator was off by one
|
* linux/386: the counter for the progress indicator was off by one
|
||||||
|
|
||||||
|
==================================================================
|
||||||
|
|
||||||
Changes in 0.94 (06 Dec 1999)
|
Changes in 0.94 (06 Dec 1999)
|
||||||
* win32/pe: the stub now calls ExitProcess in case of import errors
|
* win32/pe: the stub now calls ExitProcess in case of import errors
|
||||||
* under DOS and Windows, the environment variable UPX now accepts
|
* under DOS and Windows, the environment variable UPX now accepts
|
||||||
@@ -177,7 +389,7 @@ Changes in 0.91 (13 Nov 1999)
|
|||||||
* dos/exe: correctly restore cs when uncompressing
|
* dos/exe: correctly restore cs when uncompressing
|
||||||
|
|
||||||
Changes in 0.90 (10 Nov 1999)
|
Changes in 0.90 (10 Nov 1999)
|
||||||
* all formats: `--overlay=copy' now is the default overlay mode
|
* all formats: '--overlay=copy' now is the default overlay mode
|
||||||
* improved compression ratio for most files
|
* improved compression ratio for most files
|
||||||
* win32/pe: uncompression is finally supported
|
* win32/pe: uncompression is finally supported
|
||||||
* win32/pe: never compress REGISTRY resources
|
* win32/pe: never compress REGISTRY resources
|
||||||
@@ -187,7 +399,7 @@ Changes in 0.90 (10 Nov 1999)
|
|||||||
* win32/pe: somewhat less memory is required during compression
|
* win32/pe: somewhat less memory is required during compression
|
||||||
* linux/386: fixed compression of scripts which was broken since 0.71
|
* linux/386: fixed compression of scripts which was broken since 0.71
|
||||||
* linux/386: more FreeBSD compatibility issues
|
* linux/386: more FreeBSD compatibility issues
|
||||||
* changed option: `-i' now prints some more details during compression
|
* changed option: '-i' now prints some more details during compression
|
||||||
(not finished yet)
|
(not finished yet)
|
||||||
|
|
||||||
Changes in 0.84 (04 Oct 1999)
|
Changes in 0.84 (04 Oct 1999)
|
||||||
@@ -203,7 +415,7 @@ Changes in 0.83 (17 Sep 1999)
|
|||||||
Changes in 0.82 (16 Aug 1999)
|
Changes in 0.82 (16 Aug 1999)
|
||||||
* dos/exe: fixed a decompressor bug which could cause crash on some files
|
* dos/exe: fixed a decompressor bug which could cause crash on some files
|
||||||
* linux/386: section headers are now stripped from the stub so that
|
* linux/386: section headers are now stripped from the stub so that
|
||||||
`strip' won't ruin a compressed file any longer
|
'strip' won't ruin a compressed file any longer
|
||||||
* wc/le: support for stack not in the last object disabled again
|
* wc/le: support for stack not in the last object disabled again
|
||||||
* win32/pe: removed some unneeded data
|
* win32/pe: removed some unneeded data
|
||||||
|
|
||||||
@@ -212,32 +424,32 @@ Changes in 0.81 (04 Aug 1999)
|
|||||||
* dos/com: fixed an internal error that could happen with very small files
|
* dos/com: fixed an internal error that could happen with very small files
|
||||||
|
|
||||||
Changes in 0.80 (03 Aug 1999)
|
Changes in 0.80 (03 Aug 1999)
|
||||||
* you can set some default options in the environment var `UPX'
|
* you can set some default options in the environment var 'UPX'
|
||||||
* dos/com: the decompressor stub now checks for enough free memory
|
* dos/com: the decompressor stub now checks for enough free memory
|
||||||
* dos/exe: decompressor rewritten, some bugs are fixed
|
* dos/exe: decompressor rewritten, some bugs are fixed
|
||||||
* dos/exe: new option `--no-reloc': no relocation data is put into
|
* dos/exe: new option '--no-reloc': no relocation data is put into
|
||||||
the DOS header
|
the DOS header
|
||||||
* tmt/adam: added support for more stubs, detect already packed files
|
* tmt/adam: added support for more stubs, detect already packed files
|
||||||
* tmt/adam: new option `--copy-overlay'
|
* tmt/adam: new option '--copy-overlay'
|
||||||
* wc/le: reduced memory requirement during uncompression
|
* wc/le: reduced memory requirement during uncompression
|
||||||
* wc/le: support files which do not contain their stack in the last object
|
* wc/le: support files which do not contain their stack in the last object
|
||||||
* wc/le: fixed a bug which could cause a crash, improved relocation
|
* wc/le: fixed a bug which could cause a crash, improved relocation
|
||||||
handling
|
handling
|
||||||
* wc/le: new option `--copy-overlay'
|
* wc/le: new option '--copy-overlay'
|
||||||
* win32/pe: `--compress-icons=2' is now the default
|
* win32/pe: '--compress-icons=2' is now the default
|
||||||
* win32/pe: even better TLS support
|
* win32/pe: even better TLS support
|
||||||
* win32/pe: versioninfo works on NT
|
* win32/pe: versioninfo works on NT
|
||||||
* win32/pe: import by ordinal from kernel32.dll works
|
* win32/pe: import by ordinal from kernel32.dll works
|
||||||
* win32/pe: other import improvements: importing a nonexistant DLL
|
* win32/pe: other import improvements: importing a nonexistent DLL
|
||||||
results in a usual Windows message, importing a nonexistant function
|
results in a usual Windows message, importing a nonexistent function
|
||||||
results in program exit (instead of crash ;-)
|
results in program exit (instead of crash ;-)
|
||||||
* win32/pe: new option: `--compress-resources=0'
|
* win32/pe: new option: '--compress-resources=0'
|
||||||
* win32/pe: reduced memory requirement during uncompression, some
|
* win32/pe: reduced memory requirement during uncompression, some
|
||||||
files might even require LESS memory when they're compressed
|
files might even require LESS memory when they're compressed
|
||||||
* win32/pe: TYPELIBs should work now
|
* win32/pe: TYPELIBs should work now
|
||||||
* win32/pe: improved relocation handling, 16-bit relocations should work
|
* win32/pe: improved relocation handling, 16-bit relocations should work
|
||||||
* win32/pe: new option `--strip-relocs' (only if you know what you are doing)
|
* win32/pe: new option '--strip-relocs' (only if you know what you are doing)
|
||||||
* win32/pe: new option `--copy-overlay'
|
* win32/pe: new option '--copy-overlay'
|
||||||
* important internal changes: now the stubs are built at runtime
|
* important internal changes: now the stubs are built at runtime
|
||||||
|
|
||||||
Changes in 0.72 (12 May 1999)
|
Changes in 0.72 (12 May 1999)
|
||||||
@@ -251,20 +463,20 @@ Changes in 0.72 (12 May 1999)
|
|||||||
* linux/386: minor decompressor stub updates, nicer progress bar
|
* linux/386: minor decompressor stub updates, nicer progress bar
|
||||||
|
|
||||||
Changes in 0.71 (19 Apr 1999)
|
Changes in 0.71 (19 Apr 1999)
|
||||||
* dos/exe: added option `--no-overlay'
|
* dos/exe: added option '--no-overlay'
|
||||||
* linux/386: various improvements in the stub, most notably the
|
* linux/386: various improvements in the stub, most notably the
|
||||||
overhead for an extra cleanup process has been removed
|
overhead for an extra cleanup process has been removed
|
||||||
* win32/pe: added support for export forwarders
|
* win32/pe: added support for export forwarders
|
||||||
* win32/pe: added support for DLLs without entry point or imports
|
* win32/pe: added support for DLLs without entry point or imports
|
||||||
* win32/pe: yet another .bss fix
|
* win32/pe: yet another .bss fix
|
||||||
* win32/pe: new option `--compress-icons=2': compress all icons
|
* win32/pe: new option '--compress-icons=2': compress all icons
|
||||||
which are not in the first icon directory
|
which are not in the first icon directory
|
||||||
* win32/pe: rearranged stub to avoid false alerts from some virus scanners
|
* win32/pe: rearranged stub to avoid false alerts from some virus scanners
|
||||||
|
|
||||||
Changes in 0.70 (30 Mar 1999)
|
Changes in 0.70 (30 Mar 1999)
|
||||||
* added support for linux/386 executables
|
* added support for linux/386 executables
|
||||||
* improved compression ratio quite a bit
|
* improved compression ratio quite a bit
|
||||||
* added new compression level `--best' to squeeze out even some more bytes
|
* added new compression level '--best' to squeeze out even some more bytes
|
||||||
* win32/pe: TLS support is much better now
|
* win32/pe: TLS support is much better now
|
||||||
* win32/pe: --compress-icons=0 should now work as well
|
* win32/pe: --compress-icons=0 should now work as well
|
||||||
* the usual minor fixes for win32/pe
|
* the usual minor fixes for win32/pe
|
||||||
@@ -281,7 +493,7 @@ Changes in 0.60 (06 Mar 1999)
|
|||||||
* win32/pe: fixed file corruption when the size of the export data is invalid
|
* win32/pe: fixed file corruption when the size of the export data is invalid
|
||||||
* win32/pe: fixed a problem with empty resource data
|
* win32/pe: fixed a problem with empty resource data
|
||||||
* win32/pe: compressed file alignment set to minimum value
|
* win32/pe: compressed file alignment set to minimum value
|
||||||
* win32/pe: made all compressed sections writeable
|
* win32/pe: made all compressed sections writable
|
||||||
* fixed some other win32/pe bugs
|
* fixed some other win32/pe bugs
|
||||||
* fixed an address optimization problem for some not Watcom LE files
|
* fixed an address optimization problem for some not Watcom LE files
|
||||||
* fixed a bug which could make UPX hang when an exe header contained
|
* fixed a bug which could make UPX hang when an exe header contained
|
||||||
@@ -305,7 +517,7 @@ Changes in 0.40 (05 Oct 1998)
|
|||||||
* fixed a small but fatal bug in dos/sys introduced in 0.30
|
* fixed a small but fatal bug in dos/sys introduced in 0.30
|
||||||
* fixed a rare bug in dos/exe
|
* fixed a rare bug in dos/exe
|
||||||
* worked around a bug in djgpp's strip 2.8
|
* worked around a bug in djgpp's strip 2.8
|
||||||
* Allegro packfile support should work now
|
* djgpp/coff: Allegro packfile support should work now
|
||||||
* added dos/exeh compression method (works on 386+)
|
* added dos/exeh compression method (works on 386+)
|
||||||
|
|
||||||
Changes in 0.30 (27 Jul 1998)
|
Changes in 0.30 (27 Jul 1998)
|
||||||
@@ -322,3 +534,5 @@ Changes in 0.20 (05 Jul 1998)
|
|||||||
Changes in 0.05 (26 May 1998)
|
Changes in 0.05 (26 May 1998)
|
||||||
* first public beta release
|
* first public beta release
|
||||||
|
|
||||||
|
|
||||||
|
# vim:set syntax=off tw=0 ts=4 sw=4 et: -*- coding: utf-8 -*-
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
ooooo ooo ooooooooo. ooooooo ooooo
|
|
||||||
`888' `8' `888 `Y88. `8888 d8'
|
|
||||||
888 8 888 .d88' Y888..8P
|
|
||||||
888 8 888ooo88P' `8888'
|
|
||||||
888 8 888 .8PY888.
|
|
||||||
`88. .8' 888 d8' `888b
|
|
||||||
`YbodP' o888o o888o o88888o
|
|
||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
|
||||||
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
|
|
||||||
http://upx.sourceforge.net
|
|
||||||
|
|
||||||
|
|
||||||
Here are some possible projects from which you can choose if you'd like to
|
|
||||||
contribute to UPX. Be sure to get in touch with us first to avoid
|
|
||||||
duplicate efforts.
|
|
||||||
|
|
||||||
|
|
||||||
User interface:
|
|
||||||
---------------
|
|
||||||
|
|
||||||
- Write a nifty Win32 GUI (in C++), but try to keep the size of the
|
|
||||||
final executable small. Compression should be in a separate
|
|
||||||
thread that calls do_one_file() [see src/work.cpp].
|
|
||||||
|
|
||||||
- Draw a nice UPX icon.
|
|
||||||
|
|
||||||
|
|
||||||
More formats:
|
|
||||||
-------------
|
|
||||||
|
|
||||||
- Amiga
|
|
||||||
|
|
||||||
- BeOS
|
|
||||||
|
|
||||||
- C64
|
|
||||||
|
|
||||||
- elks/8086 (this is a 16-bit linux-8086 kernel)
|
|
||||||
See http://www.elks.ecs.soton.ac.uk/
|
|
||||||
|
|
||||||
- freebsd/386 (generic), freebsd/elf386 (specialized).
|
|
||||||
Probably could share most of the linux code.
|
|
||||||
|
|
||||||
- Windows CE
|
|
||||||
|
|
||||||
- add support for self-extracting HTML pages using a Javascript stub
|
|
||||||
(like the AlgART HTML Packer "AHP")
|
|
||||||
|
|
||||||
|
|
||||||
Existing formats:
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
- djgpp2/coff: add support for DLX dynamic loading
|
|
||||||
(see SEAL http://www.home.sk/public/seal/ )
|
|
||||||
|
|
||||||
- dos/com: add support for very long files - convert to exe if necessary
|
|
||||||
|
|
||||||
- dos/exe: implement filter support
|
|
||||||
|
|
||||||
- dos/sys: add support for sys/exe combos
|
|
||||||
|
|
||||||
- linux/i386:
|
|
||||||
- use the new assembly preprocessor stuff (ie. process the file
|
|
||||||
headers internally)
|
|
||||||
- UPX uncompressor daemon
|
|
||||||
- rewrite the stub in assembly (not sure if this is a good idea...)
|
|
||||||
|
|
||||||
- watcom/le: add support for per section compression, LX support, VXD
|
|
||||||
|
|
||||||
- win32/pe: display a nice dialog box in the stub in case
|
|
||||||
of problems (like importing a DLL or function fails)
|
|
||||||
- win32/pe: finer control over resource compression, per section
|
|
||||||
compression
|
|
||||||
|
|
||||||
|
|
||||||
Compression ratio:
|
|
||||||
------------------
|
|
||||||
|
|
||||||
- invent more effective filters
|
|
||||||
|
|
||||||
- I (Markus) will continue to work on better compression algorithms,
|
|
||||||
so be sure to do better than me if you plan working on this ;-)
|
|
||||||
|
|
||||||
|
|
||||||
Other:
|
|
||||||
------
|
|
||||||
|
|
||||||
- anything else you think that could improve UPX...
|
|
||||||
|
|
||||||
|
|
||||||
Thanks for your contribution.
|
|
||||||
|
|
||||||
@@ -1,47 +1,25 @@
|
|||||||
ooooo ooo ooooooooo. ooooooo ooooo
|
ooooo ooo ooooooooo. ooooooo ooooo
|
||||||
`888' `8' `888 `Y88. `8888 d8'
|
`888' `8' `888 `Y88. `8888 d8'
|
||||||
888 8 888 .d88' Y888..8P
|
888 8 888 .d88' Y888..8P
|
||||||
888 8 888ooo88P' `8888'
|
888 8 888ooo88P' `8888'
|
||||||
888 8 888 .8PY888.
|
888 8 888 .8PY888.
|
||||||
`88. .8' 888 d8' `888b
|
`88. .8' 888 d8' `888b
|
||||||
`YbodP' o888o o888o o88888o
|
`YbodP' o888o o888o o88888o
|
||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2022 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WARNING - UNSTABLE BETA VERSION
|
|
||||||
===============================
|
|
||||||
|
|
||||||
All versions 1.9x are unstable beta releases - use them only for testing,
|
|
||||||
and never distribute a program that is packed with them !
|
|
||||||
There will be hidden bugs. Really.
|
|
||||||
|
|
||||||
The current stable release is 1.24, and the next stable release
|
|
||||||
will be called version 2.00.
|
|
||||||
|
|
||||||
The main news since 1.24 are:
|
|
||||||
- slightly better compression using the new NRV2E algorithm
|
|
||||||
- new options for compression tuining (e.g. `--brute')
|
|
||||||
- support for bootable Linux kernels ("vmlinuz/386")
|
|
||||||
- direct Linux ELF-to-memory decompression ("linux/elf386") and
|
|
||||||
shell-to-memory decompression ("linux/sh386")
|
|
||||||
- support for playstation exes ("ps1/exe")
|
|
||||||
- lots of new bugs ;-) take care
|
|
||||||
|
|
||||||
|
|
||||||
WELCOME
|
WELCOME
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Welcome to UPX !
|
Welcome to UPX !
|
||||||
|
|
||||||
Please don't forget to read the file LICENSE - UPX is distributed
|
UPX is a free, secure, portable, extendable, high-performance
|
||||||
under the GNU General Public License (GPL) with special exceptions
|
executable packer for several executable formats.
|
||||||
allowing the distribution of all compressed executables, including
|
|
||||||
commercial programs.
|
|
||||||
|
|
||||||
|
|
||||||
INTRODUCTION
|
INTRODUCTION
|
||||||
@@ -57,105 +35,86 @@ and run exactly as before, with no runtime or memory penalty for most
|
|||||||
of the supported formats.
|
of the supported formats.
|
||||||
|
|
||||||
UPX supports a number of different executable formats, including
|
UPX supports a number of different executable formats, including
|
||||||
Windows 95/98/ME/NT/2000/XP programs and DLLs, DOS programs,
|
Windows programs and DLLs, macOS apps and Linux executables.
|
||||||
and Linux executables and kernels.
|
|
||||||
|
|
||||||
UPX is free software distributed under the term of the GNU General
|
UPX is free software distributed under the term of the GNU General
|
||||||
Public License. Full source code is available.
|
Public License. Full source code is available.
|
||||||
|
|
||||||
UPX may be distributed and used freely, even with commercial applications.
|
UPX may be distributed and used freely, even with commercial applications.
|
||||||
See the UPX License Agreement for details.
|
See the UPX License Agreements for details.
|
||||||
|
|
||||||
UPX is rated number one in the well known Archive Comparison Test. Visit
|
|
||||||
http://compression.ca/ .
|
|
||||||
|
|
||||||
UPX aims to be Commercial Quality Freeware.
|
SECURITY CONTEXT
|
||||||
|
================
|
||||||
|
|
||||||
|
IMPORTANT NOTE: UPX inherits the security context of any files it handles.
|
||||||
|
|
||||||
|
This means that packing, unpacking, or even testing or listing a file requires
|
||||||
|
the same security considerations as actually executing the file.
|
||||||
|
|
||||||
|
Use UPX on trusted files only!
|
||||||
|
|
||||||
|
|
||||||
SHORT DOCUMENTATION
|
SHORT DOCUMENTATION
|
||||||
===================
|
===================
|
||||||
|
|
||||||
`upx program.exe' will compress a program or DLL. For best compression
|
'upx program.exe' will compress a program or DLL. For best compression
|
||||||
results try `upx --best program.exe'.
|
results try 'upx --best program.exe' or 'upx --brute program.exe'.
|
||||||
|
|
||||||
Please see the file UPX.DOC for the full documentation. The files
|
Please see the file UPX.DOC for the full documentation. The files
|
||||||
NEWS and BUGS also contain various tidbits of information.
|
NEWS and BUGS also contain various tidbits of information.
|
||||||
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
==========
|
|
||||||
|
|
||||||
UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.
|
|
||||||
|
|
||||||
Having said that, we think that UPX is quite stable now. Indeed we
|
|
||||||
have compressed lots of files without any problems. Also, the
|
|
||||||
current version has undergone several months of beta testing -
|
|
||||||
actually it's more than 4 years since our first public beta.
|
|
||||||
|
|
||||||
This is the first production quality release, and we plan that future
|
|
||||||
releases will be backward compatible with this version.
|
|
||||||
|
|
||||||
Please report all problems or suggestions to the authors. Thanks.
|
|
||||||
|
|
||||||
|
|
||||||
THE FUTURE
|
THE FUTURE
|
||||||
==========
|
==========
|
||||||
|
|
||||||
- We'd really love to support handheld systems like the PalmPilot because
|
- Stay up-to-date with ongoing OS and executable format changes
|
||||||
compression makes a lot of sense here. And - because of the atari/tos
|
|
||||||
format - we already have a working decompressor in 68000 assembly.
|
|
||||||
Unfortunately we know next to nothing about the operating system
|
|
||||||
architecture of such handhelds, so we need some information from
|
|
||||||
an expert. Please contact us if you think you can help.
|
|
||||||
|
|
||||||
- The Linux approach could probably get ported to a lot of other Unix
|
- RISC-V 64 for Linux
|
||||||
variants, at least for other i386 architectures it shouldn't be too
|
|
||||||
much work. If someone sends me a fresh hard disk and an official
|
- ARM64 for Windows (help wanted)
|
||||||
FreeBSD/OpenBSD/NetBSD/Solaris/BeOS... CD I might take a look at it ;-)
|
|
||||||
|
|
||||||
- We will *NOT* add any sort of protection and/or encryption.
|
- We will *NOT* add any sort of protection and/or encryption.
|
||||||
This only gives people a false feeling of security because
|
This only gives people a false feeling of security because
|
||||||
by definition all protectors/compressors can be broken.
|
all "protectors" can be broken by definition.
|
||||||
And don't trust any advertisment of authors of other executable
|
|
||||||
compressors about this topic - just do a websearch on "unpackers"...
|
|
||||||
|
|
||||||
- Fix all remaining bugs - keep your reports coming ;-)
|
- Fix all remaining bugs - please report any issues
|
||||||
|
https://github.com/upx/upx/issues
|
||||||
- See the file PROJECTS in the source code distribution if you want
|
|
||||||
to contribute.
|
|
||||||
|
|
||||||
|
|
||||||
COPYRIGHT
|
COPYRIGHT
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2004 Laszlo Molnar
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2022 John F. Reiser
|
||||||
|
|
||||||
This program may be used freely, and you are welcome to
|
UPX is distributed with full source code under the terms of the
|
||||||
redistribute it under certain conditions.
|
GNU General Public License v2+; either under the pure GPLv2+ (see
|
||||||
|
the file COPYING), or (at your option) under the GPLv+2 with special
|
||||||
|
exceptions and restrictions granting the free usage for all binaries
|
||||||
|
including commercial programs (see the file LICENSE).
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
UPX License Agreement for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the UPX License Agreement along
|
You should have received a copy of the UPX License Agreements along
|
||||||
with this program; see the file LICENSE. If not, visit the UPX home page.
|
with this program; see the files COPYING and LICENSE. If not,
|
||||||
|
visit the UPX home page.
|
||||||
|
|
||||||
|
|
||||||
Share and enjoy,
|
Share and enjoy,
|
||||||
Markus & Laszlo
|
Markus & Laszlo & John
|
||||||
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
markus@oberhumer.com ml1050@cdata.tvnet.hu
|
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@BitWagon.com>
|
||||||
|
|
||||||
|
|
||||||
[ The term UPX is a shorthand for the Ultimate Packer for eXecutables
|
[ The term UPX is a shorthand for the Ultimate Packer for eXecutables
|
||||||
and holds no connection with potential owners of registered trademarks
|
and holds no connection with potential owners of registered trademarks
|
||||||
or other rights. ]
|
or other rights. ]
|
||||||
|
|
||||||
[ Feel free to contact us if you have commercial compression requirements
|
|
||||||
or interesting job offers. ]
|
|
||||||
|
|
||||||
|
|||||||
-32
@@ -1,32 +0,0 @@
|
|||||||
ooooo ooo ooooooooo. ooooooo ooooo
|
|
||||||
`888' `8' `888 `Y88. `8888 d8'
|
|
||||||
888 8 888 .d88' Y888..8P
|
|
||||||
888 8 888ooo88P' `8888'
|
|
||||||
888 8 888 .8PY888.
|
|
||||||
`88. .8' 888 d8' `888b
|
|
||||||
`YbodP' o888o o888o o88888o
|
|
||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WARNING - UNSTABLE BETA VERSION
|
|
||||||
===============================
|
|
||||||
|
|
||||||
All versions 1.9x are unstable beta releases - use them only for testing,
|
|
||||||
and never distribute a program that is packed with them !
|
|
||||||
There will be hidden bugs. Really.
|
|
||||||
|
|
||||||
The current stable release is 1.25, and the next stable release
|
|
||||||
will be called version 2.00.
|
|
||||||
|
|
||||||
The main news since 1.25 are:
|
|
||||||
- slightly better compression using the new NRV2E algorithm
|
|
||||||
- new options for compression tuining (e.g. `--brute')
|
|
||||||
- support for bootable Linux kernels ("vmlinuz/386")
|
|
||||||
- direct Linux ELF-to-memory decompression ("linux/elf386") and
|
|
||||||
shell-to-memory decompression ("linux/sh386")
|
|
||||||
- support for playstation exes ("ps1/exe")
|
|
||||||
- lots of new bugs ;-) take care
|
|
||||||
|
|
||||||
+13
-68
@@ -27,21 +27,6 @@ Foreword
|
|||||||
Markus & Laszlo
|
Markus & Laszlo
|
||||||
|
|
||||||
|
|
||||||
Introduction
|
|
||||||
------------
|
|
||||||
|
|
||||||
Welcome to the UPX source code release!
|
|
||||||
|
|
||||||
UPX is not a toy for kids. Apart from basic knowledge about executables
|
|
||||||
and data compression you will need to be firm in C++, assembler,
|
|
||||||
Perl and Makefiles. Probably some other things as well.
|
|
||||||
|
|
||||||
If you can't manage to compile it then the sources are
|
|
||||||
probably not for you. Don't email us for help.
|
|
||||||
|
|
||||||
The authors use Linux for development. You might want to as well.
|
|
||||||
|
|
||||||
|
|
||||||
Short overview
|
Short overview
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
@@ -56,59 +41,33 @@ Short overview
|
|||||||
are #included by the individual executable format handlers.
|
are #included by the individual executable format handlers.
|
||||||
|
|
||||||
|
|
||||||
Prerequisites
|
|
||||||
-------------
|
|
||||||
|
|
||||||
- first of all you need to build the UCL compression library
|
|
||||||
http://www.oberhumer.com/opensource/ucl/
|
|
||||||
|
|
||||||
|
|
||||||
Tools needed to build/modify the UPX sources
|
Tools needed to build/modify the UPX sources
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
|
||||||
- A C++ compiler supporting inner classes, templates, exceptions
|
- A C++ compiler that supports C++ 14: clang, gcc or msvc
|
||||||
and RTTI.
|
|
||||||
|
|
||||||
- GNU make for Win32
|
- GNU make
|
||||||
http://upx.sourceforge.net/download/tools/
|
|
||||||
|
|
||||||
- GNU make for DOS
|
- CMake 3.13 or better; see https://cmake.org/
|
||||||
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/
|
|
||||||
|
|
||||||
|
|
||||||
To compile the packer sources
|
To compile the packer sources
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
set the environment variable UCLDIR to point to your UCL installation, e.g.
|
- just run "make" in the top-level source directory
|
||||||
|
|
||||||
set UCLDIR=c:\src\ucl-1.01 (DOS / Windows)
|
|
||||||
export UCLDIR=$HOME/local/src/ucl-1.01 (Unix)
|
|
||||||
|
|
||||||
then type
|
|
||||||
|
|
||||||
make target=linux # linux
|
|
||||||
make target=djgpp2 # dos32 - djgpp2
|
|
||||||
make target=cygwin # win32 - cygwin 1.3.x
|
|
||||||
make target=mingw32 # win32 - mingw32
|
|
||||||
make target=no-cygwin # win32 - mingw32 as included in cygwin
|
|
||||||
|
|
||||||
|
|
||||||
If you want to modify the stub sources you'll also need
|
If you want to modify the stub sources you'll also need
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
- Nasm 0.98.38 - the Netwide Assembler
|
- Podman/Docker: see misc/rebuild-stubs-with-podman - this
|
||||||
http://upx.sourceforge.net/download/tools/
|
is the preferred way of rebuilding the stubs
|
||||||
http://sourceforge.net/projects/nasm/
|
|
||||||
|
|
||||||
- A68K - a 68000 macro assembler
|
- otherwise you will need:
|
||||||
http://upx.sourceforge.net/download/tools/
|
- a Linux host system with Perl, Python2 and some older compat-libs
|
||||||
|
- upx-stubtools - a number of cross-assemblers and cross-compilers.
|
||||||
- djasm - an assembler for the djgpp stub
|
Precompiled binaries for amd64-linux hosts are available from
|
||||||
http://upx.sourceforge.net/download/tools/
|
https://github.com/upx/upx-stubtools/releases
|
||||||
|
|
||||||
- Perl 5.6 or better
|
|
||||||
|
|
||||||
- Linux (for the linux/386 stubs)
|
|
||||||
|
|
||||||
|
|
||||||
Misc. notes
|
Misc. notes
|
||||||
@@ -123,13 +82,10 @@ Misc. notes
|
|||||||
stream.
|
stream.
|
||||||
- Use gcc extensions and other compiler specific stuff only through
|
- Use gcc extensions and other compiler specific stuff only through
|
||||||
macros.
|
macros.
|
||||||
- Keep in mind that it should be possible to build UPX on braindead
|
|
||||||
file systems (FAT). Don't use long file names or other things
|
|
||||||
that break building under plain DOS.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
Some conventions:
|
Some conventions:
|
||||||
|
-----------------
|
||||||
|
|
||||||
- follow our coding style
|
- follow our coding style
|
||||||
- indent level = 4
|
- indent level = 4
|
||||||
@@ -138,15 +94,4 @@ Some conventions:
|
|||||||
- Use throwSomeException() functions instead of throw SomeException():
|
- Use throwSomeException() functions instead of throw SomeException():
|
||||||
this makes the code shorter if used often.
|
this makes the code shorter if used often.
|
||||||
|
|
||||||
***
|
# vim:set ts=4 sw=4 et:
|
||||||
|
|
||||||
Patches/Contributions
|
|
||||||
|
|
||||||
- Please send us bug fixes/contributions only using
|
|
||||||
|
|
||||||
diff -u oldfile newfile
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
diff -uNr olddirectory newdirectory
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
ooooo ooo ooooooooo. ooooooo ooooo
|
ooooo ooo ooooooooo. ooooooo ooooo
|
||||||
`888' `8' `888 `Y88. `8888 d8'
|
`888' `8' `888 `Y88. `8888 d8'
|
||||||
888 8 888 .d88' Y888..8P
|
888 8 888 .d88' Y888..8P
|
||||||
888 8 888ooo88P' `8888'
|
888 8 888ooo88P' `8888'
|
||||||
888 8 888 .8PY888.
|
888 8 888 .8PY888.
|
||||||
`88. .8' 888 d8' `888b
|
`88. .8' 888 d8' `888b
|
||||||
`YbodP' o888o o888o o88888o
|
`YbodP' o888o o888o o88888o
|
||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2022 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
.___.. .
|
.___.. .
|
||||||
@@ -39,12 +39,12 @@ Ice
|
|||||||
for debugging the PE headersize problem down
|
for debugging the PE headersize problem down
|
||||||
Joergen Ibsen <jibz@hotmail.com> and d'b
|
Joergen Ibsen <jibz@hotmail.com> and d'b
|
||||||
for the relocation & address optimization ideas
|
for the relocation & address optimization ideas
|
||||||
John F. Reiser <jreiser@BitWagon.com>
|
|
||||||
for the new Linux executable formats
|
|
||||||
John S. Fine <johnfine@erols.com>
|
John S. Fine <johnfine@erols.com>
|
||||||
for the new version of the dos/exe decompressor
|
for the new version of the dos/exe decompressor
|
||||||
Lukundoo <Lukundoo@softhome.net>
|
Lukundoo <Lukundoo@softhome.net>
|
||||||
for beta testing
|
for beta testing
|
||||||
|
Michael Devore
|
||||||
|
for initial dos/exe device driver support
|
||||||
Oleg V. Volkov <rover@lglobus.ru>
|
Oleg V. Volkov <rover@lglobus.ru>
|
||||||
for various FreeBSD specific informations
|
for various FreeBSD specific informations
|
||||||
The Owl & G-RoM
|
The Owl & G-RoM
|
||||||
@@ -53,7 +53,8 @@ Ralph Roth <RalphRoth@gmx.net>
|
|||||||
for reporting several bugs
|
for reporting several bugs
|
||||||
Salvador Eduardo Tropea
|
Salvador Eduardo Tropea
|
||||||
for beta testing
|
for beta testing
|
||||||
|
Stefan Widmann
|
||||||
|
for the win32/pe TLS callback support
|
||||||
The WINE project (http://www.winehq.com/)
|
The WINE project (http://www.winehq.com/)
|
||||||
for lots of useful information found in their PE loader sources
|
for lots of useful information found in their PE loader sources
|
||||||
Natascha
|
Natascha
|
||||||
|
|
||||||
|
|||||||
@@ -1,128 +0,0 @@
|
|||||||
UPX TODO list. Last updated 2004-06-30.
|
|
||||||
|
|
||||||
|
|
||||||
IMPORTANT PROBLEMS THAT SHOULD BE FIXED SOON:
|
|
||||||
|
|
||||||
- win32/pe should add support for PEDIR_LOADCONF (Visual C++ 7.1 generated
|
|
||||||
exes, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG)
|
|
||||||
|
|
||||||
- win32/pe should reliably detect .NET exes and somehow deal with them
|
|
||||||
|
|
||||||
- stub ctojr32 needs CPU 486 because of bswap
|
|
||||||
|
|
||||||
|
|
||||||
OTHER:
|
|
||||||
|
|
||||||
- check all <const_cast> to make sure they are not invalid
|
|
||||||
|
|
||||||
- throwNotCompressible() is not a real error, so make the output nicer
|
|
||||||
(info: bla bla). Also ui.cpp (total_*).
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
IMPROVED COMPRESSION RATIO
|
|
||||||
==========================
|
|
||||||
|
|
||||||
- experiment with new filters
|
|
||||||
|
|
||||||
- implement filters for dos/exe
|
|
||||||
|
|
||||||
- filters: could we exploit a f->firstcall info field ?
|
|
||||||
|
|
||||||
- for small programs (e.g. < 64k), try an additional algorithm
|
|
||||||
to see if it gives better compression
|
|
||||||
|
|
||||||
|
|
||||||
ALL FORMATS
|
|
||||||
===========
|
|
||||||
|
|
||||||
- more thoroughly test the exe-header in canPack()
|
|
||||||
and throw exceptions when encountering bad values.
|
|
||||||
|
|
||||||
- implement `--cpu=486' option to use bswap on the 32-bit formats
|
|
||||||
(if cpu >= 486)
|
|
||||||
|
|
||||||
- consider removing "or ebp,-1" when not needed
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT DJGPP2/COFF
|
|
||||||
==================
|
|
||||||
|
|
||||||
- handle overlays
|
|
||||||
|
|
||||||
- fix default file extension handling when the --coff option is set
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT DOS/EXE
|
|
||||||
==============
|
|
||||||
|
|
||||||
- implement filters
|
|
||||||
|
|
||||||
- add a check so that we don't pack djgpp1 binaries
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT LINUX/386
|
|
||||||
================
|
|
||||||
|
|
||||||
- don't mmap() the temporary output file - this seems to improve
|
|
||||||
file io speed
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT TMT/ADAM
|
|
||||||
===============
|
|
||||||
|
|
||||||
- the decompressors are already aligned, no need for an
|
|
||||||
extra alignment
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT WATCOM/LE
|
|
||||||
================
|
|
||||||
|
|
||||||
- handle files without relocations
|
|
||||||
|
|
||||||
- the decompressors are already aligned, no need for an
|
|
||||||
extra alignment
|
|
||||||
|
|
||||||
- fix default file extension handling when the --le option is set
|
|
||||||
|
|
||||||
- handle holes in the file
|
|
||||||
|
|
||||||
- implement compressWithFilters()
|
|
||||||
|
|
||||||
- add a call to verifyOverlappingDecompression()
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT WIN16/NE
|
|
||||||
===============
|
|
||||||
|
|
||||||
- implement readFileHeader() to correctly identify a win16/ne
|
|
||||||
executable, so that the call for contribution will get thrown
|
|
||||||
|
|
||||||
|
|
||||||
FORMAT WIN32/PE
|
|
||||||
===============
|
|
||||||
|
|
||||||
- fix the section alignment with the Intel compiler
|
|
||||||
|
|
||||||
- decrease runtime memory overhead
|
|
||||||
|
|
||||||
2 - easy - mfx + ml) new switch(es) : do not compress resource types x,y,z
|
|
||||||
or resource names a,b,c
|
|
||||||
|
|
||||||
3 - medium - ml) rebuild exports
|
|
||||||
|
|
||||||
3 - difficult) don't compress the BSS section and other holes.
|
|
||||||
|
|
||||||
4 - medium - ml) fix when objectalign < 0x1000
|
|
||||||
|
|
||||||
4 - easy - ml) put the original offset of moved resources somewhere into
|
|
||||||
the res.dir. (if it's safe to do)
|
|
||||||
|
|
||||||
4 - ??? - ml) fix FIXMEs
|
|
||||||
|
|
||||||
5 - medium - ml) try to put the preprocessed imports & relocs back to their
|
|
||||||
original section if possible. this could save some virtual memory
|
|
||||||
address space.
|
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-Ivendor
|
||||||
|
-fno-strict-aliasing
|
||||||
|
-fno-strict-overflow
|
||||||
|
-funsigned-char
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
upx.1
|
|
||||||
upx.doc
|
|
||||||
upx.html
|
|
||||||
upx.man
|
|
||||||
upx.ps
|
|
||||||
upx.tex
|
|
||||||
+11
-12
@@ -1,15 +1,15 @@
|
|||||||
ooooo ooo ooooooooo. ooooooo ooooo
|
ooooo ooo ooooooooo. ooooooo ooooo
|
||||||
`888' `8' `888 `Y88. `8888 d8'
|
`888' `8' `888 `Y88. `8888 d8'
|
||||||
888 8 888 .d88' Y888..8P
|
888 8 888 .d88' Y888..8P
|
||||||
888 8 888ooo88P' `8888'
|
888 8 888ooo88P' `8888'
|
||||||
888 8 888 .8PY888.
|
888 8 888 .8PY888.
|
||||||
`88. .8' 888 d8' `888b
|
`88. .8' 888 d8' `888b
|
||||||
`YbodP' o888o o888o o88888o
|
`YbodP' o888o o888o o88888o
|
||||||
|
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2022 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
Limitations and other things which are not (yet) supported:
|
Limitations and other things which are not (yet) supported:
|
||||||
@@ -28,7 +28,7 @@ dos/exe
|
|||||||
watcom/le
|
watcom/le
|
||||||
---------
|
---------
|
||||||
* 16-bit selector alias fixups
|
* 16-bit selector alias fixups
|
||||||
* 16-bit offset relocation for objects larger than 4 kB
|
* 16-bit offset relocation for objects larger than 4 KiB
|
||||||
* 16:16 fixups
|
* 16:16 fixups
|
||||||
|
|
||||||
If you need any of the above (they're very rare), send us an URL of a
|
If you need any of the above (they're very rare), send us an URL of a
|
||||||
@@ -44,8 +44,7 @@ test file.
|
|||||||
|
|
||||||
win32/pe
|
win32/pe
|
||||||
--------
|
--------
|
||||||
* writeable shared sections (`--force' *may* work)
|
* writable shared sections (`--force' *may* work)
|
||||||
* certificates in the image
|
* certificates in the image
|
||||||
* compressing files which contain a big BSS requires lots of memory
|
* compressing files which contain a big BSS requires lots of memory
|
||||||
during compression
|
during compression
|
||||||
|
|
||||||
+51
-48
@@ -1,68 +1,71 @@
|
|||||||
SHELL = /bin/sh
|
#
|
||||||
|
# UPX doc Makefile - needs GNU make, pod2html, pod2man and pod2text
|
||||||
|
#
|
||||||
|
|
||||||
top_srcdir = ..
|
BUILT_SOURCES = upx.1 upx-doc.html upx-doc.txt
|
||||||
|
|
||||||
PACKAGE = upx
|
top_srcdir ?= ..
|
||||||
VERSION_DATE = 30 Jun 2004
|
|
||||||
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
|
|
||||||
|
|
||||||
TRIMSPACE = cat
|
PACKAGE = upx
|
||||||
TRIMSPACE = sed -e 's/ *$$//'
|
VERSION_DATE := $(shell sed -n 's/^.*UPX_VERSION_DATE_ISO .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
|
||||||
|
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
|
||||||
|
|
||||||
BUILT_SOURCES = upx.1 upx.doc upx.html upx.man upx.ps upx.tex
|
# internal make variables
|
||||||
BUILT_SOURCES = upx.1 upx.doc upx.html
|
comma := ,
|
||||||
|
empty :=
|
||||||
|
space := $(empty) $(empty)
|
||||||
|
tab := $(empty) $(empty)
|
||||||
|
|
||||||
|
RTRIM := sed -e 's/[ $(tab)]*$$//'
|
||||||
|
DETAB2 := sed -e 's/$(tab)/ /g'
|
||||||
|
|
||||||
###
|
#***********************************************************************
|
||||||
###
|
# targets
|
||||||
###
|
#***********************************************************************
|
||||||
|
|
||||||
all: $(BUILT_SOURCES)
|
.DEFAULT_GOAL = all
|
||||||
|
|
||||||
mostlyclean:
|
all: $(BUILT_SOURCES) PHONY
|
||||||
-rm -f $(BUILT_SOURCES) pod2htm*
|
|
||||||
|
|
||||||
clean: mostlyclean
|
mostlyclean clean distclean maintainer-clean: PHONY
|
||||||
|
rm -f $(BUILT_SOURCES) ./pod2htm*
|
||||||
|
|
||||||
distclean: clean
|
#***********************************************************************
|
||||||
|
# rules
|
||||||
|
#***********************************************************************
|
||||||
|
|
||||||
maintainer-clean: distclean
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .1 .html .man .pod .ps .tex .txt
|
||||||
|
|
||||||
.SUFFIXES: .1 .doc .html .man .pod .ps .tex .texi
|
%.1 : %.pod
|
||||||
|
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
%-doc.html : %.pod
|
||||||
|
pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@
|
||||||
|
@rm -f ./pod2htm*
|
||||||
|
test -s $@
|
||||||
|
|
||||||
|
%.man : %.1
|
||||||
|
nroff -man $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
###
|
%.ps : %.1
|
||||||
### rules
|
groff -man $< | $(RTRIM) > $@
|
||||||
###
|
test -s $@
|
||||||
|
|
||||||
.pod.1:
|
%.tex : %.pod
|
||||||
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(TRIMSPACE) > $@
|
|
||||||
|
|
||||||
.pod.html:
|
|
||||||
### pod2html $< | $(TRIMSPACE) > $@
|
|
||||||
pod2html --noindex $< | $(TRIMSPACE) > $@
|
|
||||||
@-rm -f pod2htm*
|
|
||||||
|
|
||||||
.pod.tex:
|
|
||||||
pod2latex $<
|
pod2latex $<
|
||||||
|
test -s $@
|
||||||
|
|
||||||
.pod.doc:
|
%-doc.txt : %.pod
|
||||||
pod2text < $< | $(TRIMSPACE) > $@
|
pod2text < $< | $(RTRIM) > $@
|
||||||
|
test -s $@
|
||||||
|
|
||||||
.1.man:
|
#***********************************************************************
|
||||||
nroff -man $< | $(TRIMSPACE) > $@
|
# dependencies
|
||||||
|
#***********************************************************************
|
||||||
.1.ps:
|
|
||||||
groff -man $< | $(TRIMSPACE) > $@
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### dependencies
|
|
||||||
###
|
|
||||||
|
|
||||||
$(BUILT_SOURCES): $(top_srcdir)/src/version.h Makefile
|
|
||||||
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
|
$(BUILT_SOURCES): $(top_srcdir)/src/version.h $(MAKEFILE_LIST)
|
||||||
|
.DELETE_ON_ERROR: $(BUILT_SOURCES)
|
||||||
|
.PHONY: PHONY
|
||||||
|
|||||||
+47
-5
@@ -1,5 +1,5 @@
|
|||||||
Decompressing ELF Directly to Memory on Linux/x86
|
Decompressing ELF Directly to Memory on Linux/x86
|
||||||
Copyright 2000 John F. Reiser jreiser@BitWagon.com
|
Copyright (C) 2000-2022 John F. Reiser jreiser@BitWagon.com
|
||||||
|
|
||||||
References:
|
References:
|
||||||
<elf.h> definitions for the ELF file format
|
<elf.h> definitions for the ELF file format
|
||||||
@@ -17,7 +17,7 @@ program itself. So, the decompressor program (which contains the
|
|||||||
compressed version of the original executable) must have the same
|
compressed version of the original executable) must have the same
|
||||||
brk() as the original executable. So, the second PT_LOAD
|
brk() as the original executable. So, the second PT_LOAD
|
||||||
ELF "segment" of the compressed program is used only to set the brk(0).
|
ELF "segment" of the compressed program is used only to set the brk(0).
|
||||||
See src/p_lx_elf.cpp, function PackLinuxI386elf::patchLoader().
|
See src/p_lx_elf.cpp, function PackLinuxElf32::generateElfHdr.
|
||||||
All of the decompressor's code, and all of the compressed image
|
All of the decompressor's code, and all of the compressed image
|
||||||
of the original executable, reside in the first PT_LOAD of the
|
of the original executable, reside in the first PT_LOAD of the
|
||||||
decompressor program.
|
decompressor program.
|
||||||
@@ -46,8 +46,8 @@ may not be used to take the address of a function.
|
|||||||
|
|
||||||
The address 0x00400000 was chosen to be out of the way of the usual
|
The address 0x00400000 was chosen to be out of the way of the usual
|
||||||
load address 0x08048000, and to minimize fragmentation in kernel
|
load address 0x08048000, and to minimize fragmentation in kernel
|
||||||
page tables; one page of page tables covers 4MB. The address
|
page tables; one page of page tables covers 4 MiB. The address
|
||||||
0x00401000 was chosen as 1 page up from a 64KB boundary, to
|
0x00401000 was chosen as 1 page up from a 64 KiB boundary, to
|
||||||
make the startup code and its constants smaller.
|
make the startup code and its constants smaller.
|
||||||
|
|
||||||
Decompression of the executable begins by decompressing the Elf32_Ehdr
|
Decompression of the executable begins by decompressing the Elf32_Ehdr
|
||||||
@@ -57,9 +57,51 @@ Subroutine do_xmap() of src/stub/l_lx_elf.c performs the
|
|||||||
"virtual execve()" using the compressed data as source, and stores
|
"virtual execve()" using the compressed data as source, and stores
|
||||||
the decompressed bytes directly into the appropriate virtual addresses.
|
the decompressed bytes directly into the appropriate virtual addresses.
|
||||||
|
|
||||||
Before transfering control to the PT_INTERP "program interpreter",
|
Before transferring control to the PT_INTERP "program interpreter",
|
||||||
minor tricks are required to setup the Elf32_auxv_t entries,
|
minor tricks are required to setup the Elf32_auxv_t entries,
|
||||||
clear the free portion of the stack (to compensate for ld-linux.so.2
|
clear the free portion of the stack (to compensate for ld-linux.so.2
|
||||||
assuming that its automatic stack variables are initialized to zero),
|
assuming that its automatic stack variables are initialized to zero),
|
||||||
and remove (all but 4 bytes of) the decompression program (and
|
and remove (all but 4 bytes of) the decompression program (and
|
||||||
compressed executable) from the address space.
|
compressed executable) from the address space.
|
||||||
|
|
||||||
|
As of upx-3.05, by default on Linux, upon decompression then one page
|
||||||
|
of the compressed executable remains mapped into the address space
|
||||||
|
of the process. If all of the pages of the compressed executable are
|
||||||
|
unmapped, then the Linux kernel erases the symlink /proc/self/exe,
|
||||||
|
and this can cause trouble for the runtime shared library loader
|
||||||
|
expanding $ORIGIN in -rpath, or for application code that relies on
|
||||||
|
/proc/self/exe. Use the compress-time command-line option
|
||||||
|
--unmap-all-pages to achieve that effect at run time. Upx-3.04
|
||||||
|
and previous versions did this by default with no option. However,
|
||||||
|
too much other software erroneously assumes that /proc/self/exe
|
||||||
|
always exists.
|
||||||
|
|
||||||
|
On arm*-linux-elf there is no good address at which to retain one
|
||||||
|
page of the compressed executable. Pages below the usual .p_vaddr
|
||||||
|
0x8000 (32KiB) are rejected by the kernel. Using a page above the
|
||||||
|
original uncompressed brk(0) would require placing the entire initial
|
||||||
|
compressed program above uncompressed brk(0), which would significantly
|
||||||
|
increase the running brk(0); but too many programs break if brk(0)
|
||||||
|
moves. Thus on arm*-linux-elf the compressed executable begins
|
||||||
|
with 0x8000==.p_vaddr, all pages mapped by execve() that are also
|
||||||
|
occupied by decompressed bytes are removed before overwriting, and
|
||||||
|
/proc/self/exe becomes a "(deleted)" symlink. It might be possible
|
||||||
|
to preserve /proc/self/exe if the original uncompressed executable
|
||||||
|
were created with 0x9000==.p_vaddr (one page higher than the usual
|
||||||
|
0x8000) so that the compressed page mapped at 0x8000 would linger.
|
||||||
|
[This has not been tested.]
|
||||||
|
|
||||||
|
Linux stores the pathname argument that was specified to execve()
|
||||||
|
immediately after the '\0' which terminates the character string of the
|
||||||
|
last environment variable [as of execve()]. This is true for at least
|
||||||
|
all Linux 2.6, 2.4, and 2.2 kernels. Linux kernel 2.6.29 and later
|
||||||
|
records a pointer to that character string in Elf32_auxv[AT_EXECFN].
|
||||||
|
The pathname is not "bound" to the file as strongly as /proc/self/exe
|
||||||
|
(the file may be changed without affecting the pathname), but the
|
||||||
|
pathname does provide some information. The pathname may be relative
|
||||||
|
to the working directory, so look before any chdir().
|
||||||
|
|
||||||
|
The Elf formats for Linux add an environment variable named " " [three
|
||||||
|
spaces] which saves the results of readlink("/proc/self/exe",,) before
|
||||||
|
the runtime stub unmaps all its pages. As of 2006-10-03 this works
|
||||||
|
for linux/elf386 and linux/ElfAMD.
|
||||||
|
|||||||
+2
-2
@@ -108,14 +108,14 @@ then skip another one - the unfiltering process needs some information
|
|||||||
to be able to reverse the filtering.
|
to be able to reverse the filtering.
|
||||||
|
|
||||||
UPX uses the following idea, which works nicely. First we assume that
|
UPX uses the following idea, which works nicely. First we assume that
|
||||||
the size of the area that should be filtered is less than 16MB. Then
|
the size of the area that should be filtered is less than 16 MiB. Then
|
||||||
UPX scans over this area and keeps a record of the bytes that are
|
UPX scans over this area and keeps a record of the bytes that are
|
||||||
following the 0xE8 bytes. If we are lucky, there will be bytes that
|
following the 0xE8 bytes. If we are lucky, there will be bytes that
|
||||||
were not found following 0xE8. These bytes are our candidates to be
|
were not found following 0xE8. These bytes are our candidates to be
|
||||||
used as markers.
|
used as markers.
|
||||||
|
|
||||||
Do you still remember that we assumed that the size of scanned area is
|
Do you still remember that we assumed that the size of scanned area is
|
||||||
less than 16MB? Well, this means that when we process a real call, the
|
less than 16 MiB? Well, this means that when we process a real call, the
|
||||||
resulting offset will be less than 0x00FFFFFF too. So the MSB is always
|
resulting offset will be less than 0x00FFFFFF too. So the MSB is always
|
||||||
0x00. Which is a nice place to store our marker. Of course we should
|
0x00. Which is a nice place to store our marker. Of course we should
|
||||||
reverse the byte order in the resulting offset - so this marker will
|
reverse the byte order in the resulting offset - so this marker will
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
This documentation is written for those brave souls who want to
|
||||||
|
understand and/or modify the UPX assembly stubs - the small snippets
|
||||||
|
that do the runtime decompression when a compressed program is started.
|
||||||
|
|
||||||
|
If you look at the C++ source files, you can find code fragments like
|
||||||
|
this:
|
||||||
|
|
||||||
|
addLoader("PEMAIN20",
|
||||||
|
ih.entry ? "PEDOJUMP" : "PERETURN",
|
||||||
|
"IDENTSTR""UPX1HEAD",
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
linker->defineSymbol("original_entry", ih.entry);
|
||||||
|
|
||||||
|
and in the assembly files fragments like this:
|
||||||
|
|
||||||
|
section PEISDLL1
|
||||||
|
cmpb [esp + 8], 1
|
||||||
|
jnz reloc_end_jmp
|
||||||
|
|
||||||
|
section PEMAIN21
|
||||||
|
reloc_end_jmp:
|
||||||
|
|
||||||
|
section PERETURN
|
||||||
|
xor eax, eax
|
||||||
|
inc eax
|
||||||
|
ret 0x0C
|
||||||
|
section PEDOJUMP
|
||||||
|
jmp original_entry
|
||||||
|
|
||||||
|
Everything works as you would expect. If you want to add the code
|
||||||
|
fragment which is in `section PERETURN' to the runtime stub, then
|
||||||
|
simply use `addLoader("PERETURN")' in the C++ source.
|
||||||
|
|
||||||
|
That's nice, you could say, but how cross section jumps and calls are
|
||||||
|
handled? Well, that is the nicest part of this stuff - they are handled
|
||||||
|
automatically. All you have to do is to add the required sections to the
|
||||||
|
loader using `addLoader()' and the rest is done by upx. It will resolve
|
||||||
|
every conditional or unconditional jumps or subroutine calls for you.
|
||||||
|
|
||||||
|
You can also use (undefined) symbols in the assembly for values that
|
||||||
|
can only be computed during compression time (like `original_entry').
|
||||||
|
These symbols can be defined later in C++ using
|
||||||
|
|
||||||
|
linker->defineSymbol("xx", yy)
|
||||||
|
|
||||||
|
This functionality (we could say it's a simple linker) is achieved by
|
||||||
|
compiling the assembly into an ELF object file which a little C++
|
||||||
|
module (src/linker.cpp) can interpret and work with.
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
This documentation is written for those brave souls who want to
|
|
||||||
understand and/or modify the UPX assembly stubs - the small snippets
|
|
||||||
that do the runtime decompression when a compressed program is started.
|
|
||||||
|
|
||||||
So, how the runtime stub/loader generation works?
|
|
||||||
|
|
||||||
You might have already noticed that for some file formats the loaders
|
|
||||||
are quite simple (linux/i386 & tos) while in the other cases the
|
|
||||||
loaders look very suspicious: they're full of `%ifdef's and contain
|
|
||||||
loads of cryptic comments like `__PERELOC2__'.
|
|
||||||
|
|
||||||
If you look at the C++ source files, however you can notice that these
|
|
||||||
comment strings (without the leading and trailing underscores) are used
|
|
||||||
in the following way (they are all 8 character length strings):
|
|
||||||
|
|
||||||
addLoader("PEMAIN20",
|
|
||||||
ih.entry ? "PEDOJUMP" : "PERETURN",
|
|
||||||
"IDENTSTR""UPX1HEAD",
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
Basically that's all you have to know: when you want to add a section
|
|
||||||
of assembly code to the runtime loader, you just write
|
|
||||||
|
|
||||||
l_foo.asm
|
|
||||||
---------
|
|
||||||
;__FOOBAR00__
|
|
||||||
|
|
||||||
xor eax, eax
|
|
||||||
label1:
|
|
||||||
jmps label1
|
|
||||||
|
|
||||||
;__FOOBARZZ__
|
|
||||||
|
|
||||||
p_foo.cpp
|
|
||||||
---------
|
|
||||||
|
|
||||||
addLoader("FOOBAR00", NULL);
|
|
||||||
|
|
||||||
This will add the assembly section starting from __FOOBAR00__ and ending
|
|
||||||
before __FOOBARZZ__ to the loader. You can add an %ifdef - %endif pair
|
|
||||||
before these comments if you wish - but these conditionals will NOT be
|
|
||||||
seen by the assembler, they are just syntactic sugar to make the code a
|
|
||||||
little bit more readable and understandable. (Note however, that only
|
|
||||||
%ifdefs which are started on the 1st column are removed by the upx
|
|
||||||
assembly preprocessor program, so you can still use preprocessor
|
|
||||||
conditionals if you wish - just write them starting from the 2nd
|
|
||||||
column.)
|
|
||||||
|
|
||||||
That's nice, you could say, but how cross section jumps and calls are
|
|
||||||
handled? Well, that is the nicest part of this stuff - they are handled
|
|
||||||
automatically. All you have to do is to add the required sections to the
|
|
||||||
loader using `addLoader()' and the rest is done by upx. It will resolve
|
|
||||||
every conditional or unconditional jumps or subrutine calls for you.
|
|
||||||
|
|
||||||
This functionality (we could say it's a simple linker) is achived by the
|
|
||||||
assembly preprocessor (src/stub/scripts/app.pl) and a little C++ module
|
|
||||||
(src/linker.cpp). And of course NASM - the Netwide Assembler. You can
|
|
||||||
see what's going on behind the scenes - just do:
|
|
||||||
|
|
||||||
cd src/stubs
|
|
||||||
make maintainer-clean
|
|
||||||
make all
|
|
||||||
|
|
||||||
This will rebuild all the loaders - and keep the temporary files (*.as[xy])
|
|
||||||
which are seen by the assembler.
|
|
||||||
|
|
||||||
Currently this loader/stub building method only works with ix86
|
|
||||||
assembly - both app.pl and linker.cpp heavily rely on this when dealing
|
|
||||||
with cross section references.
|
|
||||||
|
|
||||||
And finally some important features/requirements you should be aware of:
|
|
||||||
|
|
||||||
- as previously stated - preprocessor conditionals starting on the 1st
|
|
||||||
column are removed by app.pl
|
|
||||||
- sections are separated by comments in the form `;__X1234567__'
|
|
||||||
- jumps are recognized by searching for a word which starts with `j'
|
|
||||||
and followed by a label - this also means that `jmp short label1'
|
|
||||||
will NOT be recognized (but you can use a macro called `jmps' for it
|
|
||||||
by adding `%define jmps jmp short' to the beginning of the file)
|
|
||||||
- at the end of the file you need something like this
|
|
||||||
|
|
||||||
eof:
|
|
||||||
; __XTHEENDX__
|
|
||||||
section .data
|
|
||||||
dd -1
|
|
||||||
dw eof
|
|
||||||
|
|
||||||
That's all for now.
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
UPX and SELinux
|
||||||
|
March 6, 2006
|
||||||
|
|
||||||
|
|
||||||
|
When a program that has been compressed by UPX is run, the decompressor
|
||||||
|
must create and write new memory pages of executable instructions.
|
||||||
|
SELinux (Security Enhanced Linux) directly controls the conditions
|
||||||
|
under which generating and/or executing new instructions is allowed,
|
||||||
|
so the configuration settings of SELinux affect the running of programs
|
||||||
|
that have been compressed by UPX.
|
||||||
|
|
||||||
|
In SELinux "strict enforcing" mode (the most restrictive), generating
|
||||||
|
new instructions at runtime is not allowed at all: any page with
|
||||||
|
PROT_EXEC permission must be mapped from a file in a mounted filesystem
|
||||||
|
that has 'x' [eXecute] permission, and the generation of such files is
|
||||||
|
also tightly controlled. A program that was compressed by UPX will not
|
||||||
|
run in SELinux strict enforcing mode. Attempts will fail with exit
|
||||||
|
code 127, and a record will be added to the history file
|
||||||
|
/var/log/audit/audit.log.
|
||||||
|
|
||||||
|
In "targeted enforcing" mode, SELinux pays close attention mostly to
|
||||||
|
designated processes that run with elevated privileges: web server,
|
||||||
|
print server, login server, etc. Ordinary user executables receive
|
||||||
|
much less scrutiny. However, one of the eventual goals of SELinux is to
|
||||||
|
eradicate runtime generation of instructions because of the possibility
|
||||||
|
for exploitation by malware (virus, trojan, key logger, privilege
|
||||||
|
elevation exploit, etc.) Thus targeted enforcing mode notices and
|
||||||
|
logs the use of "execmem" capability that is used by a program which
|
||||||
|
was compressed by UPX. In keeping with the goal of eventual prohibition,
|
||||||
|
SELinux ordinarily would deny execmem. However, most current SELinux
|
||||||
|
systems, including Fedora Core 5 [set for release March 15, 2006],
|
||||||
|
override this with "allow_exemem=1" in /etc/selinux/targeted/booleans.
|
||||||
|
Thus a program compressed by UPX will run in the default installed
|
||||||
|
configuration (targeted enforcing, allow_execmem=1) of SELinux under
|
||||||
|
Fedora Core 5. Each invocation will add a few lines to the log file
|
||||||
|
/var/log/audit/audit.log, one line for each use of execmem. If the
|
||||||
|
SELinux policy becomes more restrictive in the future, then a special
|
||||||
|
SELinux class or other mechanism must be created for compressed programs,
|
||||||
|
or else UPX-compressed executables will not run then.
|
||||||
|
|
||||||
|
In its "permissive" modes, SELinux just logs the potential problems,
|
||||||
|
but otherwise does not interfere. A program compressed by UPX will run
|
||||||
|
in any permissive mode.
|
||||||
@@ -0,0 +1,807 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>upx - compress or expand executable files</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<link rev="made" href="mailto:root@localhost" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h1 id="NAME">NAME</h1>
|
||||||
|
|
||||||
|
<p>upx - compress or expand executable files</p>
|
||||||
|
|
||||||
|
<h1 id="SYNOPSIS">SYNOPSIS</h1>
|
||||||
|
|
||||||
|
<p><b>upx</b> <span style="white-space: nowrap;">[ <i>command</i> ]</span> <span style="white-space: nowrap;">[ <i>options</i> ]</span> <i>filename</i>...</p>
|
||||||
|
|
||||||
|
<h1 id="ABSTRACT">ABSTRACT</h1>
|
||||||
|
|
||||||
|
<pre><code> The Ultimate Packer for eXecutables
|
||||||
|
Copyright (c) 1996-2022 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
|
https://upx.github.io</code></pre>
|
||||||
|
|
||||||
|
<p><b>UPX</b> is a portable, extendable, high-performance executable packer for several different executable formats. It achieves an excellent compression ratio and offers <i>*very*</i> fast decompression. Your executables suffer no memory overhead or other drawbacks for most of the formats supported, because of in-place decompression.</p>
|
||||||
|
|
||||||
|
<h1 id="DISCLAIMER">DISCLAIMER</h1>
|
||||||
|
|
||||||
|
<p><b>UPX</b> comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.</p>
|
||||||
|
|
||||||
|
<p>Please report all problems or suggestions to the authors. Thanks.</p>
|
||||||
|
|
||||||
|
<h1 id="SECURITY-CONTEXT">SECURITY CONTEXT</h1>
|
||||||
|
|
||||||
|
<p>IMPORTANT NOTE: <b>UPX</b> inherits the security context of any files it handles.</p>
|
||||||
|
|
||||||
|
<p>This means that packing, unpacking, or even testing or listing a file requires the same security considerations as actually executing the file.</p>
|
||||||
|
|
||||||
|
<p>Use <b>UPX</b> on trusted files only!</p>
|
||||||
|
|
||||||
|
<h1 id="DESCRIPTION">DESCRIPTION</h1>
|
||||||
|
|
||||||
|
<p><b>UPX</b> is a versatile executable packer with the following features:</p>
|
||||||
|
|
||||||
|
<pre><code>- secure: as UPX is documented Open Source since many years any relevant
|
||||||
|
Security/Antivirus software is able to peek inside UPX compressed
|
||||||
|
apps to verify them
|
||||||
|
|
||||||
|
- excellent compression ratio: typically compresses better than Zip,
|
||||||
|
use UPX to decrease the size of your distribution !
|
||||||
|
|
||||||
|
- very fast decompression: more than 500 MB/sec on any reasonably modern
|
||||||
|
machine
|
||||||
|
|
||||||
|
- no memory overhead for your compressed executables for most of the
|
||||||
|
supported formats because of in-place decompression
|
||||||
|
|
||||||
|
- safe: you can list, test and unpack your executables.
|
||||||
|
Also, a checksum of both the compressed and uncompressed file is
|
||||||
|
maintained internally.
|
||||||
|
|
||||||
|
- universal: UPX can pack a number of executable formats, including
|
||||||
|
Windows programs and DLLs, macOS apps and Linux executables
|
||||||
|
|
||||||
|
- portable: UPX is written in portable endian-neutral C++
|
||||||
|
|
||||||
|
- extendable: because of the class layout it's very easy to support
|
||||||
|
new executable formats or add new compression algorithms
|
||||||
|
|
||||||
|
- free: UPX is distributed with full source code under the GNU General
|
||||||
|
Public License v2+, with special exceptions granting the free usage
|
||||||
|
for commercial programs</code></pre>
|
||||||
|
|
||||||
|
<p>You probably understand now why we call <b>UPX</b> the "<i>ultimate</i>" executable packer.</p>
|
||||||
|
|
||||||
|
<h1 id="COMMANDS">COMMANDS</h1>
|
||||||
|
|
||||||
|
<h2 id="Compress">Compress</h2>
|
||||||
|
|
||||||
|
<p>This is the default operation, eg. <b>upx yourfile.exe</b> will compress the file specified on the command line.</p>
|
||||||
|
|
||||||
|
<h2 id="Decompress">Decompress</h2>
|
||||||
|
|
||||||
|
<p>All <b>UPX</b> supported file formats can be unpacked using the <b>-d</b> switch, eg. <b>upx -d yourfile.exe</b> will uncompress the file you've just compressed.</p>
|
||||||
|
|
||||||
|
<h2 id="Test">Test</h2>
|
||||||
|
|
||||||
|
<p>The <b>-t</b> command tests the integrity of the compressed and uncompressed data, eg. <b>upx -t yourfile.exe</b> check whether your file can be safely decompressed. Note, that this command doesn't check the whole file, only the part that will be uncompressed during program execution. This means that you should not use this command instead of a virus checker.</p>
|
||||||
|
|
||||||
|
<h2 id="List">List</h2>
|
||||||
|
|
||||||
|
<p>The <b>-l</b> command prints out some information about the compressed files specified on the command line as parameters, eg <b>upx -l yourfile.exe</b> shows the compressed / uncompressed size and the compression ratio of <i>yourfile.exe</i>.</p>
|
||||||
|
|
||||||
|
<h1 id="OPTIONS">OPTIONS</h1>
|
||||||
|
|
||||||
|
<p><b>-q</b>: be quiet, suppress warnings</p>
|
||||||
|
|
||||||
|
<p><b>-q -q</b> (or <b>-qq</b>): be very quiet, suppress errors</p>
|
||||||
|
|
||||||
|
<p><b>-q -q -q</b> (or <b>-qqq</b>): produce no output at all</p>
|
||||||
|
|
||||||
|
<p><b>--help</b>: prints the help</p>
|
||||||
|
|
||||||
|
<p><b>--version</b>: print the version of <b>UPX</b></p>
|
||||||
|
|
||||||
|
<p><b>--exact</b>: when compressing, require to be able to get a byte-identical file after decompression with option <b>-d</b>. [NOTE: this is work in progress and is not supported for all formats yet. If you do care, as a workaround you can compress and then decompress your program a first time - any further compress-decompress steps should then yield byte-identical results as compared to the first decompressed version.]</p>
|
||||||
|
|
||||||
|
<p><b>-k</b>: keep backup files</p>
|
||||||
|
|
||||||
|
<p><b>-o file</b>: write output to file</p>
|
||||||
|
|
||||||
|
<p>[ ...more docs need to be written... - type `<b>upx --help</b>' for now ]</p>
|
||||||
|
|
||||||
|
<h1 id="COMPRESSION-LEVELS-TUNING">COMPRESSION LEVELS & TUNING</h1>
|
||||||
|
|
||||||
|
<p><b>UPX</b> offers ten different compression levels from <b>-1</b> to <b>-9</b>, and <b>--best</b>. The default compression level is <b>-8</b> for files smaller than 512 KiB, and <b>-7</b> otherwise.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li><p>Compression levels 1, 2 and 3 are pretty fast.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li><p>Compression levels 4, 5 and 6 achieve a good time/ratio performance.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li><p>Compression levels 7, 8 and 9 favor compression ratio over speed.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li><p>Compression level <b>--best</b> may take a long time.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Note that compression level <b>--best</b> can be somewhat slow for large files, but you definitely should use it when releasing a final version of your program.</p>
|
||||||
|
|
||||||
|
<p>Quick info for achieving the best compression ratio:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li><p>Try <b>upx --brute --no-lzma myfile.exe</b> or even <b>upx --ultra-brute --no-lzma myfile.exe</b>.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li><p>The option <b>--lzma</b> enables LZMA compression, which compresses better but is *significantly slower* at decompression. You probably do not want to use it for large files.</p>
|
||||||
|
|
||||||
|
<p>(Note that <b>--lzma</b> is automatically enabled by <b>--all-methods</b> and <b>--brute</b>, use <b>--no-lzma</b> to override.)</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li><p>Try if <b>--overlay=strip</b> works.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li><p>For win32/pe programs there's <b>--strip-relocs=0</b>. See notes below.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1 id="OVERLAY-HANDLING-OPTIONS">OVERLAY HANDLING OPTIONS</h1>
|
||||||
|
|
||||||
|
<p>Info: An "overlay" means auxiliary data attached after the logical end of an executable, and it often contains application specific data (this is a common practice to avoid an extra data file, though it would be better to use resource sections).</p>
|
||||||
|
|
||||||
|
<p><b>UPX</b> handles overlays like many other executable packers do: it simply copies the overlay after the compressed image. This works with some files, but doesn't work with others, depending on how an application actually accesses this overlayed data.</p>
|
||||||
|
|
||||||
|
<pre><code>--overlay=copy Copy any extra data attached to the file. [DEFAULT]
|
||||||
|
|
||||||
|
--overlay=strip Strip any overlay from the program instead of
|
||||||
|
copying it. Be warned, this may make the compressed
|
||||||
|
program crash or otherwise unusable.
|
||||||
|
|
||||||
|
--overlay=skip Refuse to compress any program which has an overlay.</code></pre>
|
||||||
|
|
||||||
|
<h1 id="ENVIRONMENT-VARIABLE">ENVIRONMENT VARIABLE</h1>
|
||||||
|
|
||||||
|
<p>The environment variable <b>UPX</b> can hold a set of default options for <b>UPX</b>. These options are interpreted first and can be overwritten by explicit command line parameters. For example:</p>
|
||||||
|
|
||||||
|
<pre><code>for DOS/Windows: set UPX=-9 --compress-icons#0
|
||||||
|
for sh/ksh/zsh: UPX="-9 --compress-icons=0"; export UPX
|
||||||
|
for csh/tcsh: setenv UPX "-9 --compress-icons=0"</code></pre>
|
||||||
|
|
||||||
|
<p>Under DOS/Windows you must use '#' instead of '=' when setting the environment variable because of a COMMAND.COM limitation.</p>
|
||||||
|
|
||||||
|
<p>Not all of the options are valid in the environment variable - <b>UPX</b> will tell you.</p>
|
||||||
|
|
||||||
|
<p>You can explicitly use the <b>--no-env</b> option to ignore the environment variable.</p>
|
||||||
|
|
||||||
|
<h1 id="NOTES-FOR-THE-SUPPORTED-EXECUTABLE-FORMATS">NOTES FOR THE SUPPORTED EXECUTABLE FORMATS</h1>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-ATARI-TOS">NOTES FOR ATARI/TOS</h2>
|
||||||
|
|
||||||
|
<p>This is the executable format used by the Atari ST/TT, a Motorola 68000 based personal computer which was popular in the late '80s. Support of this format is only because of nostalgic feelings of one of the authors and serves no practical purpose :-). See https://freemint.github.io for more info.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression. All debug information will be stripped, though.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-BVMLINUZ-I386">NOTES FOR BVMLINUZ/I386</h2>
|
||||||
|
|
||||||
|
<p>Same as vmlinuz/i386.</p>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-DOS-COM">NOTES FOR DOS/COM</h2>
|
||||||
|
|
||||||
|
<p>Obviously <b>UPX</b> won't work with executables that want to read data from themselves (like some commandline utilities that ship with Win95/98/ME).</p>
|
||||||
|
|
||||||
|
<p>Compressed programs only work on a 286+.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression.</p>
|
||||||
|
|
||||||
|
<p>Maximum uncompressed size: ~65100 bytes.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--8086 Create an executable that works on any 8086 CPU.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-DOS-EXE">NOTES FOR DOS/EXE</h2>
|
||||||
|
|
||||||
|
<p>dos/exe stands for all "normal" 16-bit DOS executables.</p>
|
||||||
|
|
||||||
|
<p>Obviously <b>UPX</b> won't work with executables that want to read data from themselves (like some command line utilities that ship with Win95/98/ME).</p>
|
||||||
|
|
||||||
|
<p>Compressed programs only work on a 286+.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--8086 Create an executable that works on any 8086 CPU.
|
||||||
|
|
||||||
|
--no-reloc Use no relocation records in the exe header.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-DOS-SYS">NOTES FOR DOS/SYS</h2>
|
||||||
|
|
||||||
|
<p>Compressed programs only work on a 286+.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression.</p>
|
||||||
|
|
||||||
|
<p>Maximum uncompressed size: ~65350 bytes.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--8086 Create an executable that works on any 8086 CPU.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-DJGPP2-COFF">NOTES FOR DJGPP2/COFF</h2>
|
||||||
|
|
||||||
|
<p>First of all, it is recommended to use <b>UPX</b> *instead* of <b>strip</b>. strip has the very bad habit of replacing your stub with its own (outdated) version. Additionally <b>UPX</b> corrects a bug/feature in strip v2.8.x: it will fix the 4 KiB alignment of the stub.</p>
|
||||||
|
|
||||||
|
<p><b>UPX</b> includes the full functionality of stubify. This means it will automatically stubify your COFF files. Use the option <b>--coff</b> to disable this functionality (see below).</p>
|
||||||
|
|
||||||
|
<p><b>UPX</b> automatically handles Allegro packfiles.</p>
|
||||||
|
|
||||||
|
<p>The DLM format (a rather exotic shared library extension) is not supported.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression. All debug information and trailing garbage will be stripped, though.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--coff Produce COFF output instead of EXE. By default
|
||||||
|
UPX keeps your current stub.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-LINUX-general">NOTES FOR LINUX [general]</h2>
|
||||||
|
|
||||||
|
<p>Introduction</p>
|
||||||
|
|
||||||
|
<pre><code>Linux/386 support in UPX consists of 3 different executable formats,
|
||||||
|
one optimized for ELF executables ("linux/elf386"), one optimized
|
||||||
|
for shell scripts ("linux/sh386"), and one generic format
|
||||||
|
("linux/386").
|
||||||
|
|
||||||
|
We will start with a general discussion first, but please
|
||||||
|
also read the relevant docs for each of the individual formats.
|
||||||
|
|
||||||
|
Also, there is special support for bootable kernels - see the
|
||||||
|
description of the vmlinuz/386 format.</code></pre>
|
||||||
|
|
||||||
|
<p>General user's overview</p>
|
||||||
|
|
||||||
|
<pre><code>Running a compressed executable program trades less space on a
|
||||||
|
``permanent'' storage medium (such as a hard disk, floppy disk,
|
||||||
|
CD-ROM, flash memory, EPROM, etc.) for more space in one or more
|
||||||
|
``temporary'' storage media (such as RAM, swap space, /tmp, etc.).
|
||||||
|
Running a compressed executable also requires some additional CPU
|
||||||
|
cycles to generate the compressed executable in the first place,
|
||||||
|
and to decompress it at each invocation.
|
||||||
|
|
||||||
|
How much space is traded? It depends on the executable, but many
|
||||||
|
programs save 30% to 50% of permanent disk space. How much CPU
|
||||||
|
overhead is there? Again, it depends on the executable, but
|
||||||
|
decompression speed generally is at least many megabytes per second,
|
||||||
|
and frequently is limited by the speed of the underlying disk
|
||||||
|
or network I/O.
|
||||||
|
|
||||||
|
Depending on the statistics of usage and access, and the relative
|
||||||
|
speeds of CPU, RAM, swap space, /tmp, and file system storage, then
|
||||||
|
invoking and running a compressed executable can be faster than
|
||||||
|
directly running the corresponding uncompressed program.
|
||||||
|
The operating system might perform fewer expensive I/O operations
|
||||||
|
to invoke the compressed program. Paging to or from swap space
|
||||||
|
or /tmp might be faster than paging from the general file system.
|
||||||
|
``Medium-sized'' programs which access about 1/3 to 1/2 of their
|
||||||
|
stored program bytes can do particularly well with compression.
|
||||||
|
Small programs tend not to benefit as much because the absolute
|
||||||
|
savings is less. Big programs tend not to benefit proportionally
|
||||||
|
because each invocation may use only a small fraction of the program,
|
||||||
|
yet UPX decompresses the entire program before invoking it.
|
||||||
|
But in environments where disk or flash memory storage is limited,
|
||||||
|
then compression may win anyway.
|
||||||
|
|
||||||
|
Currently, executables compressed by UPX do not share RAM at runtime
|
||||||
|
in the way that executables mapped from a file system do. As a
|
||||||
|
result, if the same program is run simultaneously by more than one
|
||||||
|
process, then using the compressed version will require more RAM and/or
|
||||||
|
swap space. So, shell programs (bash, csh, etc.) and ``make''
|
||||||
|
might not be good candidates for compression.
|
||||||
|
|
||||||
|
UPX recognizes three executable formats for Linux: Linux/elf386,
|
||||||
|
Linux/sh386, and Linux/386. Linux/386 is the most generic format;
|
||||||
|
it accommodates any file that can be executed. At runtime, the UPX
|
||||||
|
decompression stub re-creates in /tmp a copy of the original file,
|
||||||
|
and then the copy is (re-)executed with the same arguments.
|
||||||
|
ELF binary executables prefer the Linux/elf386 format by default,
|
||||||
|
because UPX decompresses them directly into RAM, uses only one
|
||||||
|
exec, does not use space in /tmp, and does not use /proc.
|
||||||
|
Shell scripts where the underlying shell accepts a ``-c'' argument
|
||||||
|
can use the Linux/sh386 format. UPX decompresses the shell script
|
||||||
|
into low memory, then maps the shell and passes the entire text of the
|
||||||
|
script as an argument with a leading ``-c''.</code></pre>
|
||||||
|
|
||||||
|
<p>General benefits:</p>
|
||||||
|
|
||||||
|
<pre><code>- UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
|
||||||
|
libc6, Shell/Perl/Python/... scripts, standalone Java .class
|
||||||
|
binaries, or whatever...
|
||||||
|
All scripts and programs will work just as before.
|
||||||
|
|
||||||
|
- Compressed programs are completely self-contained. No need for
|
||||||
|
any external program.
|
||||||
|
|
||||||
|
- UPX keeps your original program untouched. This means that
|
||||||
|
after decompression you will have a byte-identical version,
|
||||||
|
and you can use UPX as a file compressor just like gzip.
|
||||||
|
[ Note that UPX maintains a checksum of the file internally,
|
||||||
|
so it is indeed a reliable alternative. ]
|
||||||
|
|
||||||
|
- As the stub only uses syscalls and isn't linked against libc it
|
||||||
|
should run under any Linux configuration that can run ELF
|
||||||
|
binaries.
|
||||||
|
|
||||||
|
- For the same reason compressed executables should run under
|
||||||
|
FreeBSD and other systems which can run Linux binaries.
|
||||||
|
[ Please send feedback on this topic ]</code></pre>
|
||||||
|
|
||||||
|
<p>General drawbacks:</p>
|
||||||
|
|
||||||
|
<pre><code>- It is not advisable to compress programs which usually have many
|
||||||
|
instances running (like `sh' or `make') because the common segments of
|
||||||
|
compressed programs won't be shared any longer between different
|
||||||
|
processes.
|
||||||
|
|
||||||
|
- `ldd' and `size' won't show anything useful because all they
|
||||||
|
see is the statically linked stub. Since version 0.82 the section
|
||||||
|
headers are stripped from the UPX stub and `size' doesn't even
|
||||||
|
recognize the file format. The file patches/patch-elfcode.h has a
|
||||||
|
patch to fix this bug in `size' and other programs which use GNU BFD.</code></pre>
|
||||||
|
|
||||||
|
<p>General notes:</p>
|
||||||
|
|
||||||
|
<pre><code>- As UPX leaves your original program untouched it is advantageous
|
||||||
|
to strip it before compression.
|
||||||
|
|
||||||
|
- If you compress a script you will lose platform independence -
|
||||||
|
this could be a problem if you are using NFS mounted disks.
|
||||||
|
|
||||||
|
- Compression of suid, guid and sticky-bit programs is rejected
|
||||||
|
because of possible security implications.
|
||||||
|
|
||||||
|
- For the same reason there is no sense in making any compressed
|
||||||
|
program suid.
|
||||||
|
|
||||||
|
- Obviously UPX won't work with executables that want to read data
|
||||||
|
from themselves. E.g., this might be a problem for Perl scripts
|
||||||
|
which access their __DATA__ lines.
|
||||||
|
|
||||||
|
- In case of internal errors the stub will abort with exitcode 127.
|
||||||
|
Typical reasons for this to happen are that the program has somehow
|
||||||
|
been modified after compression.
|
||||||
|
Running `strace -o strace.log compressed_file' will tell you more.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-LINUX-ELF386">NOTES FOR LINUX/ELF386</h2>
|
||||||
|
|
||||||
|
<p>Please read the general Linux description first.</p>
|
||||||
|
|
||||||
|
<p>The linux/elf386 format decompresses directly into RAM, uses only one exec, does not use space in /tmp, and does not use /proc.</p>
|
||||||
|
|
||||||
|
<p>Linux/elf386 is automatically selected for Linux ELF executables.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression.</p>
|
||||||
|
|
||||||
|
<p>How it works:</p>
|
||||||
|
|
||||||
|
<pre><code>For ELF executables, UPX decompresses directly to memory, simulating
|
||||||
|
the mapping that the operating system kernel uses during exec(),
|
||||||
|
including the PT_INTERP program interpreter (if any).
|
||||||
|
The brk() is set by a special PT_LOAD segment in the compressed
|
||||||
|
executable itself. UPX then wipes the stack clean except for
|
||||||
|
arguments, environment variables, and Elf_auxv entries (this is
|
||||||
|
required by bugs in the startup code of /lib/ld-linux.so as of
|
||||||
|
May 2000), and transfers control to the program interpreter or
|
||||||
|
the e_entry address of the original executable.
|
||||||
|
|
||||||
|
The UPX stub is about 1700 bytes long, partly written in assembler
|
||||||
|
and only uses kernel syscalls. It is not linked against any libc.</code></pre>
|
||||||
|
|
||||||
|
<p>Specific drawbacks:</p>
|
||||||
|
|
||||||
|
<pre><code>- For linux/elf386 and linux/sh386 formats, you will be relying on
|
||||||
|
RAM and swap space to hold all of the decompressed program during
|
||||||
|
the lifetime of the process. If you already use most of your swap
|
||||||
|
space, then you may run out. A system that is "out of memory"
|
||||||
|
can become fragile. Many programs do not react gracefully when
|
||||||
|
malloc() returns 0. With newer Linux kernels, the kernel
|
||||||
|
may decide to kill some processes to regain memory, and you
|
||||||
|
may not like the kernel's choice of which to kill. Running
|
||||||
|
/usr/bin/top is one way to check on the usage of swap space.</code></pre>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>(none)</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-LINUX-SH386">NOTES FOR LINUX/SH386</h2>
|
||||||
|
|
||||||
|
<p>Please read the general Linux description first.</p>
|
||||||
|
|
||||||
|
<p>Shell scripts where the underling shell accepts a ``-c'' argument can use the Linux/sh386 format. <b>UPX</b> decompresses the shell script into low memory, then maps the shell and passes the entire text of the script as an argument with a leading ``-c''. It does not use space in /tmp, and does not use /proc.</p>
|
||||||
|
|
||||||
|
<p>Linux/sh386 is automatically selected for shell scripts that use a known shell.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression.</p>
|
||||||
|
|
||||||
|
<p>How it works:</p>
|
||||||
|
|
||||||
|
<pre><code>For shell script executables (files beginning with "#!/" or "#! /")
|
||||||
|
where the shell is known to accept "-c <command>", UPX decompresses
|
||||||
|
the file into low memory, then maps the shell (and its PT_INTERP),
|
||||||
|
and passes control to the shell with the entire decompressed file
|
||||||
|
as the argument after "-c". Known shells are sh, ash, bash, bsh, csh,
|
||||||
|
ksh, tcsh, pdksh. Restriction: UPX cannot use this method
|
||||||
|
for shell scripts which use the one optional string argument after
|
||||||
|
the shell name in the script (example: "#! /bin/sh option3\n".)
|
||||||
|
|
||||||
|
The UPX stub is about 1700 bytes long, partly written in assembler
|
||||||
|
and only uses kernel syscalls. It is not linked against any libc.</code></pre>
|
||||||
|
|
||||||
|
<p>Specific drawbacks:</p>
|
||||||
|
|
||||||
|
<pre><code>- For linux/elf386 and linux/sh386 formats, you will be relying on
|
||||||
|
RAM and swap space to hold all of the decompressed program during
|
||||||
|
the lifetime of the process. If you already use most of your swap
|
||||||
|
space, then you may run out. A system that is "out of memory"
|
||||||
|
can become fragile. Many programs do not react gracefully when
|
||||||
|
malloc() returns 0. With newer Linux kernels, the kernel
|
||||||
|
may decide to kill some processes to regain memory, and you
|
||||||
|
may not like the kernel's choice of which to kill. Running
|
||||||
|
/usr/bin/top is one way to check on the usage of swap space.</code></pre>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>(none)</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-LINUX-386">NOTES FOR LINUX/386</h2>
|
||||||
|
|
||||||
|
<p>Please read the general Linux description first.</p>
|
||||||
|
|
||||||
|
<p>The generic linux/386 format decompresses to /tmp and needs /proc file system support. It starts the decompressed program via the execve() syscall.</p>
|
||||||
|
|
||||||
|
<p>Linux/386 is only selected if the specialized linux/elf386 and linux/sh386 won't recognize a file.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression.</p>
|
||||||
|
|
||||||
|
<p>How it works:</p>
|
||||||
|
|
||||||
|
<pre><code>For files which are not ELF and not a script for a known "-c" shell,
|
||||||
|
UPX uses kernel execve(), which first requires decompressing to a
|
||||||
|
temporary file in the file system. Interestingly -
|
||||||
|
because of the good memory management of the Linux kernel - this
|
||||||
|
often does not introduce a noticeable delay, and in fact there
|
||||||
|
will be no disk access at all if you have enough free memory as
|
||||||
|
the entire process takes places within the file system buffers.
|
||||||
|
|
||||||
|
A compressed executable consists of the UPX stub and an overlay
|
||||||
|
which contains the original program in a compressed form.
|
||||||
|
|
||||||
|
The UPX stub is a statically linked ELF executable and does
|
||||||
|
the following at program startup:
|
||||||
|
|
||||||
|
1) decompress the overlay to a temporary location in /tmp
|
||||||
|
2) open the temporary file for reading
|
||||||
|
3) try to delete the temporary file and start (execve)
|
||||||
|
the uncompressed program in /tmp using /proc/<pid>/fd/X as
|
||||||
|
attained by step 2)
|
||||||
|
4) if that fails, fork off a subprocess to clean up and
|
||||||
|
start the program in /tmp in the meantime
|
||||||
|
|
||||||
|
The UPX stub is about 1700 bytes long, partly written in assembler
|
||||||
|
and only uses kernel syscalls. It is not linked against any libc.</code></pre>
|
||||||
|
|
||||||
|
<p>Specific drawbacks:</p>
|
||||||
|
|
||||||
|
<pre><code>- You need additional free disk space for the uncompressed program
|
||||||
|
in your /tmp directory. This program is deleted immediately after
|
||||||
|
decompression, but you still need it for the full execution time
|
||||||
|
of the program.
|
||||||
|
|
||||||
|
- You must have /proc file system support as the stub wants to open
|
||||||
|
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
|
||||||
|
cannot compress programs that are used during the boot sequence
|
||||||
|
before /proc is mounted.
|
||||||
|
|
||||||
|
- Utilities like `top' will display numerical values in the process
|
||||||
|
name field. This is because Linux computes the process name from
|
||||||
|
the first argument of the last execve syscall (which is typically
|
||||||
|
something like /proc/<pid>/fd/3).
|
||||||
|
|
||||||
|
- Because of temporary decompression to disk the decompression speed
|
||||||
|
is not as fast as with the other executable formats. Still, I can see
|
||||||
|
no noticeable delay when starting programs like my ~3 MiB emacs (which
|
||||||
|
is less than 1 MiB when compressed :-).</code></pre>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--force-execve Force the use of the generic linux/386 "execve"
|
||||||
|
format, i.e. do not try the linux/elf386 and
|
||||||
|
linux/sh386 formats.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-PS1-EXE">NOTES FOR PS1/EXE</h2>
|
||||||
|
|
||||||
|
<p>This is the executable format used by the Sony PlayStation (PSone), a MIPS R3000 based gaming console which is popular since the late '90s. Support of this format is very similar to the Atari one, because of nostalgic feelings of one of the authors.</p>
|
||||||
|
|
||||||
|
<p>Packed programs will be byte-identical to the original after uncompression, until further notice.</p>
|
||||||
|
|
||||||
|
<p>Maximum uncompressed size: ~1.89 / ~7.60 MiB.</p>
|
||||||
|
|
||||||
|
<p>Notes:</p>
|
||||||
|
|
||||||
|
<pre><code>- UPX creates as default a suitable executable for CD-Mastering
|
||||||
|
and console transfer. For a CD-Master main executable you could also try
|
||||||
|
the special option "--boot-only" as described below.
|
||||||
|
It has been reported that upx packed executables are fully compatible with
|
||||||
|
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
|
||||||
|
Sony PlayStation (PSone) emulation mode.
|
||||||
|
|
||||||
|
- Normally the packed files use the same memory areas like the uncompressed
|
||||||
|
versions, so they will not override other memory areas while unpacking.
|
||||||
|
If this isn't possible UPX will abort showing a 'packed data overlap'
|
||||||
|
error. With the "--force" option UPX will relocate the loading address
|
||||||
|
for the packed file, but this isn't a real problem if it is a single or
|
||||||
|
the main executable.</code></pre>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--8-bit Uses 8 bit size compression [default: 32 bit]
|
||||||
|
|
||||||
|
--8mib-ram PSone has 8 MiB ram available [default: 2 MiB]
|
||||||
|
|
||||||
|
--boot-only This format is for main exes and CD-Mastering only !
|
||||||
|
It may slightly improve the compression ratio,
|
||||||
|
decompression routines are faster than default ones.
|
||||||
|
But it cannot be used for console transfer !
|
||||||
|
|
||||||
|
--no-align This option disables CD mode 2 data sector format
|
||||||
|
alignment. May slightly improves the compression ratio,
|
||||||
|
but the compressed executable will not boot from a CD.
|
||||||
|
Use it for console transfer only !</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-RTM32-PE-and-ARM-PE">NOTES FOR RTM32/PE and ARM/PE</h2>
|
||||||
|
|
||||||
|
<p>Same as win32/pe.</p>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-TMT-ADAM">NOTES FOR TMT/ADAM</h2>
|
||||||
|
|
||||||
|
<p>This format is used by the TMT Pascal compiler - see http://www.tmt.com/ .</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-VMLINUZ-386">NOTES FOR VMLINUZ/386</h2>
|
||||||
|
|
||||||
|
<p>The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable Linux kernel image ("vmlinuz", "zImage", "bzImage"), gzip-decompress it and re-compress it with the <b>UPX</b> compression method.</p>
|
||||||
|
|
||||||
|
<p>vmlinuz/386 is completely unrelated to the other Linux executable formats, and it does not share any of their drawbacks.</p>
|
||||||
|
|
||||||
|
<p>Notes:</p>
|
||||||
|
|
||||||
|
<pre><code>- Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
|
||||||
|
during compression - otherwise a wrong executable format
|
||||||
|
may have been used, and the kernel won't boot.</code></pre>
|
||||||
|
|
||||||
|
<p>Benefits:</p>
|
||||||
|
|
||||||
|
<pre><code>- Better compression (but note that the kernel was already compressed,
|
||||||
|
so the improvement is not as large as with other formats).
|
||||||
|
Still, the bytes saved may be essential for special needs like
|
||||||
|
boot disks.
|
||||||
|
|
||||||
|
For example, this is what I get for my 2.2.16 kernel:
|
||||||
|
1589708 vmlinux
|
||||||
|
641073 bzImage [original]
|
||||||
|
560755 bzImage.upx [compressed by "upx -9"]
|
||||||
|
|
||||||
|
- Much faster decompression at kernel boot time (but kernel
|
||||||
|
decompression speed is not really an issue these days).</code></pre>
|
||||||
|
|
||||||
|
<p>Drawbacks:</p>
|
||||||
|
|
||||||
|
<pre><code>(none)</code></pre>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-WATCOM-LE">NOTES FOR WATCOM/LE</h2>
|
||||||
|
|
||||||
|
<p><b>UPX</b> has been successfully tested with the following extenders: DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly supported (for details see the file bugs BUGS).</p>
|
||||||
|
|
||||||
|
<p>DLLs and the LX format are not supported.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--le Produce an unbound LE output instead of
|
||||||
|
keeping the current stub.</code></pre>
|
||||||
|
|
||||||
|
<h2 id="NOTES-FOR-WIN32-PE">NOTES FOR WIN32/PE</h2>
|
||||||
|
|
||||||
|
<p>The PE support in <b>UPX</b> is quite stable now, but probably there are still some incompatibilities with some files.</p>
|
||||||
|
|
||||||
|
<p>Because of the way <b>UPX</b> (and other packers for this format) works, you can see increased memory usage of your compressed files because the whole program is loaded into memory at startup. If you start several instances of huge compressed programs you're wasting memory because the common segments of the program won't get shared across the instances. On the other hand if you're compressing only smaller programs, or running only one instance of larger programs, then this penalty is smaller, but it's still there.</p>
|
||||||
|
|
||||||
|
<p>If you're running executables from network, then compressed programs will load faster, and require less bandwidth during execution.</p>
|
||||||
|
|
||||||
|
<p>DLLs are supported. But UPX compressed DLLs can not share common data and code when they got used by multiple applications. So compressing msvcrt.dll is a waste of memory, but compressing the dll plugins of a particular application may be a better idea.</p>
|
||||||
|
|
||||||
|
<p>Screensavers are supported, with the restriction that the filename must end with ".scr" (as screensavers are handled slightly different than normal exe files).</p>
|
||||||
|
|
||||||
|
<p>UPX compressed PE files have some minor memory overhead (usually in the 10 - 30 KiB range) which can be seen by specifying the "-i" command line switch during compression.</p>
|
||||||
|
|
||||||
|
<p>Extra options available for this executable format:</p>
|
||||||
|
|
||||||
|
<pre><code>--compress-exports=0 Don't compress the export section.
|
||||||
|
Use this if you plan to run the compressed
|
||||||
|
program under Wine.
|
||||||
|
--compress-exports=1 Compress the export section. [DEFAULT]
|
||||||
|
Compression of the export section can improve the
|
||||||
|
compression ratio quite a bit but may not work
|
||||||
|
with all programs (like winword.exe).
|
||||||
|
UPX never compresses the export section of a DLL
|
||||||
|
regardless of this option.
|
||||||
|
|
||||||
|
--compress-icons=0 Don't compress any icons.
|
||||||
|
--compress-icons=1 Compress all but the first icon.
|
||||||
|
--compress-icons=2 Compress all icons which are not in the
|
||||||
|
first icon directory. [DEFAULT]
|
||||||
|
--compress-icons=3 Compress all icons.
|
||||||
|
|
||||||
|
--compress-resources=0 Don't compress any resources at all.
|
||||||
|
|
||||||
|
--keep-resource=list Don't compress resources specified by the list.
|
||||||
|
The members of the list are separated by commas.
|
||||||
|
A list member has the following format: I<type[/name]>.
|
||||||
|
I<Type> is the type of the resource. Standard types
|
||||||
|
must be specified as decimal numbers, user types can be
|
||||||
|
specified by decimal IDs or strings. I<Name> is the
|
||||||
|
identifier of the resource. It can be a decimal number
|
||||||
|
or a string. For example:
|
||||||
|
|
||||||
|
--keep-resource=2/MYBITMAP,5,6/12345
|
||||||
|
|
||||||
|
UPX won't compress the named bitmap resource "MYBITMAP",
|
||||||
|
it leaves every dialog (5) resource uncompressed, and
|
||||||
|
it won't touch the string table resource with identifier
|
||||||
|
12345.
|
||||||
|
|
||||||
|
--force Force compression even when there is an
|
||||||
|
unexpected value in a header field.
|
||||||
|
Use with care.
|
||||||
|
|
||||||
|
--strip-relocs=0 Don't strip relocation records.
|
||||||
|
--strip-relocs=1 Strip relocation records. [DEFAULT]
|
||||||
|
This option only works on executables with base
|
||||||
|
address greater or equal to 0x400000. Usually the
|
||||||
|
compressed files becomes smaller, but some files
|
||||||
|
may become larger. Note that the resulting file will
|
||||||
|
not work under Windows 3.x (Win32s).
|
||||||
|
UPX never strips relocations from a DLL
|
||||||
|
regardless of this option.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.</code></pre>
|
||||||
|
|
||||||
|
<h1 id="DIAGNOSTICS">DIAGNOSTICS</h1>
|
||||||
|
|
||||||
|
<p>Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.</p>
|
||||||
|
|
||||||
|
<p><b>UPX</b>'s diagnostics are intended to be self-explanatory.</p>
|
||||||
|
|
||||||
|
<h1 id="BUGS">BUGS</h1>
|
||||||
|
|
||||||
|
<p>Please report all bugs immediately to the authors.</p>
|
||||||
|
|
||||||
|
<h1 id="AUTHORS">AUTHORS</h1>
|
||||||
|
|
||||||
|
<pre><code>Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
||||||
|
http://www.oberhumer.com
|
||||||
|
|
||||||
|
Laszlo Molnar <ezerotven+github@gmail.com>
|
||||||
|
|
||||||
|
John F. Reiser <jreiser@BitWagon.com>
|
||||||
|
|
||||||
|
Jens Medoch <jssg@users.sourceforge.net></code></pre>
|
||||||
|
|
||||||
|
<h1 id="COPYRIGHT">COPYRIGHT</h1>
|
||||||
|
|
||||||
|
<p>Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer</p>
|
||||||
|
|
||||||
|
<p>Copyright (C) 1996-2022 Laszlo Molnar</p>
|
||||||
|
|
||||||
|
<p>Copyright (C) 2000-2022 John F. Reiser</p>
|
||||||
|
|
||||||
|
<p>Copyright (C) 2002-2022 Jens Medoch</p>
|
||||||
|
|
||||||
|
<p><b>UPX</b> is distributed with full source code under the terms of the GNU General Public License v2+; either under the pure GPLv2+ (see the file COPYING), or (at your option) under the GPLv+2 with special exceptions and restrictions granting the free usage for all binaries including commercial programs (see the file LICENSE).</p>
|
||||||
|
|
||||||
|
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>
|
||||||
|
|
||||||
|
<p>You should have received a copy of the UPX License Agreements along with this program; see the files COPYING and LICENSE. If not, visit the UPX home page.</p>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
+842
@@ -0,0 +1,842 @@
|
|||||||
|
NAME
|
||||||
|
upx - compress or expand executable files
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
upx [ *command* ] [ *options* ] *filename*...
|
||||||
|
|
||||||
|
ABSTRACT
|
||||||
|
The Ultimate Packer for eXecutables
|
||||||
|
Copyright (c) 1996-2022 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
|
https://upx.github.io
|
||||||
|
|
||||||
|
UPX is a portable, extendable, high-performance executable packer for
|
||||||
|
several different executable formats. It achieves an excellent
|
||||||
|
compression ratio and offers **very** fast decompression. Your
|
||||||
|
executables suffer no memory overhead or other drawbacks for most of the
|
||||||
|
formats supported, because of in-place decompression.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
UPX comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.
|
||||||
|
|
||||||
|
Please report all problems or suggestions to the authors. Thanks.
|
||||||
|
|
||||||
|
SECURITY CONTEXT
|
||||||
|
IMPORTANT NOTE: UPX inherits the security context of any files it
|
||||||
|
handles.
|
||||||
|
|
||||||
|
This means that packing, unpacking, or even testing or listing a file
|
||||||
|
requires the same security considerations as actually executing the
|
||||||
|
file.
|
||||||
|
|
||||||
|
Use UPX on trusted files only!
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
UPX is a versatile executable packer with the following features:
|
||||||
|
|
||||||
|
- secure: as UPX is documented Open Source since many years any relevant
|
||||||
|
Security/Antivirus software is able to peek inside UPX compressed
|
||||||
|
apps to verify them
|
||||||
|
|
||||||
|
- excellent compression ratio: typically compresses better than Zip,
|
||||||
|
use UPX to decrease the size of your distribution !
|
||||||
|
|
||||||
|
- very fast decompression: more than 500 MB/sec on any reasonably modern
|
||||||
|
machine
|
||||||
|
|
||||||
|
- no memory overhead for your compressed executables for most of the
|
||||||
|
supported formats because of in-place decompression
|
||||||
|
|
||||||
|
- safe: you can list, test and unpack your executables.
|
||||||
|
Also, a checksum of both the compressed and uncompressed file is
|
||||||
|
maintained internally.
|
||||||
|
|
||||||
|
- universal: UPX can pack a number of executable formats, including
|
||||||
|
Windows programs and DLLs, macOS apps and Linux executables
|
||||||
|
|
||||||
|
- portable: UPX is written in portable endian-neutral C++
|
||||||
|
|
||||||
|
- extendable: because of the class layout it's very easy to support
|
||||||
|
new executable formats or add new compression algorithms
|
||||||
|
|
||||||
|
- free: UPX is distributed with full source code under the GNU General
|
||||||
|
Public License v2+, with special exceptions granting the free usage
|
||||||
|
for commercial programs
|
||||||
|
|
||||||
|
You probably understand now why we call UPX the "*ultimate*" executable
|
||||||
|
packer.
|
||||||
|
|
||||||
|
COMMANDS
|
||||||
|
Compress
|
||||||
|
This is the default operation, eg. upx yourfile.exe will compress the
|
||||||
|
file specified on the command line.
|
||||||
|
|
||||||
|
Decompress
|
||||||
|
All UPX supported file formats can be unpacked using the -d switch, eg.
|
||||||
|
upx -d yourfile.exe will uncompress the file you've just compressed.
|
||||||
|
|
||||||
|
Test
|
||||||
|
The -t command tests the integrity of the compressed and uncompressed
|
||||||
|
data, eg. upx -t yourfile.exe check whether your file can be safely
|
||||||
|
decompressed. Note, that this command doesn't check the whole file, only
|
||||||
|
the part that will be uncompressed during program execution. This means
|
||||||
|
that you should not use this command instead of a virus checker.
|
||||||
|
|
||||||
|
List
|
||||||
|
The -l command prints out some information about the compressed files
|
||||||
|
specified on the command line as parameters, eg upx -l yourfile.exe
|
||||||
|
shows the compressed / uncompressed size and the compression ratio of
|
||||||
|
*yourfile.exe*.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-q: be quiet, suppress warnings
|
||||||
|
|
||||||
|
-q -q (or -qq): be very quiet, suppress errors
|
||||||
|
|
||||||
|
-q -q -q (or -qqq): produce no output at all
|
||||||
|
|
||||||
|
--help: prints the help
|
||||||
|
|
||||||
|
--version: print the version of UPX
|
||||||
|
|
||||||
|
--exact: when compressing, require to be able to get a byte-identical
|
||||||
|
file after decompression with option -d. [NOTE: this is work in progress
|
||||||
|
and is not supported for all formats yet. If you do care, as a
|
||||||
|
workaround you can compress and then decompress your program a first
|
||||||
|
time - any further compress-decompress steps should then yield
|
||||||
|
byte-identical results as compared to the first decompressed version.]
|
||||||
|
|
||||||
|
-k: keep backup files
|
||||||
|
|
||||||
|
-o file: write output to file
|
||||||
|
|
||||||
|
[ ...more docs need to be written... - type `upx --help' for now ]
|
||||||
|
|
||||||
|
COMPRESSION LEVELS & TUNING
|
||||||
|
UPX offers ten different compression levels from -1 to -9, and --best.
|
||||||
|
The default compression level is -8 for files smaller than 512 KiB, and
|
||||||
|
-7 otherwise.
|
||||||
|
|
||||||
|
* Compression levels 1, 2 and 3 are pretty fast.
|
||||||
|
|
||||||
|
* Compression levels 4, 5 and 6 achieve a good time/ratio performance.
|
||||||
|
|
||||||
|
* Compression levels 7, 8 and 9 favor compression ratio over speed.
|
||||||
|
|
||||||
|
* Compression level --best may take a long time.
|
||||||
|
|
||||||
|
Note that compression level --best can be somewhat slow for large files,
|
||||||
|
but you definitely should use it when releasing a final version of your
|
||||||
|
program.
|
||||||
|
|
||||||
|
Quick info for achieving the best compression ratio:
|
||||||
|
|
||||||
|
* Try upx --brute --no-lzma myfile.exe or even upx --ultra-brute
|
||||||
|
--no-lzma myfile.exe.
|
||||||
|
|
||||||
|
* The option --lzma enables LZMA compression, which compresses better
|
||||||
|
but is *significantly slower* at decompression. You probably do not
|
||||||
|
want to use it for large files.
|
||||||
|
|
||||||
|
(Note that --lzma is automatically enabled by --all-methods and
|
||||||
|
--brute, use --no-lzma to override.)
|
||||||
|
|
||||||
|
* Try if --overlay=strip works.
|
||||||
|
|
||||||
|
* For win32/pe programs there's --strip-relocs=0. See notes below.
|
||||||
|
|
||||||
|
OVERLAY HANDLING OPTIONS
|
||||||
|
Info: An "overlay" means auxiliary data attached after the logical end
|
||||||
|
of an executable, and it often contains application specific data (this
|
||||||
|
is a common practice to avoid an extra data file, though it would be
|
||||||
|
better to use resource sections).
|
||||||
|
|
||||||
|
UPX handles overlays like many other executable packers do: it simply
|
||||||
|
copies the overlay after the compressed image. This works with some
|
||||||
|
files, but doesn't work with others, depending on how an application
|
||||||
|
actually accesses this overlayed data.
|
||||||
|
|
||||||
|
--overlay=copy Copy any extra data attached to the file. [DEFAULT]
|
||||||
|
|
||||||
|
--overlay=strip Strip any overlay from the program instead of
|
||||||
|
copying it. Be warned, this may make the compressed
|
||||||
|
program crash or otherwise unusable.
|
||||||
|
|
||||||
|
--overlay=skip Refuse to compress any program which has an overlay.
|
||||||
|
|
||||||
|
ENVIRONMENT VARIABLE
|
||||||
|
The environment variable UPX can hold a set of default options for UPX.
|
||||||
|
These options are interpreted first and can be overwritten by explicit
|
||||||
|
command line parameters. For example:
|
||||||
|
|
||||||
|
for DOS/Windows: set UPX=-9 --compress-icons#0
|
||||||
|
for sh/ksh/zsh: UPX="-9 --compress-icons=0"; export UPX
|
||||||
|
for csh/tcsh: setenv UPX "-9 --compress-icons=0"
|
||||||
|
|
||||||
|
Under DOS/Windows you must use '#' instead of '=' when setting the
|
||||||
|
environment variable because of a COMMAND.COM limitation.
|
||||||
|
|
||||||
|
Not all of the options are valid in the environment variable - UPX will
|
||||||
|
tell you.
|
||||||
|
|
||||||
|
You can explicitly use the --no-env option to ignore the environment
|
||||||
|
variable.
|
||||||
|
|
||||||
|
NOTES FOR THE SUPPORTED EXECUTABLE FORMATS
|
||||||
|
NOTES FOR ATARI/TOS
|
||||||
|
This is the executable format used by the Atari ST/TT, a Motorola 68000
|
||||||
|
based personal computer which was popular in the late '80s. Support of
|
||||||
|
this format is only because of nostalgic feelings of one of the authors
|
||||||
|
and serves no practical purpose :-). See https://freemint.github.io for
|
||||||
|
more info.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression. All debug information will be stripped, though.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR BVMLINUZ/I386
|
||||||
|
Same as vmlinuz/i386.
|
||||||
|
|
||||||
|
NOTES FOR DOS/COM
|
||||||
|
Obviously UPX won't work with executables that want to read data from
|
||||||
|
themselves (like some commandline utilities that ship with Win95/98/ME).
|
||||||
|
|
||||||
|
Compressed programs only work on a 286+.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression.
|
||||||
|
|
||||||
|
Maximum uncompressed size: ~65100 bytes.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--8086 Create an executable that works on any 8086 CPU.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR DOS/EXE
|
||||||
|
dos/exe stands for all "normal" 16-bit DOS executables.
|
||||||
|
|
||||||
|
Obviously UPX won't work with executables that want to read data from
|
||||||
|
themselves (like some command line utilities that ship with
|
||||||
|
Win95/98/ME).
|
||||||
|
|
||||||
|
Compressed programs only work on a 286+.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--8086 Create an executable that works on any 8086 CPU.
|
||||||
|
|
||||||
|
--no-reloc Use no relocation records in the exe header.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR DOS/SYS
|
||||||
|
Compressed programs only work on a 286+.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression.
|
||||||
|
|
||||||
|
Maximum uncompressed size: ~65350 bytes.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--8086 Create an executable that works on any 8086 CPU.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR DJGPP2/COFF
|
||||||
|
First of all, it is recommended to use UPX *instead* of strip. strip has
|
||||||
|
the very bad habit of replacing your stub with its own (outdated)
|
||||||
|
version. Additionally UPX corrects a bug/feature in strip v2.8.x: it
|
||||||
|
will fix the 4 KiB alignment of the stub.
|
||||||
|
|
||||||
|
UPX includes the full functionality of stubify. This means it will
|
||||||
|
automatically stubify your COFF files. Use the option --coff to disable
|
||||||
|
this functionality (see below).
|
||||||
|
|
||||||
|
UPX automatically handles Allegro packfiles.
|
||||||
|
|
||||||
|
The DLM format (a rather exotic shared library extension) is not
|
||||||
|
supported.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression. All debug information and trailing garbage will be
|
||||||
|
stripped, though.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--coff Produce COFF output instead of EXE. By default
|
||||||
|
UPX keeps your current stub.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR LINUX [general]
|
||||||
|
Introduction
|
||||||
|
|
||||||
|
Linux/386 support in UPX consists of 3 different executable formats,
|
||||||
|
one optimized for ELF executables ("linux/elf386"), one optimized
|
||||||
|
for shell scripts ("linux/sh386"), and one generic format
|
||||||
|
("linux/386").
|
||||||
|
|
||||||
|
We will start with a general discussion first, but please
|
||||||
|
also read the relevant docs for each of the individual formats.
|
||||||
|
|
||||||
|
Also, there is special support for bootable kernels - see the
|
||||||
|
description of the vmlinuz/386 format.
|
||||||
|
|
||||||
|
General user's overview
|
||||||
|
|
||||||
|
Running a compressed executable program trades less space on a
|
||||||
|
``permanent'' storage medium (such as a hard disk, floppy disk,
|
||||||
|
CD-ROM, flash memory, EPROM, etc.) for more space in one or more
|
||||||
|
``temporary'' storage media (such as RAM, swap space, /tmp, etc.).
|
||||||
|
Running a compressed executable also requires some additional CPU
|
||||||
|
cycles to generate the compressed executable in the first place,
|
||||||
|
and to decompress it at each invocation.
|
||||||
|
|
||||||
|
How much space is traded? It depends on the executable, but many
|
||||||
|
programs save 30% to 50% of permanent disk space. How much CPU
|
||||||
|
overhead is there? Again, it depends on the executable, but
|
||||||
|
decompression speed generally is at least many megabytes per second,
|
||||||
|
and frequently is limited by the speed of the underlying disk
|
||||||
|
or network I/O.
|
||||||
|
|
||||||
|
Depending on the statistics of usage and access, and the relative
|
||||||
|
speeds of CPU, RAM, swap space, /tmp, and file system storage, then
|
||||||
|
invoking and running a compressed executable can be faster than
|
||||||
|
directly running the corresponding uncompressed program.
|
||||||
|
The operating system might perform fewer expensive I/O operations
|
||||||
|
to invoke the compressed program. Paging to or from swap space
|
||||||
|
or /tmp might be faster than paging from the general file system.
|
||||||
|
``Medium-sized'' programs which access about 1/3 to 1/2 of their
|
||||||
|
stored program bytes can do particularly well with compression.
|
||||||
|
Small programs tend not to benefit as much because the absolute
|
||||||
|
savings is less. Big programs tend not to benefit proportionally
|
||||||
|
because each invocation may use only a small fraction of the program,
|
||||||
|
yet UPX decompresses the entire program before invoking it.
|
||||||
|
But in environments where disk or flash memory storage is limited,
|
||||||
|
then compression may win anyway.
|
||||||
|
|
||||||
|
Currently, executables compressed by UPX do not share RAM at runtime
|
||||||
|
in the way that executables mapped from a file system do. As a
|
||||||
|
result, if the same program is run simultaneously by more than one
|
||||||
|
process, then using the compressed version will require more RAM and/or
|
||||||
|
swap space. So, shell programs (bash, csh, etc.) and ``make''
|
||||||
|
might not be good candidates for compression.
|
||||||
|
|
||||||
|
UPX recognizes three executable formats for Linux: Linux/elf386,
|
||||||
|
Linux/sh386, and Linux/386. Linux/386 is the most generic format;
|
||||||
|
it accommodates any file that can be executed. At runtime, the UPX
|
||||||
|
decompression stub re-creates in /tmp a copy of the original file,
|
||||||
|
and then the copy is (re-)executed with the same arguments.
|
||||||
|
ELF binary executables prefer the Linux/elf386 format by default,
|
||||||
|
because UPX decompresses them directly into RAM, uses only one
|
||||||
|
exec, does not use space in /tmp, and does not use /proc.
|
||||||
|
Shell scripts where the underlying shell accepts a ``-c'' argument
|
||||||
|
can use the Linux/sh386 format. UPX decompresses the shell script
|
||||||
|
into low memory, then maps the shell and passes the entire text of the
|
||||||
|
script as an argument with a leading ``-c''.
|
||||||
|
|
||||||
|
General benefits:
|
||||||
|
|
||||||
|
- UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
|
||||||
|
libc6, Shell/Perl/Python/... scripts, standalone Java .class
|
||||||
|
binaries, or whatever...
|
||||||
|
All scripts and programs will work just as before.
|
||||||
|
|
||||||
|
- Compressed programs are completely self-contained. No need for
|
||||||
|
any external program.
|
||||||
|
|
||||||
|
- UPX keeps your original program untouched. This means that
|
||||||
|
after decompression you will have a byte-identical version,
|
||||||
|
and you can use UPX as a file compressor just like gzip.
|
||||||
|
[ Note that UPX maintains a checksum of the file internally,
|
||||||
|
so it is indeed a reliable alternative. ]
|
||||||
|
|
||||||
|
- As the stub only uses syscalls and isn't linked against libc it
|
||||||
|
should run under any Linux configuration that can run ELF
|
||||||
|
binaries.
|
||||||
|
|
||||||
|
- For the same reason compressed executables should run under
|
||||||
|
FreeBSD and other systems which can run Linux binaries.
|
||||||
|
[ Please send feedback on this topic ]
|
||||||
|
|
||||||
|
General drawbacks:
|
||||||
|
|
||||||
|
- It is not advisable to compress programs which usually have many
|
||||||
|
instances running (like `sh' or `make') because the common segments of
|
||||||
|
compressed programs won't be shared any longer between different
|
||||||
|
processes.
|
||||||
|
|
||||||
|
- `ldd' and `size' won't show anything useful because all they
|
||||||
|
see is the statically linked stub. Since version 0.82 the section
|
||||||
|
headers are stripped from the UPX stub and `size' doesn't even
|
||||||
|
recognize the file format. The file patches/patch-elfcode.h has a
|
||||||
|
patch to fix this bug in `size' and other programs which use GNU BFD.
|
||||||
|
|
||||||
|
General notes:
|
||||||
|
|
||||||
|
- As UPX leaves your original program untouched it is advantageous
|
||||||
|
to strip it before compression.
|
||||||
|
|
||||||
|
- If you compress a script you will lose platform independence -
|
||||||
|
this could be a problem if you are using NFS mounted disks.
|
||||||
|
|
||||||
|
- Compression of suid, guid and sticky-bit programs is rejected
|
||||||
|
because of possible security implications.
|
||||||
|
|
||||||
|
- For the same reason there is no sense in making any compressed
|
||||||
|
program suid.
|
||||||
|
|
||||||
|
- Obviously UPX won't work with executables that want to read data
|
||||||
|
from themselves. E.g., this might be a problem for Perl scripts
|
||||||
|
which access their __DATA__ lines.
|
||||||
|
|
||||||
|
- In case of internal errors the stub will abort with exitcode 127.
|
||||||
|
Typical reasons for this to happen are that the program has somehow
|
||||||
|
been modified after compression.
|
||||||
|
Running `strace -o strace.log compressed_file' will tell you more.
|
||||||
|
|
||||||
|
NOTES FOR LINUX/ELF386
|
||||||
|
Please read the general Linux description first.
|
||||||
|
|
||||||
|
The linux/elf386 format decompresses directly into RAM, uses only one
|
||||||
|
exec, does not use space in /tmp, and does not use /proc.
|
||||||
|
|
||||||
|
Linux/elf386 is automatically selected for Linux ELF executables.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression.
|
||||||
|
|
||||||
|
How it works:
|
||||||
|
|
||||||
|
For ELF executables, UPX decompresses directly to memory, simulating
|
||||||
|
the mapping that the operating system kernel uses during exec(),
|
||||||
|
including the PT_INTERP program interpreter (if any).
|
||||||
|
The brk() is set by a special PT_LOAD segment in the compressed
|
||||||
|
executable itself. UPX then wipes the stack clean except for
|
||||||
|
arguments, environment variables, and Elf_auxv entries (this is
|
||||||
|
required by bugs in the startup code of /lib/ld-linux.so as of
|
||||||
|
May 2000), and transfers control to the program interpreter or
|
||||||
|
the e_entry address of the original executable.
|
||||||
|
|
||||||
|
The UPX stub is about 1700 bytes long, partly written in assembler
|
||||||
|
and only uses kernel syscalls. It is not linked against any libc.
|
||||||
|
|
||||||
|
Specific drawbacks:
|
||||||
|
|
||||||
|
- For linux/elf386 and linux/sh386 formats, you will be relying on
|
||||||
|
RAM and swap space to hold all of the decompressed program during
|
||||||
|
the lifetime of the process. If you already use most of your swap
|
||||||
|
space, then you may run out. A system that is "out of memory"
|
||||||
|
can become fragile. Many programs do not react gracefully when
|
||||||
|
malloc() returns 0. With newer Linux kernels, the kernel
|
||||||
|
may decide to kill some processes to regain memory, and you
|
||||||
|
may not like the kernel's choice of which to kill. Running
|
||||||
|
/usr/bin/top is one way to check on the usage of swap space.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
(none)
|
||||||
|
|
||||||
|
NOTES FOR LINUX/SH386
|
||||||
|
Please read the general Linux description first.
|
||||||
|
|
||||||
|
Shell scripts where the underling shell accepts a ``-c'' argument can
|
||||||
|
use the Linux/sh386 format. UPX decompresses the shell script into low
|
||||||
|
memory, then maps the shell and passes the entire text of the script as
|
||||||
|
an argument with a leading ``-c''. It does not use space in /tmp, and
|
||||||
|
does not use /proc.
|
||||||
|
|
||||||
|
Linux/sh386 is automatically selected for shell scripts that use a known
|
||||||
|
shell.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression.
|
||||||
|
|
||||||
|
How it works:
|
||||||
|
|
||||||
|
For shell script executables (files beginning with "#!/" or "#! /")
|
||||||
|
where the shell is known to accept "-c <command>", UPX decompresses
|
||||||
|
the file into low memory, then maps the shell (and its PT_INTERP),
|
||||||
|
and passes control to the shell with the entire decompressed file
|
||||||
|
as the argument after "-c". Known shells are sh, ash, bash, bsh, csh,
|
||||||
|
ksh, tcsh, pdksh. Restriction: UPX cannot use this method
|
||||||
|
for shell scripts which use the one optional string argument after
|
||||||
|
the shell name in the script (example: "#! /bin/sh option3\n".)
|
||||||
|
|
||||||
|
The UPX stub is about 1700 bytes long, partly written in assembler
|
||||||
|
and only uses kernel syscalls. It is not linked against any libc.
|
||||||
|
|
||||||
|
Specific drawbacks:
|
||||||
|
|
||||||
|
- For linux/elf386 and linux/sh386 formats, you will be relying on
|
||||||
|
RAM and swap space to hold all of the decompressed program during
|
||||||
|
the lifetime of the process. If you already use most of your swap
|
||||||
|
space, then you may run out. A system that is "out of memory"
|
||||||
|
can become fragile. Many programs do not react gracefully when
|
||||||
|
malloc() returns 0. With newer Linux kernels, the kernel
|
||||||
|
may decide to kill some processes to regain memory, and you
|
||||||
|
may not like the kernel's choice of which to kill. Running
|
||||||
|
/usr/bin/top is one way to check on the usage of swap space.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
(none)
|
||||||
|
|
||||||
|
NOTES FOR LINUX/386
|
||||||
|
Please read the general Linux description first.
|
||||||
|
|
||||||
|
The generic linux/386 format decompresses to /tmp and needs /proc file
|
||||||
|
system support. It starts the decompressed program via the execve()
|
||||||
|
syscall.
|
||||||
|
|
||||||
|
Linux/386 is only selected if the specialized linux/elf386 and
|
||||||
|
linux/sh386 won't recognize a file.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression.
|
||||||
|
|
||||||
|
How it works:
|
||||||
|
|
||||||
|
For files which are not ELF and not a script for a known "-c" shell,
|
||||||
|
UPX uses kernel execve(), which first requires decompressing to a
|
||||||
|
temporary file in the file system. Interestingly -
|
||||||
|
because of the good memory management of the Linux kernel - this
|
||||||
|
often does not introduce a noticeable delay, and in fact there
|
||||||
|
will be no disk access at all if you have enough free memory as
|
||||||
|
the entire process takes places within the file system buffers.
|
||||||
|
|
||||||
|
A compressed executable consists of the UPX stub and an overlay
|
||||||
|
which contains the original program in a compressed form.
|
||||||
|
|
||||||
|
The UPX stub is a statically linked ELF executable and does
|
||||||
|
the following at program startup:
|
||||||
|
|
||||||
|
1) decompress the overlay to a temporary location in /tmp
|
||||||
|
2) open the temporary file for reading
|
||||||
|
3) try to delete the temporary file and start (execve)
|
||||||
|
the uncompressed program in /tmp using /proc/<pid>/fd/X as
|
||||||
|
attained by step 2)
|
||||||
|
4) if that fails, fork off a subprocess to clean up and
|
||||||
|
start the program in /tmp in the meantime
|
||||||
|
|
||||||
|
The UPX stub is about 1700 bytes long, partly written in assembler
|
||||||
|
and only uses kernel syscalls. It is not linked against any libc.
|
||||||
|
|
||||||
|
Specific drawbacks:
|
||||||
|
|
||||||
|
- You need additional free disk space for the uncompressed program
|
||||||
|
in your /tmp directory. This program is deleted immediately after
|
||||||
|
decompression, but you still need it for the full execution time
|
||||||
|
of the program.
|
||||||
|
|
||||||
|
- You must have /proc file system support as the stub wants to open
|
||||||
|
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
|
||||||
|
cannot compress programs that are used during the boot sequence
|
||||||
|
before /proc is mounted.
|
||||||
|
|
||||||
|
- Utilities like `top' will display numerical values in the process
|
||||||
|
name field. This is because Linux computes the process name from
|
||||||
|
the first argument of the last execve syscall (which is typically
|
||||||
|
something like /proc/<pid>/fd/3).
|
||||||
|
|
||||||
|
- Because of temporary decompression to disk the decompression speed
|
||||||
|
is not as fast as with the other executable formats. Still, I can see
|
||||||
|
no noticeable delay when starting programs like my ~3 MiB emacs (which
|
||||||
|
is less than 1 MiB when compressed :-).
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--force-execve Force the use of the generic linux/386 "execve"
|
||||||
|
format, i.e. do not try the linux/elf386 and
|
||||||
|
linux/sh386 formats.
|
||||||
|
|
||||||
|
NOTES FOR PS1/EXE
|
||||||
|
This is the executable format used by the Sony PlayStation (PSone), a
|
||||||
|
MIPS R3000 based gaming console which is popular since the late '90s.
|
||||||
|
Support of this format is very similar to the Atari one, because of
|
||||||
|
nostalgic feelings of one of the authors.
|
||||||
|
|
||||||
|
Packed programs will be byte-identical to the original after
|
||||||
|
uncompression, until further notice.
|
||||||
|
|
||||||
|
Maximum uncompressed size: ~1.89 / ~7.60 MiB.
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
- UPX creates as default a suitable executable for CD-Mastering
|
||||||
|
and console transfer. For a CD-Master main executable you could also try
|
||||||
|
the special option "--boot-only" as described below.
|
||||||
|
It has been reported that upx packed executables are fully compatible with
|
||||||
|
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
|
||||||
|
Sony PlayStation (PSone) emulation mode.
|
||||||
|
|
||||||
|
- Normally the packed files use the same memory areas like the uncompressed
|
||||||
|
versions, so they will not override other memory areas while unpacking.
|
||||||
|
If this isn't possible UPX will abort showing a 'packed data overlap'
|
||||||
|
error. With the "--force" option UPX will relocate the loading address
|
||||||
|
for the packed file, but this isn't a real problem if it is a single or
|
||||||
|
the main executable.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--8-bit Uses 8 bit size compression [default: 32 bit]
|
||||||
|
|
||||||
|
--8mib-ram PSone has 8 MiB ram available [default: 2 MiB]
|
||||||
|
|
||||||
|
--boot-only This format is for main exes and CD-Mastering only !
|
||||||
|
It may slightly improve the compression ratio,
|
||||||
|
decompression routines are faster than default ones.
|
||||||
|
But it cannot be used for console transfer !
|
||||||
|
|
||||||
|
--no-align This option disables CD mode 2 data sector format
|
||||||
|
alignment. May slightly improves the compression ratio,
|
||||||
|
but the compressed executable will not boot from a CD.
|
||||||
|
Use it for console transfer only !
|
||||||
|
|
||||||
|
NOTES FOR RTM32/PE and ARM/PE
|
||||||
|
Same as win32/pe.
|
||||||
|
|
||||||
|
NOTES FOR TMT/ADAM
|
||||||
|
This format is used by the TMT Pascal compiler - see http://www.tmt.com/
|
||||||
|
.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR VMLINUZ/386
|
||||||
|
The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable
|
||||||
|
Linux kernel image ("vmlinuz", "zImage", "bzImage"), gzip-decompress it
|
||||||
|
and re-compress it with the UPX compression method.
|
||||||
|
|
||||||
|
vmlinuz/386 is completely unrelated to the other Linux executable
|
||||||
|
formats, and it does not share any of their drawbacks.
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
- Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
|
||||||
|
during compression - otherwise a wrong executable format
|
||||||
|
may have been used, and the kernel won't boot.
|
||||||
|
|
||||||
|
Benefits:
|
||||||
|
|
||||||
|
- Better compression (but note that the kernel was already compressed,
|
||||||
|
so the improvement is not as large as with other formats).
|
||||||
|
Still, the bytes saved may be essential for special needs like
|
||||||
|
boot disks.
|
||||||
|
|
||||||
|
For example, this is what I get for my 2.2.16 kernel:
|
||||||
|
1589708 vmlinux
|
||||||
|
641073 bzImage [original]
|
||||||
|
560755 bzImage.upx [compressed by "upx -9"]
|
||||||
|
|
||||||
|
- Much faster decompression at kernel boot time (but kernel
|
||||||
|
decompression speed is not really an issue these days).
|
||||||
|
|
||||||
|
Drawbacks:
|
||||||
|
|
||||||
|
(none)
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.
|
||||||
|
|
||||||
|
NOTES FOR WATCOM/LE
|
||||||
|
UPX has been successfully tested with the following extenders: DOS4G,
|
||||||
|
DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly
|
||||||
|
supported (for details see the file bugs BUGS).
|
||||||
|
|
||||||
|
DLLs and the LX format are not supported.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--le Produce an unbound LE output instead of
|
||||||
|
keeping the current stub.
|
||||||
|
|
||||||
|
NOTES FOR WIN32/PE
|
||||||
|
The PE support in UPX is quite stable now, but probably there are still
|
||||||
|
some incompatibilities with some files.
|
||||||
|
|
||||||
|
Because of the way UPX (and other packers for this format) works, you
|
||||||
|
can see increased memory usage of your compressed files because the
|
||||||
|
whole program is loaded into memory at startup. If you start several
|
||||||
|
instances of huge compressed programs you're wasting memory because the
|
||||||
|
common segments of the program won't get shared across the instances. On
|
||||||
|
the other hand if you're compressing only smaller programs, or running
|
||||||
|
only one instance of larger programs, then this penalty is smaller, but
|
||||||
|
it's still there.
|
||||||
|
|
||||||
|
If you're running executables from network, then compressed programs
|
||||||
|
will load faster, and require less bandwidth during execution.
|
||||||
|
|
||||||
|
DLLs are supported. But UPX compressed DLLs can not share common data
|
||||||
|
and code when they got used by multiple applications. So compressing
|
||||||
|
msvcrt.dll is a waste of memory, but compressing the dll plugins of a
|
||||||
|
particular application may be a better idea.
|
||||||
|
|
||||||
|
Screensavers are supported, with the restriction that the filename must
|
||||||
|
end with ".scr" (as screensavers are handled slightly different than
|
||||||
|
normal exe files).
|
||||||
|
|
||||||
|
UPX compressed PE files have some minor memory overhead (usually in the
|
||||||
|
10 - 30 KiB range) which can be seen by specifying the "-i" command line
|
||||||
|
switch during compression.
|
||||||
|
|
||||||
|
Extra options available for this executable format:
|
||||||
|
|
||||||
|
--compress-exports=0 Don't compress the export section.
|
||||||
|
Use this if you plan to run the compressed
|
||||||
|
program under Wine.
|
||||||
|
--compress-exports=1 Compress the export section. [DEFAULT]
|
||||||
|
Compression of the export section can improve the
|
||||||
|
compression ratio quite a bit but may not work
|
||||||
|
with all programs (like winword.exe).
|
||||||
|
UPX never compresses the export section of a DLL
|
||||||
|
regardless of this option.
|
||||||
|
|
||||||
|
--compress-icons=0 Don't compress any icons.
|
||||||
|
--compress-icons=1 Compress all but the first icon.
|
||||||
|
--compress-icons=2 Compress all icons which are not in the
|
||||||
|
first icon directory. [DEFAULT]
|
||||||
|
--compress-icons=3 Compress all icons.
|
||||||
|
|
||||||
|
--compress-resources=0 Don't compress any resources at all.
|
||||||
|
|
||||||
|
--keep-resource=list Don't compress resources specified by the list.
|
||||||
|
The members of the list are separated by commas.
|
||||||
|
A list member has the following format: I<type[/name]>.
|
||||||
|
I<Type> is the type of the resource. Standard types
|
||||||
|
must be specified as decimal numbers, user types can be
|
||||||
|
specified by decimal IDs or strings. I<Name> is the
|
||||||
|
identifier of the resource. It can be a decimal number
|
||||||
|
or a string. For example:
|
||||||
|
|
||||||
|
--keep-resource=2/MYBITMAP,5,6/12345
|
||||||
|
|
||||||
|
UPX won't compress the named bitmap resource "MYBITMAP",
|
||||||
|
it leaves every dialog (5) resource uncompressed, and
|
||||||
|
it won't touch the string table resource with identifier
|
||||||
|
12345.
|
||||||
|
|
||||||
|
--force Force compression even when there is an
|
||||||
|
unexpected value in a header field.
|
||||||
|
Use with care.
|
||||||
|
|
||||||
|
--strip-relocs=0 Don't strip relocation records.
|
||||||
|
--strip-relocs=1 Strip relocation records. [DEFAULT]
|
||||||
|
This option only works on executables with base
|
||||||
|
address greater or equal to 0x400000. Usually the
|
||||||
|
compressed files becomes smaller, but some files
|
||||||
|
may become larger. Note that the resulting file will
|
||||||
|
not work under Windows 3.x (Win32s).
|
||||||
|
UPX never strips relocations from a DLL
|
||||||
|
regardless of this option.
|
||||||
|
|
||||||
|
--all-methods Compress the program several times, using all
|
||||||
|
available compression methods. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
|
--all-filters Compress the program several times, using all
|
||||||
|
available preprocessing filters. This may improve
|
||||||
|
the compression ratio in some cases, but usually
|
||||||
|
the default filter gives the best results anyway.
|
||||||
|
|
||||||
|
DIAGNOSTICS
|
||||||
|
Exit status is normally 0; if an error occurs, exit status is 1. If a
|
||||||
|
warning occurs, exit status is 2.
|
||||||
|
|
||||||
|
UPX's diagnostics are intended to be self-explanatory.
|
||||||
|
|
||||||
|
BUGS
|
||||||
|
Please report all bugs immediately to the authors.
|
||||||
|
|
||||||
|
AUTHORS
|
||||||
|
Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
||||||
|
http://www.oberhumer.com
|
||||||
|
|
||||||
|
Laszlo Molnar <ezerotven+github@gmail.com>
|
||||||
|
|
||||||
|
John F. Reiser <jreiser@BitWagon.com>
|
||||||
|
|
||||||
|
Jens Medoch <jssg@users.sourceforge.net>
|
||||||
|
|
||||||
|
COPYRIGHT
|
||||||
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
|
|
||||||
|
Copyright (C) 2000-2022 John F. Reiser
|
||||||
|
|
||||||
|
Copyright (C) 2002-2022 Jens Medoch
|
||||||
|
|
||||||
|
UPX is distributed with full source code under the terms of the GNU
|
||||||
|
General Public License v2+; either under the pure GPLv2+ (see the file
|
||||||
|
COPYING), or (at your option) under the GPLv+2 with special exceptions
|
||||||
|
and restrictions granting the free usage for all binaries including
|
||||||
|
commercial programs (see the file LICENSE).
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
You should have received a copy of the UPX License Agreements along with
|
||||||
|
this program; see the files COPYING and LICENSE. If not, visit the UPX
|
||||||
|
home page.
|
||||||
|
|
||||||
+140
-127
@@ -12,9 +12,9 @@ B<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...
|
|||||||
|
|
||||||
=head1 ABSTRACT
|
=head1 ABSTRACT
|
||||||
|
|
||||||
The Ultimate Packer for eXecutables
|
The Ultimate Packer for eXecutables
|
||||||
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
|
Copyright (c) 1996-2022 Markus Oberhumer, Laszlo Molnar & John Reiser
|
||||||
http://upx.sourceforge.net
|
https://upx.github.io
|
||||||
|
|
||||||
|
|
||||||
B<UPX> is a portable, extendable, high-performance executable packer for
|
B<UPX> is a portable, extendable, high-performance executable packer for
|
||||||
@@ -23,69 +23,59 @@ ratio and offers I<*very*> fast decompression. Your executables suffer
|
|||||||
no memory overhead or other drawbacks for most of the formats supported,
|
no memory overhead or other drawbacks for most of the formats supported,
|
||||||
because of in-place decompression.
|
because of in-place decompression.
|
||||||
|
|
||||||
While you may use B<UPX> freely for both non-commercial and commercial
|
|
||||||
executables (for details see the file LICENSE), we would highly
|
|
||||||
appreciate if you credit B<UPX> and ourselves in the documentation,
|
|
||||||
possibly including a reference to the B<UPX> home page. Thanks.
|
|
||||||
|
|
||||||
[ Using B<UPX> in non-OpenSource applications without proper credits
|
|
||||||
is considered not politically correct ;-) ]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=head1 DISCLAIMER
|
=head1 DISCLAIMER
|
||||||
|
|
||||||
B<UPX> comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.
|
B<UPX> comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.
|
||||||
|
|
||||||
This is the first production quality release, and we plan that future 1.xx
|
|
||||||
releases will be backward compatible with this version.
|
|
||||||
|
|
||||||
Please report all problems or suggestions to the authors. Thanks.
|
Please report all problems or suggestions to the authors. Thanks.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=head1 SECURITY CONTEXT
|
||||||
|
|
||||||
|
IMPORTANT NOTE: B<UPX> inherits the security context of any files it handles.
|
||||||
|
|
||||||
|
This means that packing, unpacking, or even testing or listing a file requires
|
||||||
|
the same security considerations as actually executing the file.
|
||||||
|
|
||||||
|
Use B<UPX> on trusted files only!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
B<UPX> is a versatile executable packer with the following features:
|
B<UPX> is a versatile executable packer with the following features:
|
||||||
|
|
||||||
- excellent compression ratio: compresses better than zip/gzip,
|
- secure: as UPX is documented Open Source since many years any relevant
|
||||||
|
Security/Antivirus software is able to peek inside UPX compressed
|
||||||
|
apps to verify them
|
||||||
|
|
||||||
|
- excellent compression ratio: typically compresses better than Zip,
|
||||||
use UPX to decrease the size of your distribution !
|
use UPX to decrease the size of your distribution !
|
||||||
|
|
||||||
- very fast decompression: about 10 MB/sec on an ancient Pentium 133,
|
- very fast decompression: more than 500 MB/sec on any reasonably modern
|
||||||
about 200 MB/sec on an Athlon XP 2000+.
|
machine
|
||||||
|
|
||||||
- no memory overhead for your compressed executables for most of the
|
- no memory overhead for your compressed executables for most of the
|
||||||
supported formats
|
supported formats because of in-place decompression
|
||||||
|
|
||||||
- safe: you can list, test and unpack your executables
|
- safe: you can list, test and unpack your executables.
|
||||||
Also, a checksum of both the compressed and uncompressed file is
|
Also, a checksum of both the compressed and uncompressed file is
|
||||||
maintained internally.
|
maintained internally.
|
||||||
|
|
||||||
- universal: UPX can pack a number of executable formats:
|
- universal: UPX can pack a number of executable formats, including
|
||||||
* atari/tos
|
Windows programs and DLLs, macOS apps and Linux executables
|
||||||
* bvmlinuz/386 [bootable Linux kernel]
|
|
||||||
* djgpp2/coff
|
|
||||||
* dos/com
|
|
||||||
* dos/exe
|
|
||||||
* dos/sys
|
|
||||||
* linux/386
|
|
||||||
* linux/elf386
|
|
||||||
* linux/sh386
|
|
||||||
* ps1/exe
|
|
||||||
* rtm32/pe
|
|
||||||
* tmt/adam
|
|
||||||
* vmlinuz/386 [bootable Linux kernel]
|
|
||||||
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
|
|
||||||
* win32/pe
|
|
||||||
|
|
||||||
- portable: UPX is written in portable endian-neutral C++
|
- portable: UPX is written in portable endian-neutral C++
|
||||||
|
|
||||||
- extendable: because of the class layout it's very easy to support
|
- extendable: because of the class layout it's very easy to support
|
||||||
new executable formats or add new compression algorithms
|
new executable formats or add new compression algorithms
|
||||||
|
|
||||||
- free: UPX can be distributed and used freely. And from version 0.99
|
- free: UPX is distributed with full source code under the GNU General
|
||||||
the full source code of UPX is released under the GNU General Public
|
Public License v2+, with special exceptions granting the free usage
|
||||||
License (GPL) !
|
for commercial programs
|
||||||
|
|
||||||
You probably understand now why we call B<UPX> the "I<ultimate>"
|
You probably understand now why we call B<UPX> the "I<ultimate>"
|
||||||
executable packer.
|
executable packer.
|
||||||
@@ -133,7 +123,18 @@ B<--help>: prints the help
|
|||||||
|
|
||||||
B<--version>: print the version of B<UPX>
|
B<--version>: print the version of B<UPX>
|
||||||
|
|
||||||
[ ...to be written... - type `B<upx --help>' for now ]
|
B<--exact>: when compressing, require to be able to get a byte-identical file
|
||||||
|
after decompression with option B<-d>. [NOTE: this is work in progress and is
|
||||||
|
not supported for all formats yet. If you do care, as a workaround you can
|
||||||
|
compress and then decompress your program a first time - any further
|
||||||
|
compress-decompress steps should then yield byte-identical results
|
||||||
|
as compared to the first decompressed version.]
|
||||||
|
|
||||||
|
B<-k>: keep backup files
|
||||||
|
|
||||||
|
B<-o file>: write output to file
|
||||||
|
|
||||||
|
[ ...more docs need to be written... - type `B<upx --help>' for now ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -141,7 +142,7 @@ B<--version>: print the version of B<UPX>
|
|||||||
|
|
||||||
B<UPX> offers ten different compression levels from B<-1> to B<-9>,
|
B<UPX> offers ten different compression levels from B<-1> to B<-9>,
|
||||||
and B<--best>. The default compression level is B<-8> for files
|
and B<--best>. The default compression level is B<-8> for files
|
||||||
smaller than 512 kB, and B<-7> otherwise.
|
smaller than 512 KiB, and B<-7> otherwise.
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
|
|
||||||
@@ -167,38 +168,23 @@ Note that compression level B<--best> can be somewhat slow for large
|
|||||||
files, but you definitely should use it when releasing a final version
|
files, but you definitely should use it when releasing a final version
|
||||||
of your program.
|
of your program.
|
||||||
|
|
||||||
Quick start for achieving the best compression ratio:
|
Quick info for achieving the best compression ratio:
|
||||||
|
|
||||||
=over 4
|
|
||||||
|
|
||||||
Try B<upx --brute myfile.exe>.
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
Details for achieving the best compression ratio:
|
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
|
|
||||||
=item *
|
=item *
|
||||||
|
|
||||||
Use the compression level B<--best>.
|
Try B<upx --brute --no-lzma myfile.exe> or even
|
||||||
|
B<upx --ultra-brute --no-lzma myfile.exe>.
|
||||||
|
|
||||||
=item *
|
=item *
|
||||||
|
|
||||||
Try one or both of the options B<--all-methods> and B<--all-filters>.
|
The option B<--lzma> enables LZMA compression, which compresses better but
|
||||||
|
is *significantly slower* at decompression. You probably do not want
|
||||||
|
to use it for large files.
|
||||||
|
|
||||||
=item *
|
(Note that B<--lzma> is automatically enabled by B<--all-methods> and
|
||||||
|
B<--brute>, use B<--no-lzma> to override.)
|
||||||
Try the option B<--crp-ms=NUMBER>. This uses more memory during compression
|
|
||||||
to achieve a (slightly) better compression ratio.
|
|
||||||
|
|
||||||
NUMBER must be a decimal value from 10000 to 999999, inclusive.
|
|
||||||
The default value is 10000 (ten thousand).
|
|
||||||
|
|
||||||
=item *
|
|
||||||
|
|
||||||
Info: the option B<--brute> is an abbrevation for the options
|
|
||||||
B<S<--best> S<--all-methods> S<--all-filters> S<--crp-ms=999999>>.
|
|
||||||
|
|
||||||
=item *
|
=item *
|
||||||
|
|
||||||
@@ -214,7 +200,7 @@ For win32/pe programs there's B<--strip-relocs=0>. See notes below.
|
|||||||
|
|
||||||
=head1 OVERLAY HANDLING OPTIONS
|
=head1 OVERLAY HANDLING OPTIONS
|
||||||
|
|
||||||
Info: An "overlay" means auxillary data atached after the logical end of
|
Info: An "overlay" means auxiliary data attached after the logical end of
|
||||||
an executable, and it often contains application specific data
|
an executable, and it often contains application specific data
|
||||||
(this is a common practice to avoid an extra data file, though
|
(this is a common practice to avoid an extra data file, though
|
||||||
it would be better to use resource sections).
|
it would be better to use resource sections).
|
||||||
@@ -224,9 +210,6 @@ copies the overlay after the compressed image. This works with some
|
|||||||
files, but doesn't work with others, depending on how an application
|
files, but doesn't work with others, depending on how an application
|
||||||
actually accesses this overlayed data.
|
actually accesses this overlayed data.
|
||||||
|
|
||||||
Since version 0.90 UPX defaults to B<--overlay=copy> for
|
|
||||||
all executable formats.
|
|
||||||
|
|
||||||
--overlay=copy Copy any extra data attached to the file. [DEFAULT]
|
--overlay=copy Copy any extra data attached to the file. [DEFAULT]
|
||||||
|
|
||||||
--overlay=strip Strip any overlay from the program instead of
|
--overlay=strip Strip any overlay from the program instead of
|
||||||
@@ -237,7 +220,7 @@ all executable formats.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
=head1 ENVIRONMENT
|
=head1 ENVIRONMENT VARIABLE
|
||||||
|
|
||||||
The environment variable B<UPX> can hold a set of default
|
The environment variable B<UPX> can hold a set of default
|
||||||
options for B<UPX>. These options are interpreted first and
|
options for B<UPX>. These options are interpreted first and
|
||||||
@@ -267,7 +250,7 @@ This is the executable format used by the Atari ST/TT, a Motorola 68000
|
|||||||
based personal computer which was popular in the late '80s. Support
|
based personal computer which was popular in the late '80s. Support
|
||||||
of this format is only because of nostalgic feelings of one of
|
of this format is only because of nostalgic feelings of one of
|
||||||
the authors and serves no practical purpose :-).
|
the authors and serves no practical purpose :-).
|
||||||
See http://www.freemint.de for more info.
|
See https://freemint.github.io for more info.
|
||||||
|
|
||||||
Packed programs will be byte-identical to the original after uncompression.
|
Packed programs will be byte-identical to the original after uncompression.
|
||||||
All debug information will be stripped, though.
|
All debug information will be stripped, though.
|
||||||
@@ -338,9 +321,6 @@ Extra options available for this executable format:
|
|||||||
|
|
||||||
=head2 NOTES FOR DOS/SYS
|
=head2 NOTES FOR DOS/SYS
|
||||||
|
|
||||||
You can only compress plain sys files, sys/exe (two in one)
|
|
||||||
combos are not supported.
|
|
||||||
|
|
||||||
Compressed programs only work on a 286+.
|
Compressed programs only work on a 286+.
|
||||||
|
|
||||||
Packed programs will be byte-identical to the original after uncompression.
|
Packed programs will be byte-identical to the original after uncompression.
|
||||||
@@ -368,7 +348,7 @@ Extra options available for this executable format:
|
|||||||
First of all, it is recommended to use B<UPX> *instead* of B<strip>. strip has
|
First of all, it is recommended to use B<UPX> *instead* of B<strip>. strip has
|
||||||
the very bad habit of replacing your stub with its own (outdated) version.
|
the very bad habit of replacing your stub with its own (outdated) version.
|
||||||
Additionally B<UPX> corrects a bug/feature in strip v2.8.x: it
|
Additionally B<UPX> corrects a bug/feature in strip v2.8.x: it
|
||||||
will fix the 4 KByte aligment of the stub.
|
will fix the 4 KiB alignment of the stub.
|
||||||
|
|
||||||
B<UPX> includes the full functionality of stubify. This means it will
|
B<UPX> includes the full functionality of stubify. This means it will
|
||||||
automatically stubify your COFF files. Use the option B<--coff> to
|
automatically stubify your COFF files. Use the option B<--coff> to
|
||||||
@@ -403,7 +383,7 @@ Extra options available for this executable format:
|
|||||||
Introduction
|
Introduction
|
||||||
|
|
||||||
Linux/386 support in UPX consists of 3 different executable formats,
|
Linux/386 support in UPX consists of 3 different executable formats,
|
||||||
one optimized for ELF excutables ("linux/elf386"), one optimized
|
one optimized for ELF executables ("linux/elf386"), one optimized
|
||||||
for shell scripts ("linux/sh386"), and one generic format
|
for shell scripts ("linux/sh386"), and one generic format
|
||||||
("linux/386").
|
("linux/386").
|
||||||
|
|
||||||
@@ -431,14 +411,14 @@ General user's overview
|
|||||||
or network I/O.
|
or network I/O.
|
||||||
|
|
||||||
Depending on the statistics of usage and access, and the relative
|
Depending on the statistics of usage and access, and the relative
|
||||||
speeds of CPU, RAM, swap space, /tmp, and filesystem storage, then
|
speeds of CPU, RAM, swap space, /tmp, and file system storage, then
|
||||||
invoking and running a compressed executable can be faster than
|
invoking and running a compressed executable can be faster than
|
||||||
directly running the corresponding uncompressed program.
|
directly running the corresponding uncompressed program.
|
||||||
The operating system might perfrom fewer expensive I/O operations
|
The operating system might perform fewer expensive I/O operations
|
||||||
to invoke the compressed program. Paging to or from swap space
|
to invoke the compressed program. Paging to or from swap space
|
||||||
or /tmp might be faster than paging from the general filesystem.
|
or /tmp might be faster than paging from the general file system.
|
||||||
``Medium-sized'' programs which access about 1/3 to 1/2 of their
|
``Medium-sized'' programs which access about 1/3 to 1/2 of their
|
||||||
stored program bytes can do particulary well with compression.
|
stored program bytes can do particularly well with compression.
|
||||||
Small programs tend not to benefit as much because the absolute
|
Small programs tend not to benefit as much because the absolute
|
||||||
savings is less. Big programs tend not to benefit proportionally
|
savings is less. Big programs tend not to benefit proportionally
|
||||||
because each invocation may use only a small fraction of the program,
|
because each invocation may use only a small fraction of the program,
|
||||||
@@ -447,7 +427,7 @@ General user's overview
|
|||||||
then compression may win anyway.
|
then compression may win anyway.
|
||||||
|
|
||||||
Currently, executables compressed by UPX do not share RAM at runtime
|
Currently, executables compressed by UPX do not share RAM at runtime
|
||||||
in the way that executables mapped from a filesystem do. As a
|
in the way that executables mapped from a file system do. As a
|
||||||
result, if the same program is run simultaneously by more than one
|
result, if the same program is run simultaneously by more than one
|
||||||
process, then using the compressed version will require more RAM and/or
|
process, then using the compressed version will require more RAM and/or
|
||||||
swap space. So, shell programs (bash, csh, etc.) and ``make''
|
swap space. So, shell programs (bash, csh, etc.) and ``make''
|
||||||
@@ -536,7 +516,7 @@ The linux/elf386 format decompresses directly into RAM,
|
|||||||
uses only one exec, does not use space in /tmp,
|
uses only one exec, does not use space in /tmp,
|
||||||
and does not use /proc.
|
and does not use /proc.
|
||||||
|
|
||||||
Linux/elf386 is automatically selected for Linux ELF exectuables.
|
Linux/elf386 is automatically selected for Linux ELF executables.
|
||||||
|
|
||||||
Packed programs will be byte-identical to the original after uncompression.
|
Packed programs will be byte-identical to the original after uncompression.
|
||||||
|
|
||||||
@@ -625,7 +605,7 @@ Extra options available for this executable format:
|
|||||||
Please read the general Linux description first.
|
Please read the general Linux description first.
|
||||||
|
|
||||||
The generic linux/386 format decompresses to /tmp and needs
|
The generic linux/386 format decompresses to /tmp and needs
|
||||||
/proc filesystem support. It starts the decompressed program
|
/proc file system support. It starts the decompressed program
|
||||||
via the execve() syscall.
|
via the execve() syscall.
|
||||||
|
|
||||||
Linux/386 is only selected if the specialized linux/elf386
|
Linux/386 is only selected if the specialized linux/elf386
|
||||||
@@ -637,11 +617,11 @@ How it works:
|
|||||||
|
|
||||||
For files which are not ELF and not a script for a known "-c" shell,
|
For files which are not ELF and not a script for a known "-c" shell,
|
||||||
UPX uses kernel execve(), which first requires decompressing to a
|
UPX uses kernel execve(), which first requires decompressing to a
|
||||||
temporary file in the filesystem. Interestingly -
|
temporary file in the file system. Interestingly -
|
||||||
because of the good memory management of the Linux kernel - this
|
because of the good memory management of the Linux kernel - this
|
||||||
often does not introduce a noticable delay, and in fact there
|
often does not introduce a noticeable delay, and in fact there
|
||||||
will be no disk access at all if you have enough free memory as
|
will be no disk access at all if you have enough free memory as
|
||||||
the entire process takes places within the filesystem buffers.
|
the entire process takes places within the file system buffers.
|
||||||
|
|
||||||
A compressed executable consists of the UPX stub and an overlay
|
A compressed executable consists of the UPX stub and an overlay
|
||||||
which contains the original program in a compressed form.
|
which contains the original program in a compressed form.
|
||||||
@@ -667,7 +647,7 @@ Specific drawbacks:
|
|||||||
decompression, but you still need it for the full execution time
|
decompression, but you still need it for the full execution time
|
||||||
of the program.
|
of the program.
|
||||||
|
|
||||||
- You must have /proc filesystem support as the stub wants to open
|
- You must have /proc file system support as the stub wants to open
|
||||||
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
|
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
|
||||||
cannot compress programs that are used during the boot sequence
|
cannot compress programs that are used during the boot sequence
|
||||||
before /proc is mounted.
|
before /proc is mounted.
|
||||||
@@ -679,8 +659,8 @@ Specific drawbacks:
|
|||||||
|
|
||||||
- Because of temporary decompression to disk the decompression speed
|
- Because of temporary decompression to disk the decompression speed
|
||||||
is not as fast as with the other executable formats. Still, I can see
|
is not as fast as with the other executable formats. Still, I can see
|
||||||
no noticable delay when starting programs like my ~3 MB emacs (which
|
no noticeable delay when starting programs like my ~3 MiB emacs (which
|
||||||
is less than 1 MB when compressed :-).
|
is less than 1 MiB when compressed :-).
|
||||||
|
|
||||||
Extra options available for this executable format:
|
Extra options available for this executable format:
|
||||||
|
|
||||||
@@ -693,26 +673,30 @@ Extra options available for this executable format:
|
|||||||
=head2 NOTES FOR PS1/EXE
|
=head2 NOTES FOR PS1/EXE
|
||||||
|
|
||||||
This is the executable format used by the Sony PlayStation (PSone),
|
This is the executable format used by the Sony PlayStation (PSone),
|
||||||
a Mips R3000 based gaming console which is popular since the late '90s.
|
a MIPS R3000 based gaming console which is popular since the late '90s.
|
||||||
Support of this format is very similar to the Atari one, because of
|
Support of this format is very similar to the Atari one, because of
|
||||||
nostalgic feelings of one of the authors, but this format maybe serves
|
nostalgic feelings of one of the authors.
|
||||||
a practical purpose ;-).
|
|
||||||
|
|
||||||
Packed programs will be byte-identical to the original after uncompression.
|
Packed programs will be byte-identical to the original after uncompression,
|
||||||
|
until further notice.
|
||||||
|
|
||||||
Maximum uncompressed size: ~1998848 bytes.
|
Maximum uncompressed size: ~1.89 / ~7.60 MiB.
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
- UPX creates as default a 'CD-Rom only' PS1/PS2 compatible executable.
|
- UPX creates as default a suitable executable for CD-Mastering
|
||||||
For transfer between client/target use options below.
|
and console transfer. For a CD-Master main executable you could also try
|
||||||
|
the special option "--boot-only" as described below.
|
||||||
|
It has been reported that upx packed executables are fully compatible with
|
||||||
|
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
|
||||||
|
Sony PlayStation (PSone) emulation mode.
|
||||||
|
|
||||||
- Normally the packed files use the same memory areas like the uncompressed
|
- Normally the packed files use the same memory areas like the uncompressed
|
||||||
versions, so they will not override other memory areas while unpacking.
|
versions, so they will not override other memory areas while unpacking.
|
||||||
If this isn't possible UPX will abort showing a 'packed data overlap'
|
If this isn't possible UPX will abort showing a 'packed data overlap'
|
||||||
error. With the "--force" option UPX will set a few 'bytes higher' loading
|
error. With the "--force" option UPX will relocate the loading address
|
||||||
offset for the packed file, but this isn't a real problem if it is a
|
for the packed file, but this isn't a real problem if it is a single or
|
||||||
single or boot-only executable.
|
the main executable.
|
||||||
|
|
||||||
Extra options available for this executable format:
|
Extra options available for this executable format:
|
||||||
|
|
||||||
@@ -721,21 +705,23 @@ Extra options available for this executable format:
|
|||||||
the compression ratio in some cases, but usually
|
the compression ratio in some cases, but usually
|
||||||
the default method gives the best results anyway.
|
the default method gives the best results anyway.
|
||||||
|
|
||||||
--console-run This enables client/target transfer compatibility.
|
--8-bit Uses 8 bit size compression [default: 32 bit]
|
||||||
This format also run from a CD, except the "--no-align"
|
|
||||||
option is used. Upto 2024 bytes larger files
|
--8mib-ram PSone has 8 MiB ram available [default: 2 MiB]
|
||||||
than [default] will be the result, also a
|
|
||||||
slower decompression speed can be expected.
|
--boot-only This format is for main exes and CD-Mastering only !
|
||||||
|
It may slightly improve the compression ratio,
|
||||||
|
decompression routines are faster than default ones.
|
||||||
|
But it cannot be used for console transfer !
|
||||||
|
|
||||||
--no-align This option disables CD mode 2 data sector format
|
--no-align This option disables CD mode 2 data sector format
|
||||||
alignment, and enables "--console-run".
|
alignment. May slightly improves the compression ratio,
|
||||||
This will slightly improve the compression ratio,
|
|
||||||
but the compressed executable will not boot from a CD.
|
but the compressed executable will not boot from a CD.
|
||||||
So use it for client/target transfer only!.
|
Use it for console transfer only !
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=head2 NOTES FOR RTM32/PE
|
=head2 NOTES FOR RTM32/PE and ARM/PE
|
||||||
|
|
||||||
Same as win32/pe.
|
Same as win32/pe.
|
||||||
|
|
||||||
@@ -779,7 +765,7 @@ Benefits:
|
|||||||
- Better compression (but note that the kernel was already compressed,
|
- Better compression (but note that the kernel was already compressed,
|
||||||
so the improvement is not as large as with other formats).
|
so the improvement is not as large as with other formats).
|
||||||
Still, the bytes saved may be essential for special needs like
|
Still, the bytes saved may be essential for special needs like
|
||||||
bootdisks.
|
boot disks.
|
||||||
|
|
||||||
For example, this is what I get for my 2.2.16 kernel:
|
For example, this is what I get for my 2.2.16 kernel:
|
||||||
1589708 vmlinux
|
1589708 vmlinux
|
||||||
@@ -826,13 +812,14 @@ Extra options available for this executable format:
|
|||||||
=head2 NOTES FOR WIN32/PE
|
=head2 NOTES FOR WIN32/PE
|
||||||
|
|
||||||
The PE support in B<UPX> is quite stable now, but probably there are
|
The PE support in B<UPX> is quite stable now, but probably there are
|
||||||
still some incompabilities with some files.
|
still some incompatibilities with some files.
|
||||||
|
|
||||||
Because of the way B<UPX> (and other packers for this format) works, you
|
Because of the way B<UPX> (and other packers for this format) works, you
|
||||||
can see increased memory usage of your compressed files. If you start
|
can see increased memory usage of your compressed files because the whole
|
||||||
several instances of huge compressed programs you're wasting memory
|
program is loaded into memory at startup.
|
||||||
because the common segements of the program won't get shared
|
If you start several instances of huge compressed programs you're
|
||||||
across the instances.
|
wasting memory because the common segments of the program won't
|
||||||
|
get shared across the instances.
|
||||||
On the other hand if you're compressing only smaller programs, or
|
On the other hand if you're compressing only smaller programs, or
|
||||||
running only one instance of larger programs, then this penalty is
|
running only one instance of larger programs, then this penalty is
|
||||||
smaller, but it's still there.
|
smaller, but it's still there.
|
||||||
@@ -840,12 +827,19 @@ smaller, but it's still there.
|
|||||||
If you're running executables from network, then compressed programs
|
If you're running executables from network, then compressed programs
|
||||||
will load faster, and require less bandwidth during execution.
|
will load faster, and require less bandwidth during execution.
|
||||||
|
|
||||||
DLLs are supported.
|
DLLs are supported. But UPX compressed DLLs can not share common data and
|
||||||
|
code when they got used by multiple applications. So compressing msvcrt.dll
|
||||||
|
is a waste of memory, but compressing the dll plugins of a particular
|
||||||
|
application may be a better idea.
|
||||||
|
|
||||||
Screensavers are supported, with the restriction that the filename
|
Screensavers are supported, with the restriction that the filename
|
||||||
must end in ".scr" (as screensavers are handled slightly different
|
must end with ".scr" (as screensavers are handled slightly different
|
||||||
than normal exe files).
|
than normal exe files).
|
||||||
|
|
||||||
|
UPX compressed PE files have some minor memory overhead (usually in the
|
||||||
|
10 - 30 KiB range) which can be seen by specifying the "-i" command
|
||||||
|
line switch during compression.
|
||||||
|
|
||||||
Extra options available for this executable format:
|
Extra options available for this executable format:
|
||||||
|
|
||||||
--compress-exports=0 Don't compress the export section.
|
--compress-exports=0 Don't compress the export section.
|
||||||
@@ -862,9 +856,26 @@ Extra options available for this executable format:
|
|||||||
--compress-icons=1 Compress all but the first icon.
|
--compress-icons=1 Compress all but the first icon.
|
||||||
--compress-icons=2 Compress all icons which are not in the
|
--compress-icons=2 Compress all icons which are not in the
|
||||||
first icon directory. [DEFAULT]
|
first icon directory. [DEFAULT]
|
||||||
|
--compress-icons=3 Compress all icons.
|
||||||
|
|
||||||
--compress-resources=0 Don't compress any resources at all.
|
--compress-resources=0 Don't compress any resources at all.
|
||||||
|
|
||||||
|
--keep-resource=list Don't compress resources specified by the list.
|
||||||
|
The members of the list are separated by commas.
|
||||||
|
A list member has the following format: I<type[/name]>.
|
||||||
|
I<Type> is the type of the resource. Standard types
|
||||||
|
must be specified as decimal numbers, user types can be
|
||||||
|
specified by decimal IDs or strings. I<Name> is the
|
||||||
|
identifier of the resource. It can be a decimal number
|
||||||
|
or a string. For example:
|
||||||
|
|
||||||
|
--keep-resource=2/MYBITMAP,5,6/12345
|
||||||
|
|
||||||
|
UPX won't compress the named bitmap resource "MYBITMAP",
|
||||||
|
it leaves every dialog (5) resource uncompressed, and
|
||||||
|
it won't touch the string table resource with identifier
|
||||||
|
12345.
|
||||||
|
|
||||||
--force Force compression even when there is an
|
--force Force compression even when there is an
|
||||||
unexpected value in a header field.
|
unexpected value in a header field.
|
||||||
Use with care.
|
Use with care.
|
||||||
@@ -911,7 +922,7 @@ Please report all bugs immediately to the authors.
|
|||||||
Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
||||||
http://www.oberhumer.com
|
http://www.oberhumer.com
|
||||||
|
|
||||||
Laszlo Molnar <ml1050@users.sourceforge.net>
|
Laszlo Molnar <ezerotven+github@gmail.com>
|
||||||
|
|
||||||
John F. Reiser <jreiser@BitWagon.com>
|
John F. Reiser <jreiser@BitWagon.com>
|
||||||
|
|
||||||
@@ -921,22 +932,24 @@ Please report all bugs immediately to the authors.
|
|||||||
|
|
||||||
=head1 COPYRIGHT
|
=head1 COPYRIGHT
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Laszlo Molnar
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
|
|
||||||
Copyright (C) 2000-2004 John F. Reiser
|
Copyright (C) 2000-2022 John F. Reiser
|
||||||
|
|
||||||
Copyright (C) 2002-2004 Jens Medoch
|
Copyright (C) 2002-2022 Jens Medoch
|
||||||
|
|
||||||
This program may be used freely, and you are welcome to
|
B<UPX> is distributed with full source code under the terms of the
|
||||||
redistribute it under certain conditions.
|
GNU General Public License v2+; either under the pure GPLv2+ (see
|
||||||
|
the file COPYING), or (at your option) under the GPLv+2 with special
|
||||||
|
exceptions and restrictions granting the free usage for all binaries
|
||||||
|
including commercial programs (see the file LICENSE).
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
B<UPX License Agreement> for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the UPX License Agreement along
|
|
||||||
with this program; see the file LICENSE. If not, visit the UPX home page.
|
|
||||||
|
|
||||||
|
You should have received a copy of the UPX License Agreements along
|
||||||
|
with this program; see the files COPYING and LICENSE. If not,
|
||||||
|
visit the UPX home page.
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
|
||||||
|
|
||||||
|
# create the image from Dockerfile
|
||||||
|
# using a rootless Podman container
|
||||||
|
|
||||||
|
# NOTE: this image is based on rebuild-stubs-with-upx/upx-stubtools-20210104-vX,
|
||||||
|
# so you have to create that image first
|
||||||
|
# WARNING: we install many packages, so the resulting image needs A LOT of disk space!
|
||||||
|
image=upx-cross-compile-20221108-v7
|
||||||
|
|
||||||
|
podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir"
|
||||||
|
|
||||||
|
podman image list "$image"
|
||||||
|
podman image tree "$image"
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
|
||||||
|
|
||||||
|
# run an interactive shell in the image
|
||||||
|
# using a rootless Podman container
|
||||||
|
|
||||||
|
image=upx-cross-compile-20221108-v7
|
||||||
|
|
||||||
|
flags=( -ti --read-only --rm )
|
||||||
|
flags+=( --cap-drop=all ) # drop all capabilities
|
||||||
|
flags+=( --network=none ) # no network needed
|
||||||
|
flags+=( -e TERM="$TERM" ) # pass $TERM
|
||||||
|
if [[ 1 == 1 ]]; then
|
||||||
|
# run as user upx 2000:2000
|
||||||
|
flags+=( --user 2000 )
|
||||||
|
# map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user
|
||||||
|
flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 )
|
||||||
|
# map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group
|
||||||
|
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
|
||||||
|
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx
|
||||||
|
# INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs!
|
||||||
|
flags+=( -v "${argv0dir}/../..:/home/upx/src/upx" )
|
||||||
|
flags+=( -w /home/upx/src/upx ) # set working directory
|
||||||
|
else
|
||||||
|
# run as user root 0:0
|
||||||
|
# ONLY FOR DEBUGGING THE IMAGE
|
||||||
|
# map container user/group 0 to current host user/group
|
||||||
|
flags+=( --user 0 )
|
||||||
|
fi
|
||||||
|
|
||||||
|
podman run "${flags[@]}" "$image" bash -l
|
||||||
|
|
||||||
|
# now we can cross-compile UPX for Windows:
|
||||||
|
# cd /home/upx/src/upx
|
||||||
|
# rm -rf ./build/release-cross-mingw64
|
||||||
|
# make build/release-cross-mingw64
|
||||||
|
|
||||||
|
# lots of other cross-compilers are installed; see "ls /usr/bin/*g++*"
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# NOTE: this image is based on rebuild-stubs-with-upx/upx-stubtools-20210104-vX,
|
||||||
|
# so you have to create that image first
|
||||||
|
# WARNING: we install many packages, so the resulting image needs A LOT of disk space!
|
||||||
|
FROM localhost/upx-stubtools-20210104-v7
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Ubuntu 22.04
|
||||||
|
RUN apt-get update && apt-get upgrade -y \
|
||||||
|
&& apt-get install -y \
|
||||||
|
# Linux cross compilers
|
||||||
|
g++-aarch64-linux-gnu \
|
||||||
|
g++-alpha-linux-gnu \
|
||||||
|
g++-arm-linux-gnueabi \
|
||||||
|
g++-arm-linux-gnueabihf \
|
||||||
|
g++-hppa-linux-gnu \
|
||||||
|
g++-i686-linux-gnu \
|
||||||
|
g++-m68k-linux-gnu \
|
||||||
|
g++-mips-linux-gnu \
|
||||||
|
g++-mipsel-linux-gnu \
|
||||||
|
g++-mips64-linux-gnuabi64 \
|
||||||
|
g++-mips64el-linux-gnuabi64 \
|
||||||
|
g++-powerpc-linux-gnu \
|
||||||
|
g++-powerpc64-linux-gnu \
|
||||||
|
g++-powerpc64le-linux-gnu \
|
||||||
|
g++-riscv64-linux-gnu \
|
||||||
|
g++-s390x-linux-gnu \
|
||||||
|
g++-sh4-linux-gnu \
|
||||||
|
g++-sparc64-linux-gnu \
|
||||||
|
# Linux cross compilers - ILP32 on 64-bit CPUs
|
||||||
|
g++-x86-64-linux-gnux32 \
|
||||||
|
# Windows cross compilers
|
||||||
|
g++-mingw-w64-i686 \
|
||||||
|
g++-mingw-w64-x86-64 \
|
||||||
|
&& true
|
||||||
|
RUN apt-get install -y \
|
||||||
|
# clang-14 and tools
|
||||||
|
clang-14 clang-format-14 clang-tidy-14 clang-tools-14 lldb-14 llvm-14 \
|
||||||
|
# QEMU and Wine
|
||||||
|
qemu-system qemu-user wine wine32 \
|
||||||
|
# misc
|
||||||
|
gdb lsb-release valgrind \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# switch back to default user upx 2000:2000
|
||||||
|
USER upx
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
|
||||||
|
|
||||||
|
# create the image from Dockerfile
|
||||||
|
# using a rootless Podman container
|
||||||
|
|
||||||
|
image=upx-stubtools-20210104-v7
|
||||||
|
|
||||||
|
podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir"
|
||||||
|
|
||||||
|
podman image list "$image"
|
||||||
|
podman image tree "$image"
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
|
||||||
|
|
||||||
|
# run an interactive shell in the image
|
||||||
|
# using a rootless Podman container
|
||||||
|
|
||||||
|
image=upx-stubtools-20210104-v7
|
||||||
|
|
||||||
|
flags=( -ti --read-only --rm )
|
||||||
|
flags+=( --cap-drop=all ) # drop all capabilities
|
||||||
|
flags+=( --network=none ) # no network needed
|
||||||
|
flags+=( -e TERM="$TERM" ) # pass $TERM
|
||||||
|
if [[ 1 == 1 ]]; then
|
||||||
|
# run as user upx 2000:2000
|
||||||
|
flags+=( --user 2000 )
|
||||||
|
# map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user
|
||||||
|
flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 )
|
||||||
|
# map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group
|
||||||
|
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
|
||||||
|
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx
|
||||||
|
# INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs!
|
||||||
|
flags+=( -v "${argv0dir}/../..:/home/upx/src/upx" )
|
||||||
|
flags+=( -w /home/upx/src/upx ) # set working directory
|
||||||
|
else
|
||||||
|
# run as user root 0:0
|
||||||
|
# ONLY FOR DEBUGGING THE IMAGE
|
||||||
|
# map container user/group 0 to current host user/group
|
||||||
|
flags+=( --user 0 )
|
||||||
|
fi
|
||||||
|
|
||||||
|
podman run "${flags[@]}" "$image" bash -l
|
||||||
|
|
||||||
|
# now we can rebuild the UPX stubs:
|
||||||
|
# cd /home/upx/src/upx/src/stub
|
||||||
|
# # make sure that git is clean:
|
||||||
|
# git status .
|
||||||
|
# # remove stub files and make sure that they got deleted:
|
||||||
|
# make maintainer-clean
|
||||||
|
# git status .
|
||||||
|
# # rebuild
|
||||||
|
# make all
|
||||||
|
# # make sure that the stub files did rebuild correctly:
|
||||||
|
# git status .
|
||||||
|
# git diff .
|
||||||
|
|
||||||
|
# we can also build UPX in the container:
|
||||||
|
# cd /home/upx/src/upx
|
||||||
|
# rm -rf ./build/release
|
||||||
|
# make build/release
|
||||||
|
# # run tests
|
||||||
|
# ./build/release/upx --version
|
||||||
|
# make -C build/release test
|
||||||
|
|
||||||
|
# and we can also rebuild the UPX docs the container:
|
||||||
|
# cd /home/upx/src/upx
|
||||||
|
# make -C doc clean all
|
||||||
|
# git status doc
|
||||||
|
# git diff doc
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
FROM docker.io/library/ubuntu:22.04
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
|
# install system packages
|
||||||
|
RUN dpkg --add-architecture i386 \
|
||||||
|
&& apt-get update && apt-get upgrade -y \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
aria2 ca-certificates git less libmpc3 libncurses5 make \
|
||||||
|
ncurses-term perl-base python2-minimal wget xz-utils \
|
||||||
|
libc6:i386 zlib1g:i386 \
|
||||||
|
# the following packages are not required for rebuilding the stubs, but
|
||||||
|
# they do make the image much more convenient and also allow building
|
||||||
|
# the full UPX binary inside the container via CMake:
|
||||||
|
7zip bzip2 cmake elfutils file g++ htop libzstd-dev lzip lzop ninja-build \
|
||||||
|
p7zip patch patchelf pax-utils rsync unzip vim zip zlib1g-dev zsh zstd \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# manually install compat libs from Ubuntu 16.04; REQUIRED
|
||||||
|
RUN cd /root \
|
||||||
|
&& aria2c --checksum=sha-256=2605f43f8047fc972855bb909f1dd7af761bbfd35ae559ad689b0d55a4236d69 \
|
||||||
|
'http://mirror.enzu.com/ubuntu/pool/main/g/gmp/libgmp10_6.1.0+dfsg-2_amd64.deb' \
|
||||||
|
&& aria2c --checksum=sha-256=3973a97387bbe0e8a775995c22861d8478edee2a594e8117970f635de25b2c8a \
|
||||||
|
'http://mirror.enzu.com/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb' \
|
||||||
|
&& mkdir packages \
|
||||||
|
&& for f in ./*.deb; do dpkg -x $f ./packages; done \
|
||||||
|
&& mv -v -n ./packages/usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/ \
|
||||||
|
&& rm -rf ./*.deb ./packages \
|
||||||
|
&& ldconfig \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# install upx-stubtools into /usr/local/bin/bin-upx-20210104; REQUIRED
|
||||||
|
RUN cd /root \
|
||||||
|
&& aria2c --checksum=sha-256=abcd8337cc656fe68d7bbb2ffe0f1e5ddce618688aa0e18c1ebcc40072843884 \
|
||||||
|
'https://github.com/upx/upx-stubtools/releases/download/v20210104/bin-upx-20210104.tar.xz' \
|
||||||
|
&& cd /usr/local/bin \
|
||||||
|
&& tar -xoaf /root/bin-upx-20210104.tar.xz \
|
||||||
|
&& rm /root/bin-upx-20210104.tar.xz \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# install pre-built binary UPX versions into /usr/local/bin; not required but convenient for testing
|
||||||
|
RUN cd /root \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v3.91/upx-3.91-amd64_linux.tar.bz2 \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v3.92/upx-3.92-amd64_linux.tar.xz \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz \
|
||||||
|
&& wget -q https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-amd64_linux.tar.xz \
|
||||||
|
&& for f in ./upx-*.tar.*; do tar -xoaf $f; done \
|
||||||
|
&& rm ./upx-*.tar.* \
|
||||||
|
&& d=upx-3.91-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-3.91 \
|
||||||
|
&& d=upx-3.92-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-3.92 \
|
||||||
|
&& d=upx-3.93-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-3.93 \
|
||||||
|
&& d=upx-3.94-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-3.94 \
|
||||||
|
&& d=upx-3.95-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-3.95 \
|
||||||
|
&& d=upx-3.96-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-3.96 \
|
||||||
|
&& d=upx-4.0.0-amd64_linux; ./$d/upx -d $d/upx -o /usr/local/bin/upx-4.0.0 \
|
||||||
|
&& rm -rf ./upx-*linux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
# create default user upx 2000:2000
|
||||||
|
RUN useradd upx -U --uid 2000 --shell /bin/bash -m \
|
||||||
|
&& mkdir -p /home/upx/.local/bin /home/upx/src/upx \
|
||||||
|
&& ln -s /usr/local/bin/bin-upx-20210104 /home/upx/.local/bin/bin-upx \
|
||||||
|
&& chown -R upx:upx /home/upx \
|
||||||
|
&& true
|
||||||
|
USER upx
|
||||||
Executable
+39
@@ -0,0 +1,39 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
[[ -z $1 ]] || cd "$1" || exit 1
|
||||||
|
|
||||||
|
find . \
|
||||||
|
-type d -name '.git' -prune -o \
|
||||||
|
-type d -name '.hg' -prune -o \
|
||||||
|
-type d -name 'build*' -prune -o \
|
||||||
|
-type d -name 'tmp*' -prune -o \
|
||||||
|
-type d -name 'vendor' -prune -o \
|
||||||
|
-type f -iname '*.bat' -prune -o \
|
||||||
|
-type f -iname '*.exe' -prune -o \
|
||||||
|
-type f -iname '*.o' -prune -o \
|
||||||
|
-type f -iname '*.obj' -prune -o \
|
||||||
|
-type f -iname '*.out' -prune -o \
|
||||||
|
-type f -iname '*.pdf' -prune -o \
|
||||||
|
-type f -iname '*.swp' -prune -o \
|
||||||
|
-type f -print0 | \
|
||||||
|
LC_ALL=C sort -z | xargs -0r perl -n -e '
|
||||||
|
#print("$ARGV\n");
|
||||||
|
if (m,[\x00\x01\x02\x7f\xfe\xff],) { print "ERROR: binary file detected $ARGV: $_"; exit(1); }
|
||||||
|
if (m,[\r\x1a],) { print "ERROR: DOS EOL detected $ARGV: $_"; exit(1); }
|
||||||
|
if (m,([ \t]+)$,) {
|
||||||
|
# allow exactly two trailing spaces for GitHub flavoured Markdown in .md files
|
||||||
|
if ($1 ne " " || $ARGV !~ m,\.md$,) {
|
||||||
|
print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m,\t,) {
|
||||||
|
if ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { }
|
||||||
|
elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { }
|
||||||
|
elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { }
|
||||||
|
else { print "ERROR: hard TAB detected $ARGV: $_"; exit(1); }
|
||||||
|
}
|
||||||
|
' || exit 1
|
||||||
Executable
+33
@@ -0,0 +1,33 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
|
||||||
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
[[ -z $1 ]] || cd "$1" || exit 1
|
||||||
|
[[ -d .git ]] || exit 1
|
||||||
|
|
||||||
|
git ls-files --full-name -z | perl -0 -n -e '
|
||||||
|
s,^,./,;
|
||||||
|
if (m,^\./src/lzma-sdk(\0|$),) { }
|
||||||
|
elsif (m,^\./vendor/,) { }
|
||||||
|
elsif (m,\.bat(\0|$),) { }
|
||||||
|
elsif (m,\.exe(\0|$),) { }
|
||||||
|
else { print; }
|
||||||
|
' | LC_ALL=C sort -z | xargs -0r perl -n -e '
|
||||||
|
#print("$ARGV\n");
|
||||||
|
if (m,[\x00\x01\x02\x7f\xfe\xff],) { print "ERROR: binary file detected $ARGV: $_"; exit(1); }
|
||||||
|
if (m,[\r\x1a],) { print "ERROR: DOS EOL detected $ARGV: $_"; exit(1); }
|
||||||
|
if (m,([ \t]+)$,) {
|
||||||
|
# allow exactly two trailing spaces for GitHub flavoured Markdown in .md files
|
||||||
|
if ($1 ne " " || $ARGV !~ m,\.md$,) {
|
||||||
|
print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m,\t,) {
|
||||||
|
if ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { }
|
||||||
|
elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { }
|
||||||
|
elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { }
|
||||||
|
else { print "ERROR: hard TAB detected $ARGV: $_"; exit(1); }
|
||||||
|
}
|
||||||
|
' || exit 1
|
||||||
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
## vim:set ts=4 sw=4 et:
|
||||||
|
set -e; set -o pipefail
|
||||||
|
|
||||||
|
# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike
|
||||||
|
|
||||||
|
# NOTE: we are using clang-format-10.0.1 from upx-stubtools
|
||||||
|
# see https://github.com/upx/upx-stubtools/releases
|
||||||
|
|
||||||
|
# NOTE: we use .clang-format config from upx.git/.clang-format
|
||||||
|
|
||||||
|
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
|
||||||
|
UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-10.0.1"
|
||||||
|
fi
|
||||||
|
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
|
||||||
|
UPX_CLANG_FORMAT="$HOME/.local/bin/bin-upx/clang-format-10.0.1"
|
||||||
|
fi
|
||||||
|
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
|
||||||
|
UPX_CLANG_FORMAT="$HOME/bin/bin-upx/clang-format-10.0.1"
|
||||||
|
fi
|
||||||
|
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
|
||||||
|
echo "ERROR: $0: cannot find clang-format-10.0.1"
|
||||||
|
echo "ERROR: $0: please visit https://github.com/upx/upx-stubtools"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# limit memory usage to 1 GiB (in case of clang-format problems with invalid files)
|
||||||
|
ulimit -v 1048576 || true
|
||||||
|
|
||||||
|
#echo $UPX_CLANG_FORMAT
|
||||||
|
exec "$UPX_CLANG_FORMAT" -style=file "$@"
|
||||||
|
exit 1
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
The GNU bfd binary file descriptor package, part of the GNU binutils package,
|
|
||||||
contains code to recognize an Elf file by looking at fields in the file header.
|
|
||||||
Many programs (such as gdb, size, objdump, objcopy, strip and others) use bfd.
|
|
||||||
Unfortunately, bfd has been overly strict. In releases
|
|
||||||
binutils-2.9.1.0.4, binutils-2.9.1.0.23, binutils-2.9.5.0.0,
|
|
||||||
binutils-2.10.1,
|
|
||||||
gdb-4.17, gdb-5.0,
|
|
||||||
and probably others,
|
|
||||||
bfd does not recognize a file with zero in Elf32_Ehdr.e_shoff, .e_shentsize,
|
|
||||||
or .e_shnum, even though the operating system kernel does not care, and many
|
|
||||||
bfd clients would work just fine in these cases.
|
|
||||||
|
|
||||||
Because of its desire to create small size compressed executables, UPX
|
|
||||||
generates and uses Elf files with zero in .e_shoff, .e_shentsizes, and .e_shnum.
|
|
||||||
As a result, many widely-distributed instances of gdb, size, objdump, etc.,
|
|
||||||
refuse to work on UPX-packed executables.
|
|
||||||
|
|
||||||
Here is a patch to bfd/elfcode.h which enables many bfd clients to work
|
|
||||||
with UPX-packed executables. The last two lines of the patch are
|
|
||||||
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
|
|
||||||
--- elfcode.h.orig Mon Jun 16 11:45:32 1997
|
|
||||||
+++ elfcode.h Sat Apr 22 10:18:56 2000
|
|
||||||
@@ -1,5 +1,5 @@
|
|
||||||
/* ELF executable support for BFD.
|
|
||||||
- Copyright 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
|
||||||
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by Fred Fish @ Cygnus Support, from information published
|
|
||||||
in "UNIX System V Release 4, Programmers Guide: ANSI C and
|
|
||||||
@@ -517,14 +517,14 @@
|
|
||||||
elf_debug_file (i_ehdrp);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- /* If there is no section header table, we're hosed. */
|
|
||||||
- if (i_ehdrp->e_shoff == 0)
|
|
||||||
+ /* If there is no section header table, and relocatable, then we're hosed. */
|
|
||||||
+ if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
|
|
||||||
goto got_wrong_format_error;
|
|
||||||
|
|
||||||
/* As a simple sanity check, verify that the what BFD thinks is the
|
|
||||||
size of each section header table entry actually matches the size
|
|
||||||
- recorded in the file. */
|
|
||||||
- if (i_ehdrp->e_shentsize != sizeof (x_shdr))
|
|
||||||
+ recorded in the file, but only if there are any sections. */
|
|
||||||
+ if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0)
|
|
||||||
goto got_wrong_format_error;
|
|
||||||
|
|
||||||
ebd = get_elf_backend_data (abfd);
|
|
||||||
@@ -579,6 +579,7 @@
|
|
||||||
/* Allocate space for a copy of the section header table in
|
|
||||||
internal form, seek to the section header table in the file,
|
|
||||||
read it in, and convert it to internal form. */
|
|
||||||
+ if (i_ehdrp->e_shnum!=0) {
|
|
||||||
i_shdrp = ((Elf_Internal_Shdr *)
|
|
||||||
bfd_alloc (abfd, sizeof (*i_shdrp) * i_ehdrp->e_shnum));
|
|
||||||
elf_elfsections (abfd) = ((Elf_Internal_Shdr **)
|
|
||||||
@@ -609,6 +610,7 @@
|
|
||||||
if (! bfd_section_from_shdr (abfd, i_ehdrp->e_shstrndx))
|
|
||||||
goto got_no_match;
|
|
||||||
}
|
|
||||||
+ }
|
|
||||||
|
|
||||||
/* Read in the program headers. */
|
|
||||||
if (i_ehdrp->e_phnum == 0)
|
|
||||||
@@ -644,6 +646,7 @@
|
|
||||||
bfd_section_from_shdr with it (since this particular strtab is
|
|
||||||
used to find all of the ELF section names.) */
|
|
||||||
|
|
||||||
+ if (i_ehdrp->e_shstrndx != 0) {
|
|
||||||
shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx);
|
|
||||||
if (!shstrtab)
|
|
||||||
goto got_no_match;
|
|
||||||
@@ -657,6 +660,7 @@
|
|
||||||
if (! bfd_section_from_shdr (abfd, shindex))
|
|
||||||
goto got_no_match;
|
|
||||||
}
|
|
||||||
+ }
|
|
||||||
|
|
||||||
/* Let the backend double check the format and override global
|
|
||||||
information. */
|
|
||||||
@@ -930,7 +934,7 @@
|
|
||||||
{
|
|
||||||
Elf_Internal_Shdr *hdr;
|
|
||||||
Elf_Internal_Shdr *verhdr;
|
|
||||||
- long symcount; /* Number of external ELF symbols */
|
|
||||||
+ unsigned long symcount; /* Number of external ELF symbols */
|
|
||||||
elf_symbol_type *sym; /* Pointer to current bfd symbol */
|
|
||||||
elf_symbol_type *symbase; /* Buffer for generated bfd symbols */
|
|
||||||
Elf_Internal_Sym i_sym;
|
|
||||||
@@ -978,7 +982,7 @@
|
|
||||||
sym = symbase = NULL;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- long i;
|
|
||||||
+ unsigned long i;
|
|
||||||
|
|
||||||
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
|
|
||||||
return -1;
|
|
||||||
-3164
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
|||||||
GNUmakefile
|
|
||||||
*.0??
|
|
||||||
*.d
|
|
||||||
*.dat
|
|
||||||
*.idb
|
|
||||||
*.img
|
|
||||||
*.map
|
|
||||||
*.raw
|
|
||||||
*.rc
|
|
||||||
*.rel
|
|
||||||
*.res
|
|
||||||
*.pdb
|
|
||||||
*.upx
|
|
||||||
.gdbinit
|
|
||||||
.Attic
|
|
||||||
.deps
|
|
||||||
B
|
|
||||||
compress_nrv.*
|
|
||||||
upx
|
|
||||||
upx_nrv
|
|
||||||
upx_nrv.*
|
|
||||||
upx_ucl
|
|
||||||
upx_ucl.*
|
|
||||||
version1*.h
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
ifeq ($(DEPS_DONE),)
|
|
||||||
DEPS_DONE := 1
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // automated dependencies
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
ifeq ($(DEPMODE),gcc)
|
|
||||||
EXTRA_CFLAGS += -Wp,-MMD,.deps/$(*F).d
|
|
||||||
EXTRA_CXXFLAGS += -Wp,-MMD,.deps/$(*F).d
|
|
||||||
HAVE_DEPS := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(DEPMODE),linux-intelc)
|
|
||||||
EXTRA_CFLAGS += -MMD -MF.deps/$(*F).d
|
|
||||||
EXTRA_CXXFLAGS += -MMD -MF.deps/$(*F).d
|
|
||||||
HAVE_DEPS := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(DEPMODE),linux-pgi)
|
|
||||||
## NOTE: -MMD does not work...
|
|
||||||
EXTRA_CFLAGS += -MD.deps/$(*F).d
|
|
||||||
EXTRA_CXXFLAGS += -MD.deps/$(*F).d
|
|
||||||
HAVE_DEPS := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(HAVE_DEPS),1)
|
|
||||||
ifeq ($(strip $(wildcard .deps)),)
|
|
||||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
|
||||||
else
|
|
||||||
DEPS_FILES := $(wildcard .deps/*.d)
|
|
||||||
ifneq ($(strip $(DEPS_FILES)),)
|
|
||||||
include $(DEPS_FILES)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
endif # DEPS_DONE
|
|
||||||
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
DEPMODE := gcc
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // defaults for gcc
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS_W =
|
|
||||||
CFLAGS_M =
|
|
||||||
CFLAGS_O =
|
|
||||||
CXXFLAGS_W =
|
|
||||||
CXXFLAGS_M =
|
|
||||||
CXXFLAGS_O =
|
|
||||||
|
|
||||||
CFLAGS = $(CFLAGS_W) $(EXTRA_CFLAGS_W) $(CFLAGS_M) $(CFLAGS_O) $(EXTRA_CFLAGS_O)
|
|
||||||
CXXFLAGS = $(CXXFLAGS_W) $(EXTRA_CXXFLAGS_W) $(CXXFLAGS_M) $(CXXFLAGS_O) $(EXTRA_CXXFLAGS_O)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# cflags
|
|
||||||
#
|
|
||||||
|
|
||||||
##CFLAGS_WERROR = -Werror
|
|
||||||
CFLAGS_WERROR =
|
|
||||||
CFLAGS_W = $(CFLAGS_WERROR) -Wall -W -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wwrite-strings
|
|
||||||
CXXFLAGS_W = $(CFLAGS_WERROR) -Wall -W -Wcast-align -Wcast-qual -Winline -Woverloaded-virtual -Wpointer-arith -Wshadow -Wsign-promo -Wsynth -Wwrite-strings
|
|
||||||
|
|
||||||
##CFLAGS_M += -fno-builtin
|
|
||||||
##CFLAGS_M += -malign-functions=0 -malign-jumps=0 -malign-loops=0
|
|
||||||
CXXFLAGS_M = $(CFLAGS_M)
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS_O = -g -O0
|
|
||||||
else
|
|
||||||
##CFLAGS_O = -Os -fstrict-aliasing
|
|
||||||
CFLAGS_O = -O2 -fstrict-aliasing
|
|
||||||
##CFLAGS_O = -O2 -fno-strict-aliasing
|
|
||||||
endif
|
|
||||||
CXXFLAGS_O = $(CFLAGS_O) -fconserve-space
|
|
||||||
##CXXFLAGS += -fasynchronous-exceptions
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# cxxflags for g++ 3.2 or better
|
|
||||||
|
|
||||||
##CXXFLAGS_W += -Wdisabled-optimization -Wpacked
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# ldflags
|
|
||||||
#
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
LDFLAGS += -g
|
|
||||||
else
|
|
||||||
LDFLAGS += -s
|
|
||||||
endif
|
|
||||||
LDFLAGS += -Wl,-Map,$T.map
|
|
||||||
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# vi:nowrap
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
UDIR := $($(U)DIR)
|
|
||||||
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/include)),) # { include
|
|
||||||
DEFS += -DWITH_$(U)
|
|
||||||
INCLUDES += -I$(UDIR)/include
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/debug/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/debug/src/.libs
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/$(release)/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/$(release)/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/$(target)/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/$(target)/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/release/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/release/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR))),)
|
|
||||||
LIBDIRS += $(UDIR)
|
|
||||||
DOS_LIBDIRS := $(DOS_LIBDIRS);$(UDIR)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDLIBS += -l$(u)
|
|
||||||
DOS_LDLIBS += $(u).lib
|
|
||||||
|
|
||||||
|
|
||||||
DEFS := $(DEFS)
|
|
||||||
INCLUDES := $(INCLUDES)
|
|
||||||
LIBDIRS := $(LIBDIRS)
|
|
||||||
LDLIBS := $(LDLIBS)
|
|
||||||
DOS_LDLIBS := $(DOS_LDLIBS)
|
|
||||||
|
|
||||||
endif # } include
|
|
||||||
+84
-67
@@ -1,86 +1,103 @@
|
|||||||
#
|
#
|
||||||
# UPX Makefile (GNU make) - works with unix/win32/djgpp2
|
# UPX Makefile - needs GNU make
|
||||||
#
|
|
||||||
# usage:
|
|
||||||
# `make target=linux' # linux
|
|
||||||
# `make target=dos32-djggp2' # dos32 - djggp2
|
|
||||||
# `make target=win32-cygwin' # win32 - cygwin
|
|
||||||
# `make target=win32-mingw32' # win32 - mingw32
|
|
||||||
# `make target=win32-rsxnt' # win32 - rsxnt
|
|
||||||
# `make target=win32-bc' # win32 - Borland C++
|
|
||||||
# `make target=win32-dm' # win32 - Digital Mars C++
|
|
||||||
# `make target=win32-ic' # win32 - Intel C++
|
|
||||||
# `make target=win32-vc' # win32 - Visual C++
|
|
||||||
# `make target=win32-wc' # win32 - Watcom C++
|
|
||||||
# `make target=cross-amd64-linux' # x86_64-linux cross compiler
|
|
||||||
# `make target=cross-mingw32' # i586-mingw32msvc cross compiler
|
|
||||||
# `make target=cross-mint' # m68k-atari-mint cross compiler
|
|
||||||
# `make target=gcc' # generic gcc
|
|
||||||
#
|
|
||||||
# you can also set the `UPX_MAKE_TARGET' environment variable.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# IMPORTANT NOTE: this Makefile is deprecated - please
|
||||||
|
# directly use the CMake build instead!
|
||||||
|
|
||||||
# configuration section
|
MAKEFLAGS += -r
|
||||||
|
.SUFFIXES:
|
||||||
|
export SHELL = /bin/sh
|
||||||
|
|
||||||
ifeq ($(strip $(UCLDIR)),)
|
ifndef srcdir
|
||||||
# change this to reflect where the UCL library is
|
srcdir := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||||
UCLDIR = $(HOME)/local/src/ucl-1.02
|
srcdir := $(shell echo '$(srcdir)' | sed 's,/*$$,,' || echo 'ERROR')
|
||||||
|
endif
|
||||||
|
ifndef top_srcdir
|
||||||
|
top_srcdir := $(srcdir)/..
|
||||||
endif
|
endif
|
||||||
|
|
||||||
## you can set the default target here
|
#
|
||||||
##target =
|
# redirect to top-level CMake build
|
||||||
|
#
|
||||||
|
|
||||||
DEBUG = 0
|
.DEFAULT_GOAL = build/debug
|
||||||
|
|
||||||
srcdir = .
|
build/debug: $(top_srcdir)/build/debug/upx
|
||||||
top_srcdir = ..
|
build/release: $(top_srcdir)/build/release/upx
|
||||||
|
# shortcuts
|
||||||
|
all: build/debug build/release
|
||||||
|
debug: build/debug
|
||||||
|
release: build/release
|
||||||
|
|
||||||
|
$(top_srcdir)/build/debug/upx: PHONY
|
||||||
|
$(MAKE) -C $(top_srcdir) build/debug
|
||||||
|
$(top_srcdir)/build/release/upx: PHONY
|
||||||
|
$(MAKE) -C $(top_srcdir) build/release
|
||||||
|
|
||||||
##### You should not have to change anything below this line. #####
|
.PHONY: PHONY
|
||||||
|
|
||||||
|
#
|
||||||
|
# "make run-testsuite"
|
||||||
|
#
|
||||||
|
|
||||||
# /***********************************************************************
|
# search for the UPX testsuite -- git clone https://github.com/upx/upx-testsuite.git
|
||||||
# // object files
|
# you also can override upx_testsuite_SRCDIR
|
||||||
# ************************************************************************/
|
ifndef upx_testsuite_SRCDIR
|
||||||
|
# search standard locations below $(top_srcdir)
|
||||||
|
ifneq ($(wildcard $(top_srcdir)/../upx--upx-testsuite.git/files/packed/.),)
|
||||||
|
upx_testsuite_SRCDIR := $(top_srcdir)/../upx--upx-testsuite.git
|
||||||
|
else ifneq ($(wildcard $(top_srcdir)/../upx-testsuite.git/files/packed/.),)
|
||||||
|
upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite.git
|
||||||
|
else ifneq ($(wildcard $(top_srcdir)/../upx-testsuite/files/packed/.),)
|
||||||
|
upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# these use exceptions & RTTI
|
# run the UPX testsuite
|
||||||
OBJECTS1 = \
|
# The expected (old) checksums are in $(top_srcdir)/.github/travis_testsuite_1-expected_sha256sums.sh
|
||||||
compress$o except$o file$o lefile$o \
|
# The actual (new) checksums are in tmp-testsuite/testsuite_1/.sha256sums.recreate
|
||||||
filter$o linker$o mem$o msg$o stdcxx$o work$o ui$o \
|
ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),)
|
||||||
packer$o packerf$o packhead$o packmast$o \
|
ifneq ($(wildcard $(top_srcdir)/.github/travis_testsuite_1.sh),)
|
||||||
p_com$o p_djgpp2$o p_elks$o p_exe$o \
|
run-testsuite: export upx_exe := $(top_srcdir)/build/release/upx
|
||||||
p_lx_elf$o p_lx_exc$o p_lx_sep$o p_lx_sh$o \
|
run-testsuite: export upx_testsuite_SRCDIR := $(upx_testsuite_SRCDIR)
|
||||||
p_ps1$o p_sys$o p_tmt$o p_tos$o \
|
run-testsuite: export upx_testsuite_BUILDDIR := ./tmp-testsuite
|
||||||
p_unix$o p_vmlinz$o p_w16ne$o p_w32pe$o p_wcle$o
|
run-testsuite: $(top_srcdir)/build/release/upx PHONY
|
||||||
|
time -p bash $(top_srcdir)/.github/travis_testsuite_1.sh
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# no exceptions or RTTI
|
#
|
||||||
OBJECTS2 = \
|
# "make clang-format"
|
||||||
filteri$o help$o main$o mygetopt$o snprintf$o util$o \
|
#
|
||||||
c_init$o c_file$o c_none$o c_screen$o \
|
|
||||||
s_object$o s_djgpp2$o s_vcsa$o s_win32$o
|
|
||||||
|
|
||||||
# pure C sources
|
# automatically format some C++ source code files
|
||||||
OBJECTS3 =
|
ifeq ($(shell uname),Linux)
|
||||||
|
CLANG_FORMAT_FILES += bele.h bele_policy.h
|
||||||
|
CLANG_FORMAT_FILES += compress_lzma.cpp compress_ucl.cpp compress_zlib.cpp
|
||||||
|
CLANG_FORMAT_FILES += except.cpp except.h
|
||||||
|
CLANG_FORMAT_FILES += file.cpp file.h
|
||||||
|
CLANG_FORMAT_FILES += linker.cpp linker.h packhead.cpp packmast.cpp packmast.h
|
||||||
|
CLANG_FORMAT_FILES += main.cpp options.cpp options.h packer.cpp packer.h
|
||||||
|
CLANG_FORMAT_FILES += p_tos.cpp p_tos.h
|
||||||
|
CLANG_FORMAT_FILES += s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h
|
||||||
|
CLANG_FORMAT_FILES += ui.cpp ui.h work.cpp
|
||||||
|
CLANG_FORMAT_FILES += $(wildcard util/[a-ln-z]*.[ch]* util/mem*.[ch]*)
|
||||||
|
clang-format: PHONY
|
||||||
|
$(top_srcdir)/misc/scripts/upx-clang-format -i $(addprefix $(top_srcdir)/src/,$(sort $(CLANG_FORMAT_FILES)))
|
||||||
|
endif
|
||||||
|
|
||||||
OBJECTS = $(OBJECTS1) $(OBJECTS2) $(OBJECTS3)
|
#
|
||||||
LIBS =
|
# "make check-whitespace"
|
||||||
RESOURCES =
|
#
|
||||||
|
|
||||||
|
CHECK_WHITESPACE =
|
||||||
|
ifeq ($(shell uname),Linux)
|
||||||
|
CHECK_WHITESPACE = $(top_srcdir)/misc/scripts/check_whitespace.sh $(top_srcdir)
|
||||||
|
ifneq ($(wildcard $(top_srcdir)/.git/.),)
|
||||||
|
CHECK_WHITESPACE = $(top_srcdir)/misc/scripts/check_whitespace_git.sh $(top_srcdir)
|
||||||
|
endif
|
||||||
|
check-whitespace : PHONY ; $(CHECK_WHITESPACE)
|
||||||
|
endif
|
||||||
|
|
||||||
# /***********************************************************************
|
# vim:set ts=8 sw=8 noet:
|
||||||
# // main
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
override WITH_ZLIB = 1
|
|
||||||
|
|
||||||
include $(srcdir)/Makefile.bld
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // dependencies
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
include $(srcdir)/Makedefs.dep
|
|
||||||
|
|
||||||
# vi:nowrap
|
|
||||||
|
|||||||
@@ -1,717 +0,0 @@
|
|||||||
# /***********************************************************************
|
|
||||||
# // perpare setup
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .a .c .cpp .exe .lib .o .obj .rc .res .ttp
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(srcdir),)
|
|
||||||
srcdir = .
|
|
||||||
endif
|
|
||||||
|
|
||||||
VPATH = $(srcdir)
|
|
||||||
|
|
||||||
|
|
||||||
# auto-detect the target unless given on the commandline
|
|
||||||
ifeq ($(strip $(target)),)
|
|
||||||
# try environment variable UPX_MAKE_TARGET
|
|
||||||
target := $(UPX_MAKE_TARGET)
|
|
||||||
endif
|
|
||||||
ifeq ($(strip $(target)),)
|
|
||||||
ifneq ($(strip $(wildcard /usr/include/linux)),)
|
|
||||||
target = linux
|
|
||||||
endif
|
|
||||||
##ifneq ($(strip $(wildcard /platform/sun4?/kernel/unix)),)
|
|
||||||
##target = sparc-sun-solaris
|
|
||||||
##endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(strip $(target)),)
|
|
||||||
include please_specify_a_target
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# util var for use in the rules - basename of the current target
|
|
||||||
override T = $(basename $@)
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // compiler defaults
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
CC_SRC = $<
|
|
||||||
CXX_SRC = $<
|
|
||||||
CC_COMPILE = $(CC) $(CCARCH) $(DEFS) $(EXTRA_DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_OUTPUT) -c $(CC_SRC)
|
|
||||||
CXX_COMPILE = $(CXX) $(CXXARCH) $(DEFS) $(EXTRA_DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(CXXFLAGS_OUTPUT) -c $(CXX_SRC)
|
|
||||||
CXX_LINK_EXE = $(CXXLD) $(CXXLDARCH) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LINK_EXE_OUTPUT) $^ $(LDLIBS) $(EXTRA_LDLIBS) $(LINK_EXE_LDFLAGS)
|
|
||||||
STUBEDIT_EXE =
|
|
||||||
STUBIFY_EXE =
|
|
||||||
CHMOD_EXE =
|
|
||||||
|
|
||||||
o = .o
|
|
||||||
a = .a
|
|
||||||
e =
|
|
||||||
DEFS =
|
|
||||||
INCLUDES =
|
|
||||||
LIBDIRS =
|
|
||||||
DOS_LDLIBS =
|
|
||||||
DOS_LIBDIRS =
|
|
||||||
|
|
||||||
# CC defaults
|
|
||||||
CC = INVALID_TARGET_CC
|
|
||||||
CCARCH =
|
|
||||||
CFLAGS =
|
|
||||||
CFLAGS_OUTPUT =
|
|
||||||
|
|
||||||
# CXX defaults
|
|
||||||
CXX = $(CC)
|
|
||||||
CXXARCH = $(CCARCH)
|
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
CXXFLAGS_OUTPUT = $(CFLAGS_OUTPUT)
|
|
||||||
|
|
||||||
# CXXLD defaults
|
|
||||||
CXXLD = $(CXX)
|
|
||||||
CXXLDARCH = $(CXXARCH)
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT =
|
|
||||||
LDLIBS =
|
|
||||||
LINK_EXE_LDFLAGS =
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
DEFS += -DDEBUG
|
|
||||||
## DEFS += -DTESTING
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // compression libraries
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
DOS_LDLIBS += zlib.lib
|
|
||||||
ZLIBDIR:=$(strip $(subst \,/,$(ZLIBDIR)))
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR))),)
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR)/include/zlib.h)),)
|
|
||||||
INCLUDES += -I$(ZLIBDIR)/include
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR)/src/zlib.h)),)
|
|
||||||
INCLUDES += -I$(ZLIBDIR)/src
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR)/zlib.h)),)
|
|
||||||
INCLUDES += -I$(ZLIBDIR)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
UCLDIR:=$(strip $(subst \,/,$(UCLDIR)))
|
|
||||||
NRVDIR:=$(strip $(subst \,/,$(NRVDIR)))
|
|
||||||
u = ucl
|
|
||||||
U = UCL
|
|
||||||
upx_exe_tail =
|
|
||||||
include $(srcdir)/Makedefs.inc
|
|
||||||
ifneq ($(strip $(wildcard $(NRVDIR)/include/nrv)),)
|
|
||||||
u = nrv
|
|
||||||
U = NRV
|
|
||||||
upx_exe_tail := _$(u)
|
|
||||||
include $(srcdir)/Makedefs.inc
|
|
||||||
endif
|
|
||||||
upx_exe = upx$(upx_exe_tail)$(e)
|
|
||||||
|
|
||||||
override tmp := -Wl,--rpath,
|
|
||||||
LDRPATH := $(addprefix $(tmp),$(LIBDIRS))
|
|
||||||
LIBDIRS += .
|
|
||||||
LDLIBDIRS := $(addprefix -L,$(LIBDIRS))
|
|
||||||
|
|
||||||
##LDFLAGS += $(LDRPATH)
|
|
||||||
LDFLAGS += $(LDLIBDIRS)
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // compiler settings
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
###
|
|
||||||
### generic gcc
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),gcc)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux - gcc
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
override arch := $(shell uname -m | sed -e 's/^i[3456789]86$$/i386/')
|
|
||||||
ifeq ($(arch),i386)
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
endif
|
|
||||||
DEFS += -D_FILE_OFFSET_BITS=64
|
|
||||||
LDLIBS += -lmcheck
|
|
||||||
##CFLAGS_WERROR = -Werror
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
else
|
|
||||||
##LDFLAGS += -static
|
|
||||||
STUBEDIT_EXE = objcopy -S -R .comment -R .note $@
|
|
||||||
ifeq ($(arch),i386)
|
|
||||||
## STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
CHMOD_EXE = chmod 755 $@
|
|
||||||
endif # linux
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux/i386 - Borland C++ 5.7 (Kylix 3)
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux-bc57)
|
|
||||||
##DEPMODE := linux-XXX ## FIXME
|
|
||||||
CC = bc++ -q -3
|
|
||||||
CFLAGS = -w '-w!'
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS += -ls
|
|
||||||
LINK_EXE_OUTPUT = -e$@
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
# warning: do not use option `-d' --> incorrect string merging will happen
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -dc
|
|
||||||
else
|
|
||||||
CFLAGS += -O2 -dc
|
|
||||||
endif
|
|
||||||
# transform `-lxx -lyy' into `libxx.a libyy.a'
|
|
||||||
LDLIBS := $(shell echo "$(LDLIBS)" | perl -pe 's/-l(.+?)\b/lib\1.a/g')
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux/i386 - Intel C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux-intelc)
|
|
||||||
DEPMODE := linux-intelc
|
|
||||||
CC = icc
|
|
||||||
CXX = icpc
|
|
||||||
CCARCH += -march=i386 -mcpu=i686 -nolib_inline
|
|
||||||
DEFS += -D_FILE_OFFSET_BITS=64
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
CFLAGS = $(CFLAGS_WERROR)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -g -O0
|
|
||||||
else
|
|
||||||
CFLAGS += -O2
|
|
||||||
endif
|
|
||||||
LDFLAGS += -Wl,-Map,$T.map
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux/i386 - Portland Group PGI C++ 5.x
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux-pgi)
|
|
||||||
DEPMODE := linux-pgi
|
|
||||||
CC = pgcc
|
|
||||||
CXX = pgCC
|
|
||||||
CCARCH += -tp=p6
|
|
||||||
DEFS += -D_FILE_OFFSET_BITS=64
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
##CFLAGS += -Minform=info
|
|
||||||
CXXFLAGS = $(CFLAGS) -tused
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
else
|
|
||||||
CFLAGS += -O2
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### Linux cross compilers
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),cross-amd64-linux)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
CC = x86_64-linux-gcc
|
|
||||||
CXX = x86_64-linux-g++
|
|
||||||
LDLIBS += -lmcheck
|
|
||||||
endif # cross-amd64-linux
|
|
||||||
|
|
||||||
ifeq ($(target),cross-m68k-linux)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
CC = m68k-linux-gcc
|
|
||||||
CXX = m68k-linux-g++
|
|
||||||
##LDLIBS += -lmcheck
|
|
||||||
endif # cross-m68k-linux
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### sparc-sun-solaris2.8
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),sparc-sun-solaris)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### Atari cross compilers
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),cross-mint)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .ttp
|
|
||||||
CC = m68k-atari-mint-gcc
|
|
||||||
CXX = m68k-atari-mint-g++
|
|
||||||
CCARCH += -m68000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),cross-mint-m68040)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .ttp
|
|
||||||
CC = m68k-atari-mint-gcc
|
|
||||||
CXX = m68k-atari-mint-g++
|
|
||||||
CCARCH += -m68040
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),cross-mint-m68020-60)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .ttp
|
|
||||||
CC = m68k-atari-mint-gcc
|
|
||||||
CXX = m68k-atari-mint-g++
|
|
||||||
CCARCH += -m68020-60 -m68881
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### dos32 - djgpp2 / emx
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),dos32-djgpp2)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CXX = gxx
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
CFLAGS_WERROR = -Werror
|
|
||||||
STUBEDIT_EXE = stubedit $@ bufsize=0xfc00
|
|
||||||
ifneq ($(strip $(wildcard $(DJDIR)/bin/mfxdjstubify.ex[eE])),)
|
|
||||||
ifneq ($(strip $(wildcard $(DJDIR)/bin/cwsdstub.ex[eE])),)
|
|
||||||
STUBIFY_EXE = mfxdjstubify -v -s $(DJDIR)/bin/cwsdstub.exe $@
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),dos32-emx)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CXX = gcc
|
|
||||||
CFLAGS_O = -O2
|
|
||||||
CCARCH += -mno-probe
|
|
||||||
LDFLAGS = -L. -s
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - cygwin / mingw32 / rsxnt
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-cygwin)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
##CXX = g++-2
|
|
||||||
e = .exe
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
LDLIBS += -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),win32-mingw32)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
LDLIBS += -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
# mingw32 cross compiler
|
|
||||||
ifeq ($(target),cross-mingw32)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CC = i586-mingw32msvc-gcc
|
|
||||||
CXX = i586-mingw32msvc-g++
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
LDLIBS += -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
# rsxnt (g++ 2.8.1)
|
|
||||||
ifeq ($(target),win32-rsxnt)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CXX = gcc
|
|
||||||
CFLAGS_O = -O2
|
|
||||||
CCARCH += -Zwin32 -Zsys -mno-probe
|
|
||||||
LDFLAGS = -L. -s
|
|
||||||
STUBEDIT_EXE = pestack -s1024 -c1024 $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Borland C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-bc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = bcc32 -3
|
|
||||||
ifeq ($(UPX_BROKEN_INCLUDES),1)
|
|
||||||
ifneq ($(srcdir),.)
|
|
||||||
INCLUDES += -I$(srcdir)
|
|
||||||
endif
|
|
||||||
INCLUDES += -I$(srcdir)/acc
|
|
||||||
ifneq ($(strip $(wildcard $(srcdir)/filter)),)
|
|
||||||
INCLUDES += -I$(srcdir)/filter
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
CFLAGS = -w -w-inl -g1
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS = -ls
|
|
||||||
LINK_EXE_OUTPUT = -e$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -d
|
|
||||||
else
|
|
||||||
CFLAGS += -O2 -d
|
|
||||||
endif
|
|
||||||
endif # win32-bc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Digital Mars C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-dm)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = dmc -mn
|
|
||||||
CFLAGS = -w- -wx
|
|
||||||
CXXFLAGS = $(CFLAGS) -Aa -Ab -Ae -Ar
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS = -L/map
|
|
||||||
LINK_EXE_OUTPUT = -o$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -o- -g -s
|
|
||||||
else
|
|
||||||
CFLAGS += -o
|
|
||||||
endif
|
|
||||||
endif # win32-dm
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Intel C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-ic)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = icl -nologo
|
|
||||||
CFLAGS = -W3 -WX
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,2)
|
|
||||||
# statically link libc.lib
|
|
||||||
CC += -ML
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win32-ic
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Metrowerks C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-mwerks)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = mwcc -gccinc
|
|
||||||
CFLAGS = -w on
|
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LDFLAGS = -lwinmm.lib -map $T.map
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -opt full
|
|
||||||
else
|
|
||||||
CFLAGS +=
|
|
||||||
endif
|
|
||||||
endif # win32-mwerks
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Symantec C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-sc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = sc -mn
|
|
||||||
CFLAGS = -w- -wx
|
|
||||||
CXXFLAGS = $(CFLAGS) -EH -ER
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS = -L/map
|
|
||||||
LINK_EXE_OUTPUT = -o$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -o- -g -s
|
|
||||||
else
|
|
||||||
CFLAGS += -o
|
|
||||||
endif
|
|
||||||
endif # win32-sc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Visual C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-vc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = cl -nologo
|
|
||||||
CFLAGS = -W4 -WX
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,1)
|
|
||||||
# statically link libc.lib
|
|
||||||
CC += -ML
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
##LINK_EXE_LDFLAGS += /opt:nowin98
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win32-vc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Watcom C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-wc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = wcl386 -zq -bt=nt -mf -5r
|
|
||||||
##CC = wcl386 -zq -bt=dos -l=CauseWay -mf -5r
|
|
||||||
CFLAGS = -zc -w5 -we
|
|
||||||
CXXFLAGS = $(CFLAGS) -xs -xr
|
|
||||||
CFLAGS_OUTPUT = -fo=$@
|
|
||||||
LDFLAGS = -k0x100000 -fm
|
|
||||||
LINK_EXE_OUTPUT = -fe=$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
CC_SRC = $(subst /,\\,$<)
|
|
||||||
CXX_SRC = $(subst /,\\,$<)
|
|
||||||
INCLUDES := $(strip $(subst /,\\,$(INCLUDES)))
|
|
||||||
ifeq (1,2)
|
|
||||||
WCL386 := $(INCLUDES)
|
|
||||||
export WCL386
|
|
||||||
INCLUDES :=
|
|
||||||
endif
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS +=
|
|
||||||
else
|
|
||||||
# note: it seems that the optimizer is generating bad code with `-ox'
|
|
||||||
CFLAGS += -olr
|
|
||||||
endif
|
|
||||||
endif # win32-wc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win64 - Intel C++ [Itanium]
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win64-ic)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = ecl -nologo
|
|
||||||
CFLAGS = -W3
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,2)
|
|
||||||
# statically link libc.lib
|
|
||||||
CC += -ML
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win64-ic
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win64 - Visual C++ [AMD64 or Itanium]
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win64-vc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = cl -nologo
|
|
||||||
CFLAGS = -W4
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,1)
|
|
||||||
# statically link libc.lib
|
|
||||||
CC += -ML
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win64-vc
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // malloc debuggers and memory checkers - obsolete, use valgrind
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
# compile in extra valgrind support
|
|
||||||
DEFS += -DWITH_VALGRIND
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
LDLIBS += -lefence
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
DEFS += -DWITH_DMALLOC
|
|
||||||
LDLIBS += -ldmalloc
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
DEFS += -DWITH_GC -DLINUX_THREADS -D_REENTRANT
|
|
||||||
LDLIBS += -lgc -lpthread
|
|
||||||
# only needed when using -static:
|
|
||||||
##LDFLAGS += -Wl,-defsym,_DYNAMIC=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // main targets
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
-include ./Makefile.local
|
|
||||||
|
|
||||||
all: $(upx_exe)
|
|
||||||
|
|
||||||
$(upx_exe): $(OBJECTS) $(LIBS) $(RESOURCES)
|
|
||||||
$(strip $(CXX_LINK_EXE))
|
|
||||||
$(strip $(STUBEDIT_EXE))
|
|
||||||
$(strip $(STUBIFY_EXE))
|
|
||||||
$(strip $(CHMOD_EXE))
|
|
||||||
|
|
||||||
mostlyclean:
|
|
||||||
-rm -f *.d *.err *.i *.log *.map gdb-trans*
|
|
||||||
|
|
||||||
clean: mostlyclean
|
|
||||||
-rm -f *.a *.lib *.o *.obj *.res *.tds tags TAGS ID
|
|
||||||
-rm -f *.idb *.pdb
|
|
||||||
-rm -f $(upx_exe) upx upx.exe upx.ttp upx_nrv upx_nrv.exe upx_nrv.ttp upx_ucl upx_ucl.exe upx_ucl.ttp
|
|
||||||
-rm -rf .deps _deps
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
|
|
||||||
maintainer-clean: distclean
|
|
||||||
|
|
||||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // rules
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
%$o : %.c
|
|
||||||
$(strip $(CC_COMPILE))
|
|
||||||
|
|
||||||
%$o : %.cpp
|
|
||||||
$(strip $(CXX_COMPILE))
|
|
||||||
|
|
||||||
%.res : %.rc
|
|
||||||
rc -l 0x409 -fo$@ $<
|
|
||||||
|
|
||||||
|
|
||||||
# vi:nowrap
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
GNUmakefile
|
|
||||||
@@ -1,340 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
this service if you wish), that you receive source code or can get it
|
|
||||||
if you want it, that you can change the software or use pieces of it
|
|
||||||
in new free programs; and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. You must make sure that they, too, receive or can get the
|
|
||||||
source code. And you must show them these terms so they know their
|
|
||||||
rights.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
|
||||||
source code, which must be distributed under the terms of Sections
|
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, complete source
|
|
||||||
code means all the source code for all modules it contains, plus any
|
|
||||||
associated interface definition files, plus the scripts used to
|
|
||||||
control compilation and installation of the executable. However, as a
|
|
||||||
special exception, the source code distributed need not include
|
|
||||||
anything that is normally distributed (in either source or binary
|
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
|
||||||
operating system on which the executable runs, unless that component
|
|
||||||
itself accompanies the executable.
|
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
|
||||||
access to copy from a designated place, then offering equivalent
|
|
||||||
access to copy the source code from the same place counts as
|
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
|
||||||
these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system, which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies a version number of this License which applies to it and "any
|
|
||||||
later version", you have the option of following the terms and conditions
|
|
||||||
either of that version or of any later version published by the Free
|
|
||||||
Software Foundation. If the Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, write to the author
|
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) 19yy <name of author>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
|
||||||
when it starts in an interactive mode:
|
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Library General
|
|
||||||
Public License instead of this License.
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Possible configuration values:
|
|
||||||
*
|
|
||||||
* ACC_CONFIG_NO_HEADER
|
|
||||||
* ACC_CONFIG_HEADER if given, then use this as <config.h>
|
|
||||||
* ACC_CONFIG_INCLUDE include path to acc_ files
|
|
||||||
*
|
|
||||||
* ACC_CONFIG_PREFER___INT64 [acc_type.h]
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ACC_H_INCLUDED
|
|
||||||
#define __ACC_H_INCLUDED 1
|
|
||||||
|
|
||||||
#define ACC_VERSION 20040623L
|
|
||||||
|
|
||||||
#if !defined(ACC_CONFIG_INCLUDE)
|
|
||||||
# define ACC_CONFIG_INCLUDE(file) file
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
|
||||||
# define __CYGWIN__ __CYGWIN32__
|
|
||||||
#endif
|
|
||||||
#if defined(__IBMCPP__) && !defined(__IBMC__)
|
|
||||||
# define __IBMC__ __IBMCPP__
|
|
||||||
#endif
|
|
||||||
#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
|
|
||||||
# define __INTEL_COMPILER __ICL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* disable pedantic warnings for undefined preprocessing symbols */
|
|
||||||
#if defined(__INTEL_COMPILER) && defined(__linux__)
|
|
||||||
# pragma warning(disable: 193)
|
|
||||||
#endif
|
|
||||||
#if defined(__KEIL__) && defined(__C166__)
|
|
||||||
# pragma warning disable = 322
|
|
||||||
#elif 0 && defined(__C251__)
|
|
||||||
# pragma warning disable = 322
|
|
||||||
#endif
|
|
||||||
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
|
|
||||||
# if (_MSC_VER >= 1300)
|
|
||||||
# pragma warning(disable: 4668)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if 0 && defined(__WATCOMC__)
|
|
||||||
# if (__WATCOMC__ < 1060)
|
|
||||||
# pragma warning 203 9
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_init.h")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_os.h")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_cc.h")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_arch.h")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_mm.h")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_defs.h")
|
|
||||||
|
|
||||||
#if defined(ACC_CONFIG_NO_HEADER)
|
|
||||||
#elif defined(ACC_CONFIG_HEADER)
|
|
||||||
# include ACC_CONFIG_HEADER
|
|
||||||
#else
|
|
||||||
# include ACC_CONFIG_INCLUDE("acc_auto.h")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include ACC_CONFIG_INCLUDE("acc_type.h")
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* CPU architecture - exactly one of:
|
|
||||||
*
|
|
||||||
* ACC_ARCH_UNKNOWN [default]
|
|
||||||
* ACC_ARCH_ALPHA
|
|
||||||
* ACC_ARCH_AMD64 aka x86-64 or ia32e
|
|
||||||
* ACC_ARCH_C166
|
|
||||||
* ACC_ARCH_IA16 Intel Architecture (8088, 8086, 80186, 80286)
|
|
||||||
* ACC_ARCH_IA32 Intel Architecture (80386+)
|
|
||||||
* ACC_ARCH_IA64 Intel Architecture (Itanium)
|
|
||||||
* ACC_ARCH_M68K Motorola 680x0
|
|
||||||
* ACC_ARCH_MCS251
|
|
||||||
* ACC_ARCH_MCS51
|
|
||||||
* ACC_ARCH_PPC64 Power PC
|
|
||||||
* ACC_ARCH_SPARC64
|
|
||||||
*
|
|
||||||
* Optionally define one of:
|
|
||||||
* ACC_ENDIAN_LITTLE_ENDIAN
|
|
||||||
* ACC_ENDIAN_BIG_ENDIAN
|
|
||||||
*
|
|
||||||
* Note that this list is not exhaustive - actually we only really care
|
|
||||||
* about architectures which allow unaligned memory access at reasonable
|
|
||||||
* speed (for the moment this means IA16, IA32 and AMD64).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
|
|
||||||
# define ACC_ARCH_IA16 1
|
|
||||||
# define ACC_INFO_ARCH "ia16"
|
|
||||||
#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
|
|
||||||
# define ACC_ARCH_AMD64 1
|
|
||||||
# define ACC_INFO_ARCH "amd64"
|
|
||||||
#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
|
|
||||||
# define ACC_ARCH_AVR 1
|
|
||||||
# define ACC_INFO_ARCH "avr"
|
|
||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__C166__)
|
|
||||||
# define ACC_ARCH_C166 1
|
|
||||||
# define ACC_INFO_ARCH "c166"
|
|
||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__C251__)
|
|
||||||
# define ACC_ARCH_MCS251 1
|
|
||||||
# define ACC_INFO_ARCH "mcs-251"
|
|
||||||
#elif (UINT_MAX == ACC_0xffffL) && defined(__C51__)
|
|
||||||
# define ACC_ARCH_MCS51 1
|
|
||||||
# define ACC_INFO_ARCH "mcs-51"
|
|
||||||
#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
|
|
||||||
# define ACC_ARCH_IA32 1
|
|
||||||
# define ACC_INFO_ARCH "ia32"
|
|
||||||
#elif (ACC_CC_ZORTECHC && defined(__I86__))
|
|
||||||
# define ACC_ARCH_IA32 1
|
|
||||||
# define ACC_INFO_ARCH "ia32"
|
|
||||||
#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
|
|
||||||
# define ACC_ARCH_IA64 1
|
|
||||||
# define ACC_INFO_ARCH "ia64"
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) && defined(_I386)
|
|
||||||
# define ACC_ARCH_IA32 1
|
|
||||||
# define ACC_INFO_ARCH "ia32"
|
|
||||||
#elif (ACC_OS_DOS32 || ACC_OS_OS2)
|
|
||||||
# error "missing define for CPU architecture"
|
|
||||||
#elif (ACC_OS_WIN32)
|
|
||||||
# error "missing define for CPU architecture"
|
|
||||||
#elif (ACC_OS_WIN64)
|
|
||||||
/* # error "missing define for CPU architecture" */
|
|
||||||
#elif (ACC_OS_TOS) || defined(__m68000__)
|
|
||||||
# define ACC_ARCH_M68K 1
|
|
||||||
# define ACC_INFO_ARCH "m68k"
|
|
||||||
#elif defined(__alpha__) || defined(__alpha)
|
|
||||||
# define ACC_ARCH_ALPHA 1
|
|
||||||
# define ACC_INFO_ARCH "alpha"
|
|
||||||
#elif defined(__ppc64__) || defined(__ppc64)
|
|
||||||
# define ACC_ARCH_PPC64 1
|
|
||||||
# define ACC_INFO_ARCH "ppc64"
|
|
||||||
#elif defined(__sparc64__) || defined(__sparc64)
|
|
||||||
# define ACC_ARCH_SPARC64 1
|
|
||||||
# define ACC_INFO_ARCH "sparc64"
|
|
||||||
#else
|
|
||||||
# define ACC_ARCH_UNKNOWN 1
|
|
||||||
# define ACC_INFO_ARCH "unknown"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA16 || ACC_ARCH_IA32)
|
|
||||||
# define ACC_ENDIAN_LITTLE_ENDIAN 1
|
|
||||||
# define ACC_INFO_ENDIAN "little-endian"
|
|
||||||
#elif (ACC_ARCH_M68K)
|
|
||||||
# define ACC_ENDIAN_BIG_ENDIAN 1
|
|
||||||
# define ACC_INFO_ENDIAN "big-endian"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_ARCH_IA16)
|
|
||||||
# if (UINT_MAX != ACC_0xffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
# if (ULONG_MAX != ACC_0xffffffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if (ACC_ARCH_IA32)
|
|
||||||
# if (UINT_MAX != ACC_0xffffffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
# if (ULONG_MAX != ACC_0xffffffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,652 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Possible configuration values:
|
|
||||||
*
|
|
||||||
* ACC_CONFIG_AUTO_NO_HEADERS
|
|
||||||
* ACC_CONFIG_AUTO_NO_FUNCTIONS
|
|
||||||
* ACC_CONFIG_AUTO_NO_SIZES
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// Checks for <stdint.h>
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(ACC_CONFIG_AUTO_NO_HEADERS)
|
|
||||||
|
|
||||||
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
|
|
||||||
# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
|
|
||||||
# define HAVE_STDINT_H 1
|
|
||||||
# endif
|
|
||||||
#elif defined(__dietlibc__)
|
|
||||||
# undef HAVE_STDINT_H /* incomplete */
|
|
||||||
#elif (ACC_CC_BORLANDC) && (__BORLANDC__ >= 0x560)
|
|
||||||
# undef HAVE_STDINT_H /* broken & incomplete */
|
|
||||||
#elif (ACC_CC_DMC) && (__DMC__ >= 0x825)
|
|
||||||
# define HAVE_STDINT_H 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_STDINT_H
|
|
||||||
# include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !defined(ACC_CONFIG_AUTO_NO_HEADERS) */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// Checks for header files
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(ACC_CONFIG_AUTO_NO_HEADERS)
|
|
||||||
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
#define HAVE_ASSERT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_DIRENT_H 1
|
|
||||||
#define HAVE_ERRNO_H 1
|
|
||||||
#define HAVE_FCNTL_H 1
|
|
||||||
#define HAVE_LIMITS_H 1
|
|
||||||
#define HAVE_MALLOC_H 1
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
#define HAVE_SETJMP_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDDEF_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_TIME_H 1
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
#define HAVE_UTIME_H 1
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
#define HAVE_SYS_TIME_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
#undef HAVE_ALLOCA_H
|
|
||||||
#undef HAVE_CONIO_H
|
|
||||||
#undef HAVE_DIRECT_H
|
|
||||||
#undef HAVE_DOS_H
|
|
||||||
#undef HAVE_IO_H
|
|
||||||
#undef HAVE_SHARE_H
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
#undef HAVE_SYS_UTIME_H
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_POSIX)
|
|
||||||
# define HAVE_STRINGS_H 1
|
|
||||||
# if (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_OPENBSD)
|
|
||||||
# undef HAVE_MALLOC_H /* deprecated */
|
|
||||||
# elif (ACC_OS_POSIX_HPUX)
|
|
||||||
# define HAVE_ALLOCA_H 1
|
|
||||||
# endif
|
|
||||||
# if (ACC_OS_POSIX_MACOSX && ACC_CC_MWERKS) && defined(__MSL__)
|
|
||||||
/* FIXME ??? */
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# undef HAVE_SYS_TYPES_H
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_CYGWIN)
|
|
||||||
# define HAVE_IO_H 1
|
|
||||||
#elif (ACC_OS_EMX)
|
|
||||||
# define HAVE_ALLOCA_H 1
|
|
||||||
# define HAVE_IO_H 1
|
|
||||||
#elif (ACC_OS_TOS && ACC_CC_GNUC)
|
|
||||||
# if !defined(__MINT__)
|
|
||||||
# undef HAVE_MALLOC_H
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_FCNTL_H
|
|
||||||
# undef HAVE_MALLOC_H
|
|
||||||
# undef HAVE_MEMORY_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_STAT_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# undef HAVE_SYS_TYPES_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* DOS, OS/2 & Windows */
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
|
|
||||||
#define HAVE_CONIO_H 1
|
|
||||||
#define HAVE_DIRECT_H 1
|
|
||||||
#define HAVE_DOS_H 1
|
|
||||||
#define HAVE_IO_H 1
|
|
||||||
#define HAVE_SHARE_H 1
|
|
||||||
|
|
||||||
#if (ACC_CC_AZTECC)
|
|
||||||
# undef HAVE_CONIO_H
|
|
||||||
# undef HAVE_DIRECT_H
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_MALLOC_H
|
|
||||||
# undef HAVE_SHARE_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_STAT_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# undef HAVE_SYS_TYPES_H
|
|
||||||
#elif (ACC_CC_BORLANDC)
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# if (ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# undef HAVE_DIRENT_H /* pulls in <windows.h>; use <dir.h> instead */
|
|
||||||
# endif
|
|
||||||
# if (__BORLANDC__ < 0x0400)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_DMC)
|
|
||||||
# undef HAVE_DIRENT_H /* not working */
|
|
||||||
# undef HAVE_UNISTD_H /* not working */
|
|
||||||
# define HAVE_SYS_DIRENT_H 1
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
|
|
||||||
# define HAVE_ALLOCA_H 1
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
#elif (ACC_CC_IBMC && ACC_OS_OS2)
|
|
||||||
# undef HAVE_DOS_H
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# define HAVE_SYS_UTIME_H 1
|
|
||||||
#elif (ACC_CC_INTELC || ACC_CC_MSC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# define HAVE_SYS_UTIME_H 1
|
|
||||||
#elif (ACC_CC_LCC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_DOS_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# define HAVE_SYS_UTIME_H 1
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
|
|
||||||
# define HAVE_ALLOCA_H 1
|
|
||||||
# undef HAVE_DOS_H
|
|
||||||
# undef HAVE_SHARE_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
#elif (ACC_CC_NDPC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_DOS_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
#elif (ACC_CC_PACIFICC)
|
|
||||||
# undef HAVE_DIRECT_H
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_FCNTL_H
|
|
||||||
# undef HAVE_IO_H
|
|
||||||
# undef HAVE_MALLOC_H
|
|
||||||
# undef HAVE_MEMORY_H
|
|
||||||
# undef HAVE_SHARE_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_STAT_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# undef HAVE_SYS_TYPES_H
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_DOS_H
|
|
||||||
# undef HAVE_MALLOC_H
|
|
||||||
# undef HAVE_SHARE_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# if (__POCC__ < 280)
|
|
||||||
# else
|
|
||||||
# define HAVE_SYS_UTIME_H 1
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# define HAVE_SYS_UTIME_H 1
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
#elif (ACC_CC_SYMANTECC)
|
|
||||||
# undef HAVE_DIRENT_H /* opendir() not implemented in libc */
|
|
||||||
# undef HAVE_UNISTD_H /* not working */
|
|
||||||
# if (__SC__ < 0x700)
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_TOPSPEEDC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_STAT_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# undef HAVE_SYS_TYPES_H
|
|
||||||
#elif (ACC_CC_TURBOC)
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# undef HAVE_SYS_TYPES_H /* useless */
|
|
||||||
# if (ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# undef HAVE_DIRENT_H /* pulls in <windows.h>; use <dir.h> instead */
|
|
||||||
# endif
|
|
||||||
# if (__TURBOC__ < 0x0200)
|
|
||||||
# undef HAVE_SIGNAL_H /* not working */
|
|
||||||
# endif
|
|
||||||
# if (__TURBOC__ < 0x0400)
|
|
||||||
# undef HAVE_DIRECT_H
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_MALLOC_H
|
|
||||||
# undef HAVE_MEMORY_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_WATCOMC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
# define HAVE_SYS_UTIME_H 1
|
|
||||||
# if (__WATCOMC__ < 950)
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_ZORTECHC)
|
|
||||||
# undef HAVE_DIRENT_H
|
|
||||||
# undef HAVE_MEMORY_H
|
|
||||||
# undef HAVE_UNISTD_H
|
|
||||||
# undef HAVE_UTIME_H
|
|
||||||
# undef HAVE_SYS_TIME_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* DOS, OS/2 & Windows */
|
|
||||||
|
|
||||||
|
|
||||||
#if (HAVE_SYS_TIME_H && HAVE_TIME_H)
|
|
||||||
# define TIME_WITH_SYS_TIME 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !defined(ACC_CONFIG_AUTO_NO_HEADERS) */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// Checks for library functions
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(ACC_CONFIG_AUTO_NO_FUNCTIONS)
|
|
||||||
|
|
||||||
#define HAVE_ACCESS 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_ATEXIT 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOL 1
|
|
||||||
#define HAVE_CHMOD 1
|
|
||||||
#define HAVE_CHOWN 1
|
|
||||||
#define HAVE_CTIME 1
|
|
||||||
#define HAVE_DIFFTIME 1
|
|
||||||
#define HAVE_FILENO 1
|
|
||||||
#define HAVE_FSTAT 1
|
|
||||||
#define HAVE_GETTIMEOFDAY 1
|
|
||||||
#define HAVE_GMTIME 1
|
|
||||||
#define HAVE_LOCALTIME 1
|
|
||||||
#define HAVE_LONGJMP 1
|
|
||||||
#define HAVE_LSTAT 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MKTIME 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_RAISE 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_SIGNAL 1
|
|
||||||
#define HAVE_SNPRINTF 1
|
|
||||||
#define HAVE_STAT 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRERROR 1
|
|
||||||
#define HAVE_STRFTIME 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_TIME 1
|
|
||||||
#define HAVE_UMASK 1
|
|
||||||
#define HAVE_UTIME 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
|
|
||||||
#if (ACC_OS_BEOS || ACC_OS_CYGWIN || ACC_OS_POSIX || ACC_OS_QNX)
|
|
||||||
# define HAVE_STRCASECMP 1
|
|
||||||
# define HAVE_STRNCASECMP 1
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
# define HAVE_STRCASECMP 1
|
|
||||||
# define HAVE_STRNCASECMP 1
|
|
||||||
#else
|
|
||||||
# define HAVE_STRICMP 1
|
|
||||||
# define HAVE_STRNICMP 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_POSIX)
|
|
||||||
# if (ACC_CC_TINYC)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# elif defined(__dietlibc__)
|
|
||||||
# endif
|
|
||||||
# if (ACC_OS_POSIX_MACOSX && ACC_CC_MWERKS) && defined(__MSL__)
|
|
||||||
/* FIXME ??? */
|
|
||||||
# undef HAVE_CHOWN
|
|
||||||
# undef HAVE_LSTAT
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_CYGWIN)
|
|
||||||
# if (ACC_CC_GNUC < 0x025a00ul)
|
|
||||||
# undef HAVE_GETTIMEOFDAY
|
|
||||||
# undef HAVE_LSTAT
|
|
||||||
# endif
|
|
||||||
# if (ACC_CC_GNUC < 0x025f00ul)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_EMX)
|
|
||||||
# undef HAVE_CHOWN
|
|
||||||
# undef HAVE_LSTAT
|
|
||||||
#elif (ACC_OS_TOS && ACC_CC_GNUC)
|
|
||||||
# if !defined(__MINT__)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# undef HAVE_ACCESS
|
|
||||||
# undef HAVE_CHMOD
|
|
||||||
# undef HAVE_CHOWN
|
|
||||||
# undef HAVE_FSTAT
|
|
||||||
# undef HAVE_GETTIMEOFDAY
|
|
||||||
# undef HAVE_LSTAT
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_UMASK
|
|
||||||
# undef HAVE_UTIME
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* DOS, OS/2 & Windows */
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
|
|
||||||
#undef HAVE_CHOWN
|
|
||||||
#undef HAVE_GETTIMEOFDAY
|
|
||||||
#undef HAVE_LSTAT
|
|
||||||
#undef HAVE_UMASK
|
|
||||||
|
|
||||||
#if (ACC_CC_AZTECC)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# undef HAVE_DIFFTIME /* difftime() is in the math library */
|
|
||||||
# undef HAVE_FSTAT
|
|
||||||
# undef HAVE_STRDUP /* missing in 5.2a */
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_UTIME /* struct utimbuf is missing */
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_CC_BORLANDC)
|
|
||||||
# if (__BORLANDC__ < 0x0400)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# undef HAVE_UTIME
|
|
||||||
# endif
|
|
||||||
# if ((__BORLANDC__ < 0x0410) && ACC_OS_WIN16)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# endif
|
|
||||||
# if (__BORLANDC__ < 0x0550)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_DMC)
|
|
||||||
# if (ACC_OS_WIN16)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# endif
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_CC_IBMC)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_CC_INTELC)
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
#elif (ACC_CC_LCC)
|
|
||||||
# define utime _utime
|
|
||||||
#elif (ACC_CC_MSC)
|
|
||||||
# if (_MSC_VER < 600)
|
|
||||||
# undef HAVE_STRFTIME
|
|
||||||
# endif
|
|
||||||
# if (_MSC_VER < 700)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# else
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
# endif
|
|
||||||
# if ((_MSC_VER < 800) && ACC_OS_WIN16)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# endif
|
|
||||||
# if (_MSC_VER < 1000) && defined(__cplusplus)
|
|
||||||
# undef HAVE_SETJMP
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
|
|
||||||
# if (ACC_CC_GNUC < 0x025f00ul)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# else
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
|
|
||||||
# if (__MSL__ < 0x8000ul)
|
|
||||||
# undef HAVE_CHMOD /* <unix.h> which in turn pulls in <windows.h> */
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_NDPC)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_STRNICMP
|
|
||||||
# undef HAVE_UTIME
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# if defined(__cplusplus)
|
|
||||||
# undef HAVE_STAT
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_PACIFICC)
|
|
||||||
# undef HAVE_ACCESS
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# undef HAVE_CHMOD
|
|
||||||
# undef HAVE_DIFFTIME
|
|
||||||
# undef HAVE_FSTAT
|
|
||||||
# undef HAVE_MKTIME
|
|
||||||
# undef HAVE_RAISE
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_STRFTIME
|
|
||||||
# undef HAVE_UTIME
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
|
|
||||||
# if (__POCC__ < 280)
|
|
||||||
# define alloca _alloca
|
|
||||||
# undef HAVE_UTIME
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_CC_SYMANTECC)
|
|
||||||
# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# endif
|
|
||||||
# if (__SC__ < 0x600)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# else
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
# endif
|
|
||||||
# if (__SC__ < 0x700)
|
|
||||||
# undef HAVE_DIFFTIME /* difftime() is broken */
|
|
||||||
# undef HAVE_UTIME /* struct utimbuf is missing */
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_TOPSPEEDC)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#elif (ACC_CC_TURBOC)
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# if (__TURBOC__ < 0x0200)
|
|
||||||
# undef HAVE_RAISE
|
|
||||||
# undef HAVE_SIGNAL
|
|
||||||
# endif
|
|
||||||
# if (__TURBOC__ < 0x0295)
|
|
||||||
# undef HAVE_MKTIME
|
|
||||||
# undef HAVE_STRFTIME
|
|
||||||
# endif
|
|
||||||
# if (__TURBOC__ < 0x0400)
|
|
||||||
# undef HAVE_UTIME
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_WATCOMC)
|
|
||||||
# if (__WATCOMC__ < 1100)
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
# else
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_ZORTECHC)
|
|
||||||
# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
|
|
||||||
# undef HAVE_ALLOCA
|
|
||||||
# endif
|
|
||||||
# undef HAVE_DIFFTIME /* difftime() is broken */
|
|
||||||
# undef HAVE_SNPRINTF
|
|
||||||
# undef HAVE_UTIME /* struct utimbuf is missing */
|
|
||||||
# undef HAVE_VSNPRINTF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* DOS, OS/2 & Windows */
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* !defined(ACC_CONFIG_AUTO_NO_FUNCTIONS) */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// Checks for sizes
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(ACC_CONFIG_AUTO_NO_SIZES)
|
|
||||||
|
|
||||||
#define SIZEOF_SHORT (__ACC_SHORT_BIT / 8)
|
|
||||||
#define SIZEOF_INT (__ACC_INT_BIT / 8)
|
|
||||||
#define SIZEOF_LONG (__ACC_LONG_BIT / 8)
|
|
||||||
|
|
||||||
#if (ACC_OS_WIN64) /* LLP64 programming model */
|
|
||||||
# define SIZEOF_PTRDIFF_T 8
|
|
||||||
# define SIZEOF_SIZE_T 8
|
|
||||||
# define SIZEOF_VOID_P 8
|
|
||||||
#elif (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
|
|
||||||
# define SIZEOF_SIZE_T 2
|
|
||||||
# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
# define SIZEOF_VOID_P 2
|
|
||||||
# elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
# define SIZEOF_VOID_P 4
|
|
||||||
# else
|
|
||||||
# error "ACC_MM"
|
|
||||||
# endif
|
|
||||||
# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
# define SIZEOF_PTRDIFF_T 2
|
|
||||||
# elif (ACC_MM_COMPACT || ACC_MM_LARGE)
|
|
||||||
# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
# define SIZEOF_PTRDIFF_T 4
|
|
||||||
# else
|
|
||||||
# define SIZEOF_PTRDIFF_T 2
|
|
||||||
# endif
|
|
||||||
# elif (ACC_MM_HUGE)
|
|
||||||
# define SIZEOF_PTRDIFF_T 4
|
|
||||||
# else
|
|
||||||
# error "ACC_MM"
|
|
||||||
# endif
|
|
||||||
#elif (ACC_ARCH_AVR || ACC_ARCH_C166 || ACC_ARCH_MCS51 || ACC_ARCH_MCS251)
|
|
||||||
# define SIZEOF_PTRDIFF_T 2
|
|
||||||
# define SIZEOF_SIZE_T 2
|
|
||||||
# define SIZEOF_VOID_P 2
|
|
||||||
#else
|
|
||||||
# define SIZEOF_PTRDIFF_T SIZEOF_LONG
|
|
||||||
# define SIZEOF_SIZE_T SIZEOF_LONG
|
|
||||||
# define SIZEOF_VOID_P SIZEOF_LONG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SIZEOF_CHAR_P) && (SIZEOF_VOID_P > 0)
|
|
||||||
# define SIZEOF_CHAR_P SIZEOF_VOID_P
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if ((SIZEOF_LONG) > 0 && (SIZEOF_LONG) < 8)
|
|
||||||
#if (ACC_CC_GNUC)
|
|
||||||
# define SIZEOF_LONG_LONG 8
|
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
|
||||||
#elif (ACC_OS_WIN64)
|
|
||||||
# define SIZEOF___INT64 8
|
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_DMC))
|
|
||||||
# define SIZEOF_LONG_LONG 8
|
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_SYMANTECC && __SC__ >= 0x700))
|
|
||||||
# define SIZEOF_LONG_LONG 8
|
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_INTELC && defined(__linux__)))
|
|
||||||
# define SIZEOF_LONG_LONG 8
|
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_MWERKS || ACC_CC_PELLESC || ACC_CC_PGI))
|
|
||||||
# define SIZEOF_LONG_LONG 8
|
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_INTELC || ACC_CC_MSC))
|
|
||||||
# define SIZEOF___INT64 8
|
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_BORLANDC && __BORLANDC__ >= 0x0520))
|
|
||||||
/* INFO: unsigned __int64 is somewhat broken in 0x0520; fixed in 0x0530 */
|
|
||||||
# define SIZEOF___INT64 8
|
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_CC_WATCOMC && __WATCOMC__ >= 1100))
|
|
||||||
# define SIZEOF___INT64 8
|
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
|
||||||
#elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
|
|
||||||
# define SIZEOF___INT64 8
|
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__cplusplus) && defined(ACC_CC_GNUC)
|
|
||||||
# if (ACC_CC_GNUC < 0x020800ul)
|
|
||||||
# undef SIZEOF_LONG_LONG
|
|
||||||
# undef SIZEOF_UNSIGNED_LONG_LONG
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !defined(ACC_CONFIG_AUTO_NO_SIZES) */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// misc
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(HAVE_SIGNAL) && !defined(RETSIGTYPE)
|
|
||||||
# define RETSIGTYPE void
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* C/C++ Compiler - exactly one of:
|
|
||||||
*
|
|
||||||
* ACC_CC_UNKNOWN [default]
|
|
||||||
* ACC_CC_GNUC
|
|
||||||
* ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER)
|
|
||||||
# define ACC_CC_INTELC 1
|
|
||||||
# define ACC_INFO_CC "Intel C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__INTEL_COMPILER)
|
|
||||||
#elif defined(__POCC__)
|
|
||||||
# define ACC_CC_PELLESC 1
|
|
||||||
# define ACC_INFO_CC "Pelles C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__POCC__)
|
|
||||||
#elif defined(__GNUC__) && defined(__VERSION__)
|
|
||||||
# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
|
|
||||||
# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
|
|
||||||
# elif defined(__GNUC_MINOR__)
|
|
||||||
# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
|
|
||||||
# else
|
|
||||||
# define ACC_CC_GNUC (__GNUC__ * 0x10000L)
|
|
||||||
# endif
|
|
||||||
# define ACC_INFO_CC "gcc"
|
|
||||||
# define ACC_INFO_CCVER __VERSION__
|
|
||||||
#elif defined(__AZTEC_C__)
|
|
||||||
# define ACC_CC_AZTECC 1
|
|
||||||
# define ACC_INFO_CC "Aztec C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__AZTEC_C__)
|
|
||||||
#elif defined(__BORLANDC__)
|
|
||||||
# define ACC_CC_BORLANDC 1
|
|
||||||
# define ACC_INFO_CC "Borland C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__BORLANDC__)
|
|
||||||
#elif defined(__DMC__)
|
|
||||||
# define ACC_CC_DMC 1
|
|
||||||
# define ACC_INFO_CC "Digital Mars C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__DMC__)
|
|
||||||
#elif defined(__DECC)
|
|
||||||
# define ACC_CC_DECC 1
|
|
||||||
# define ACC_INFO_CC "DEC C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__DECC)
|
|
||||||
#elif defined(__HIGHC__)
|
|
||||||
# define ACC_CC_HIGHC 1
|
|
||||||
# define ACC_INFO_CC "MetaWare High C"
|
|
||||||
# define ACC_INFO_CCVER "unknown"
|
|
||||||
#elif defined(__IBMC__)
|
|
||||||
# define ACC_CC_IBMC 1
|
|
||||||
# define ACC_INFO_CC "IBM C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__IBMC__)
|
|
||||||
#elif defined(__KEIL__) && defined(__C166__)
|
|
||||||
# define ACC_CC_KEILC 1
|
|
||||||
# define ACC_INFO_CC "Keil C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__C166__)
|
|
||||||
#elif defined(__LCC__)
|
|
||||||
# define ACC_CC_LCC 1
|
|
||||||
# define ACC_INFO_CC "lcc"
|
|
||||||
# define ACC_INFO_CCVER "unknown"
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
# define ACC_CC_MSC 1
|
|
||||||
# define ACC_INFO_CC "Microsoft C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(_MSC_VER)
|
|
||||||
#elif defined(__MWERKS__)
|
|
||||||
# define ACC_CC_MWERKS 1
|
|
||||||
# define ACC_INFO_CC "Metrowerks C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__MWERKS__)
|
|
||||||
#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
|
|
||||||
# define ACC_CC_NDPC 1
|
|
||||||
# define ACC_INFO_CC "Microway NDP C"
|
|
||||||
# define ACC_INFO_CCVER "unknown"
|
|
||||||
#elif defined(__PACIFIC__)
|
|
||||||
# define ACC_CC_PACIFICC 1
|
|
||||||
# define ACC_INFO_CC "Pacific C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__PACIFIC__)
|
|
||||||
#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
|
|
||||||
# define ACC_CC_PGI 1
|
|
||||||
# define ACC_INFO_CC "Portland Group PGI C"
|
|
||||||
# define ACC_INFO_CCVER "unknown"
|
|
||||||
#elif defined(__PUREC__)
|
|
||||||
# define ACC_CC_PUREC 1
|
|
||||||
# define ACC_INFO_CC "Pure C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__PUREC__)
|
|
||||||
#elif defined(__SC__)
|
|
||||||
# define ACC_CC_SYMANTECC 1
|
|
||||||
# define ACC_INFO_CC "Symantec C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__SC__)
|
|
||||||
#elif defined(__SUNPRO_C)
|
|
||||||
# define ACC_CC_SUNPROC 1
|
|
||||||
# define ACC_INFO_CC "Sun C"
|
|
||||||
# define ACC_INFO_CCVER "unknown"
|
|
||||||
#elif defined(__TINYC__)
|
|
||||||
# define ACC_CC_TINYC 1
|
|
||||||
# define ACC_INFO_CC "Tiny C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__TINYC__)
|
|
||||||
#elif defined(__TSC__)
|
|
||||||
# define ACC_CC_TOPSPEEDC 1
|
|
||||||
# define ACC_INFO_CC "TopSpeed C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__TSC__)
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
# define ACC_CC_WATCOMC 1
|
|
||||||
# define ACC_INFO_CC "Watcom C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__WATCOMC__)
|
|
||||||
#elif defined(__TURBOC__)
|
|
||||||
# define ACC_CC_TURBOC 1
|
|
||||||
# define ACC_INFO_CC "Turbo C"
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__TURBOC__)
|
|
||||||
#elif defined(__ZTC__)
|
|
||||||
# define ACC_CC_ZORTECHC 1
|
|
||||||
# define ACC_INFO_CC "Zortech C"
|
|
||||||
# if (__ZTC__ == 0x310)
|
|
||||||
# define ACC_INFO_CCVER "0x310"
|
|
||||||
# else
|
|
||||||
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__ZTC__)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define ACC_CC_UNKNOWN 1
|
|
||||||
# define ACC_INFO_CC "unknown"
|
|
||||||
# define ACC_INFO_CCVER "unknown"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,440 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(ACCCHK_ASSERT)
|
|
||||||
# define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* compile-time sign */
|
|
||||||
#if !defined(ACCCHK_ASSERT_SIGN_T)
|
|
||||||
# define ACCCHK_ASSERT_SIGN_T(type,relop) \
|
|
||||||
ACCCHK_ASSERT( (type) (-1) relop (type) 0 ) \
|
|
||||||
ACCCHK_ASSERT( (type) (~(type)0) relop (type) 0 ) \
|
|
||||||
ACCCHK_ASSERT( (type) (~(type)0) == (type) (-1) )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(ACCCHK_IS_SIGNED_T)
|
|
||||||
# define ACCCHK_ASSERT_IS_SIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,<)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(ACCCHK_IS_UNSIGNED_T)
|
|
||||||
# if (ACC_BROKEN_INTEGRAL_PROMOTION)
|
|
||||||
# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) \
|
|
||||||
ACCCHK_ASSERT( (type) (-1) > (type) 0 )
|
|
||||||
# else
|
|
||||||
# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,>)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check preprocessor
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_0xffffffffL - ACC_UINT32L_C(4294967294) != 1)
|
|
||||||
# error "preprocessor error 1"
|
|
||||||
#endif
|
|
||||||
#if (ACC_0xffffffffL - ACC_UINT32L_C(0xfffffffd) != 2)
|
|
||||||
# error "preprocessor error 2"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define ACCCHK_VAL 1
|
|
||||||
#define ACCCHK_TMP1 ACCCHK_VAL
|
|
||||||
#undef ACCCHK_VAL
|
|
||||||
#define ACCCHK_VAL 2
|
|
||||||
#define ACCCHK_TMP2 ACCCHK_VAL
|
|
||||||
#if (ACCCHK_TMP1 != 2)
|
|
||||||
# error "preprocessor error 3a"
|
|
||||||
#endif
|
|
||||||
#if (ACCCHK_TMP2 != 2)
|
|
||||||
# error "preprocessor error 3b"
|
|
||||||
#endif
|
|
||||||
#undef ACCCHK_VAL
|
|
||||||
#if (ACCCHK_TMP2)
|
|
||||||
# error "preprocessor error 3c"
|
|
||||||
#endif
|
|
||||||
#if (ACCCHK_TMP2 + 0 != 0)
|
|
||||||
# error "preprocessor error 3d"
|
|
||||||
#endif
|
|
||||||
#undef ACCCHK_TMP1
|
|
||||||
#undef ACCCHK_TMP2
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check basic arithmetics
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(__ACC_INT_MAX(2) == 1)
|
|
||||||
ACCCHK_ASSERT(__ACC_INT_MAX(8) == 127)
|
|
||||||
ACCCHK_ASSERT(__ACC_INT_MAX(16) == 32767)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(__ACC_UINT_MAX(2) == 3)
|
|
||||||
ACCCHK_ASSERT(__ACC_UINT_MAX(16) == 0xffffU)
|
|
||||||
ACCCHK_ASSERT(__ACC_UINT_MAX(32) == 0xffffffffUL)
|
|
||||||
#if !defined(ACC_BROKEN_INTEGRAL_PROMOTION)
|
|
||||||
ACCCHK_ASSERT(__ACC_UINT_MAX(__ACC_INT_BIT) == ~(0u))
|
|
||||||
ACCCHK_ASSERT(__ACC_UINT_MAX(__ACC_LONG_BIT) == ~(0ul))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check basic types
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(signed char)
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned char)
|
|
||||||
ACCCHK_ASSERT(sizeof(signed char) == sizeof(char))
|
|
||||||
ACCCHK_ASSERT(sizeof(unsigned char) == sizeof(char))
|
|
||||||
ACCCHK_ASSERT(sizeof(char) == 1)
|
|
||||||
ACCCHK_ASSERT(sizeof(char) == sizeof((char)0))
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
ACCCHK_ASSERT(sizeof('\0') == sizeof(char))
|
|
||||||
#else
|
|
||||||
# if (ACC_CC_DMC)
|
|
||||||
/* Digital Mars C is broken */
|
|
||||||
# else
|
|
||||||
ACCCHK_ASSERT(sizeof('\0') == sizeof(int))
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if defined(acc_alignof)
|
|
||||||
ACCCHK_ASSERT(acc_alignof(char) == 1)
|
|
||||||
ACCCHK_ASSERT(acc_alignof(signed char) == 1)
|
|
||||||
ACCCHK_ASSERT(acc_alignof(unsigned char) == 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(short)
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
|
|
||||||
ACCCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
|
|
||||||
ACCCHK_ASSERT(sizeof(short) >= 2)
|
|
||||||
ACCCHK_ASSERT(sizeof(short) >= sizeof(char))
|
|
||||||
ACCCHK_ASSERT(sizeof(short) == sizeof((short)0))
|
|
||||||
#if (SIZEOF_SHORT > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(short) == SIZEOF_SHORT)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(int)
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
|
|
||||||
ACCCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
|
|
||||||
ACCCHK_ASSERT(sizeof(int) >= 2)
|
|
||||||
ACCCHK_ASSERT(sizeof(int) >= sizeof(short))
|
|
||||||
ACCCHK_ASSERT(sizeof(int) == sizeof(0))
|
|
||||||
ACCCHK_ASSERT(sizeof(int) == sizeof((int)0))
|
|
||||||
#if (SIZEOF_INT > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(int) == SIZEOF_INT)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(long)
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
|
|
||||||
ACCCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
|
|
||||||
ACCCHK_ASSERT(sizeof(long) >= 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(long) >= sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(long) == sizeof(0L))
|
|
||||||
ACCCHK_ASSERT(sizeof(long) == sizeof((long)0))
|
|
||||||
#if (SIZEOF_LONG > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(long) == SIZEOF_LONG)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(size_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) >= sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0))) /* sizeof() returns size_t */
|
|
||||||
#if (SIZEOF_SIZE_T > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
|
|
||||||
#if !defined(ACC_BROKEN_SIZEOF)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof((char*)0 - (char*)0))
|
|
||||||
# if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
ACCCHK_ASSERT(4 == sizeof((char __huge*)0 - (char __huge*)0))
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if (SIZEOF_PTRDIFF_T > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(sizeof(void*) >= sizeof(char*))
|
|
||||||
#if (SIZEOF_VOID_P > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P)
|
|
||||||
#endif
|
|
||||||
#if (SIZEOF_CHAR_P > 0)
|
|
||||||
ACCCHK_ASSERT(sizeof(char*) == SIZEOF_CHAR_P)
|
|
||||||
#endif
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
ACCCHK_ASSERT(4 == sizeof(void __huge*))
|
|
||||||
ACCCHK_ASSERT(4 == sizeof(char __huge*))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check arithmetics
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
|
|
||||||
ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
|
|
||||||
|
|
||||||
#if (ACC_CC_TURBOC && (__TURBOC__ < 0x0150))
|
|
||||||
/* TC 1.0 bug, probably due to ACC_BROKEN_INTEGRAL_PROMOTION ?? */
|
|
||||||
#else
|
|
||||||
ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
|
|
||||||
#endif
|
|
||||||
ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
|
|
||||||
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32e_t) == 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32e_t) == SIZEOF_ACC_INT32E_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_uint32e_t) == 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32e_t) == sizeof(acc_uint32e_t))
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(acc_int32e_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_int32e_t)1 << 30) + 1) >> 30) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_INT32E_C(1) << 30) + 1) >> 30) == 1)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32e_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_uint32e_t)1 << 31) + 1) >> 31) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_UINT32E_C(1) << 31) + 1) >> 31) == 1)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT( (acc_int32e_t) (1 + ~(acc_int32e_t)0) == 0)
|
|
||||||
#if defined(ACCCHK_CONFIG_PEDANTIC)
|
|
||||||
/* compiler may warn about overflow */
|
|
||||||
ACCCHK_ASSERT( (acc_uint32e_t)(1 + ~(acc_uint32e_t)0) == 0)
|
|
||||||
#endif /* ACCCHK_CONFIG_PEDANTIC */
|
|
||||||
|
|
||||||
#if (SIZEOF_ACC_INT32E_T < SIZEOF_INT)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT32E_C(0)) == sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT32E_C(0)) == sizeof(int))
|
|
||||||
#else
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT32E_C(0)) == SIZEOF_ACC_INT32E_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT32E_C(0)) == SIZEOF_ACC_INT32E_T)
|
|
||||||
#endif
|
|
||||||
ACCCHK_ASSERT((ACC_INT32E_C(1) << (8*SIZEOF_ACC_INT32E_T-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT32E_C(1) << (8*SIZEOF_ACC_INT32E_T-1)) > 0)
|
|
||||||
ACCCHK_ASSERT((ACC_INT32E_C(1) << (int)(8*sizeof(ACC_INT32E_C(1))-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT32E_C(1) << (int)(8*sizeof(ACC_UINT32E_C(1))-1)) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT32E_C(2147483647) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT32E_C(-2147483647) -1 < 0)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT32E_C(4294967295) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT32E_C(4294967295) == ACC_0xffffffffL)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(int))
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(acc_int32e_t))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32l_t) >= 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32l_t) == SIZEOF_ACC_INT32L_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_uint32l_t) >= 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32l_t) == sizeof(acc_uint32l_t))
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(acc_int32l_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_int32l_t)1 << 30) + 1) >> 30) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_INT32L_C(1) << 30) + 1) >> 30) == 1)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32l_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_uint32l_t)1 << 31) + 1) >> 31) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_UINT32L_C(1) << 31) + 1) >> 31) == 1)
|
|
||||||
|
|
||||||
#if (SIZEOF_ACC_INT32L_T < SIZEOF_INT)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT32L_C(0)) == sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT32L_C(0)) == sizeof(int))
|
|
||||||
#else
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT32L_C(0)) == SIZEOF_ACC_INT32L_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT32L_C(0)) == SIZEOF_ACC_INT32L_T)
|
|
||||||
#endif
|
|
||||||
ACCCHK_ASSERT((ACC_INT32L_C(1) << (8*SIZEOF_ACC_INT32L_T-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT32L_C(1) << (8*SIZEOF_ACC_INT32L_T-1)) > 0)
|
|
||||||
ACCCHK_ASSERT((ACC_INT32L_C(1) << (int)(8*sizeof(ACC_INT32L_C(1))-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT32L_C(1) << (int)(8*sizeof(ACC_UINT32L_C(1))-1)) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT32L_C(2147483647) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT32L_C(-2147483647) -1 < 0)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT32L_C(4294967295) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT32L_C(4294967295) == ACC_0xffffffffL)
|
|
||||||
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(int))
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32e_t))
|
|
||||||
#endif
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
|
|
||||||
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) == SIZEOF_ACC_INT32F_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= sizeof(acc_uint32l_t))
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int32f_t) == sizeof(acc_uint32f_t))
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(acc_int32f_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_int32f_t)1 << 30) + 1) >> 30) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_INT32F_C(1) << 30) + 1) >> 30) == 1)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32f_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_uint32f_t)1 << 31) + 1) >> 31) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_UINT32F_C(1) << 31) + 1) >> 31) == 1)
|
|
||||||
|
|
||||||
#if (SIZEOF_ACC_INT32F_T < SIZEOF_INT)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT32F_C(0)) == sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT32F_C(0)) == sizeof(int))
|
|
||||||
#else
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT32F_C(0)) == SIZEOF_ACC_INT32F_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT32F_C(0)) == SIZEOF_ACC_INT32F_T)
|
|
||||||
#endif
|
|
||||||
ACCCHK_ASSERT((ACC_INT32F_C(1) << (8*SIZEOF_ACC_INT32F_T-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT32F_C(1) << (8*SIZEOF_ACC_INT32F_T-1)) > 0)
|
|
||||||
ACCCHK_ASSERT((ACC_INT32F_C(1) << (int)(8*sizeof(ACC_INT32F_C(1))-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT32F_C(1) << (int)(8*sizeof(ACC_UINT32F_C(1))-1)) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT32F_C(2147483647) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT32F_C(-2147483647) -1 < 0)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT32F_C(4294967295) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT32F_C(4294967295) == ACC_0xffffffffL)
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(acc_int64l_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int64l_t) >= 8)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int64l_t) == SIZEOF_ACC_INT64L_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_uint64l_t) >= 8)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_int64l_t) == sizeof(acc_uint64l_t))
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(acc_int64l_t)
|
|
||||||
ACCCHK_ASSERT(((( (acc_int64l_t)1 << 62) + 1) >> 62) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_INT64L_C(1) << 62) + 1) >> 62) == 1)
|
|
||||||
|
|
||||||
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
|
|
||||||
/* Borland C is broken */
|
|
||||||
#else
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64l_t)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT64L_C(18446744073709551615) > 0)
|
|
||||||
#endif
|
|
||||||
ACCCHK_ASSERT(((( (acc_uint64l_t)1 << 63) + 1) >> 63) == 1)
|
|
||||||
ACCCHK_ASSERT(((( ACC_UINT64L_C(1) << 63) + 1) >> 63) == 1)
|
|
||||||
|
|
||||||
#if defined(ACCCHK_CONFIG_PEDANTIC)
|
|
||||||
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0560))
|
|
||||||
/* Borland C is broken */
|
|
||||||
#elif (SIZEOF_ACC_INT64L_T < SIZEOF_INT)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT64L_C(0)) == sizeof(int))
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT64L_C(0)) == sizeof(int))
|
|
||||||
#else
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_INT64L_C(0)) == SIZEOF_ACC_INT64L_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(ACC_UINT64L_C(0)) == SIZEOF_ACC_INT64L_T)
|
|
||||||
#endif
|
|
||||||
#endif /* ACCCHK_CONFIG_PEDANTIC */
|
|
||||||
ACCCHK_ASSERT((ACC_INT64L_C(1) << (8*SIZEOF_ACC_INT64L_T-1)) < 0)
|
|
||||||
ACCCHK_ASSERT((ACC_UINT64L_C(1) << (8*SIZEOF_ACC_INT64L_T-1)) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT64L_C(9223372036854775807) > 0)
|
|
||||||
ACCCHK_ASSERT(ACC_INT64L_C(-9223372036854775807) - 1 < 0)
|
|
||||||
|
|
||||||
ACCCHK_ASSERT( ACC_INT64L_C(9223372036854775807) % 2147483629l == 721)
|
|
||||||
ACCCHK_ASSERT( ACC_INT64L_C(9223372036854775807) % 2147483647l == 1)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT64L_C(9223372036854775807) % 2147483629ul == 721)
|
|
||||||
ACCCHK_ASSERT(ACC_UINT64L_C(9223372036854775807) % 2147483647ul == 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
ACCCHK_ASSERT_IS_SIGNED_T(acc_intptr_t)
|
|
||||||
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uintptr_t)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_intptr_t) >= sizeof(void *))
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_intptr_t) == SIZEOF_ACC_INTPTR_T)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(acc_uintptr_t))
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check memory model ACC_MM
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_MM_FLAT)
|
|
||||||
#if 0
|
|
||||||
/* this is not a valid assumption -- disabled */
|
|
||||||
ACCCHK_ASSERT(sizeof(void*) == sizeof(void (*)(void)))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
ACCCHK_ASSERT(sizeof(void*) == 2)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 2)
|
|
||||||
#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
ACCCHK_ASSERT(sizeof(void*) == 4)
|
|
||||||
#endif
|
|
||||||
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_COMPACT)
|
|
||||||
ACCCHK_ASSERT(sizeof(void (*)(void)) == 2)
|
|
||||||
#elif (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check ACC_ARCH and ACC_OS
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_ARCH_IA16)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == 2)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
|
|
||||||
#elif (ACC_ARCH_IA32 || ACC_ARCH_M68K)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
|
|
||||||
#elif (ACC_ARCH_AMD64 || ACC_ARCH_IA64)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == 8)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8)
|
|
||||||
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
|
|
||||||
ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
|
|
||||||
#elif (ACC_OS_WIN64)
|
|
||||||
ACCCHK_ASSERT(sizeof(size_t) == 8)
|
|
||||||
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8)
|
|
||||||
ACCCHK_ASSERT(sizeof(void (*)(void)) == 8)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// check promotion rules
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_CC_NDPC)
|
|
||||||
/* NDP C is broken */
|
|
||||||
#else
|
|
||||||
/* check that the compiler correctly casts signed to unsigned */
|
|
||||||
ACCCHK_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_CC_KEILC)
|
|
||||||
/* Keil C is broken */
|
|
||||||
#elif (ACC_CC_NDPC)
|
|
||||||
/* NDP C is broken */
|
|
||||||
#elif !defined(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
|
|
||||||
/* check that the compiler correctly promotes integrals */
|
|
||||||
ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(__ACCCHKR_FUNCNAME)
|
|
||||||
# define __ACCCHKR_FUNCNAME(f) accchkr_ ## f
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(ACCCHKR_ASSERT)
|
|
||||||
|
|
||||||
#if 0 || defined(ACCCHKR_CONFIG_DEBUG)
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
static int __ACCCHKR_FUNCNAME(assert_fail)(const char* s, unsigned l)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "ACCCHKR assertion failed in line %u: `%s'\n", l, s);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#define ACCCHKR_ASSERT(expr) ((expr) ? 1 : __ACCCHKR_FUNCNAME(assert_fail)(#expr,__LINE__))
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define ACCCHKR_ASSERT(expr) ((expr) ? 1 : 0)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* avoid inlining */
|
|
||||||
static int __ACCCHKR_FUNCNAME(schedule_insns_bug)(void);
|
|
||||||
static int __ACCCHKR_FUNCNAME(strength_reduce_bug)(int*);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// main entry
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
static int __ACCCHKR_FUNCNAME(check)(int r)
|
|
||||||
{
|
|
||||||
#if defined(ACC_ENDIAN_BIG_ENDIAN)
|
|
||||||
{
|
|
||||||
union { long l; unsigned char c[sizeof(long)]; } u;
|
|
||||||
u.l = 0; u.c[sizeof(long)-1] = 0x80;
|
|
||||||
r &= ACCCHKR_ASSERT(u.l == 128);
|
|
||||||
u.l = 0; u.c[0] = 0x80;
|
|
||||||
r &= ACCCHKR_ASSERT(u.l < 0);
|
|
||||||
ACC_UNUSED(u);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if defined(ACC_ENDIAN_LITTLE_ENDIAN)
|
|
||||||
{
|
|
||||||
union { long l; unsigned char c[sizeof(long)]; } u;
|
|
||||||
u.l = 0; u.c[0] = 0x80;
|
|
||||||
r &= ACCCHKR_ASSERT(u.l == 128);
|
|
||||||
u.l = 0; u.c[sizeof(long)-1] = 0x80;
|
|
||||||
r &= ACCCHKR_ASSERT(u.l < 0);
|
|
||||||
ACC_UNUSED(u);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* check for the gcc schedule-insns optimization bug */
|
|
||||||
if (r == 1)
|
|
||||||
{
|
|
||||||
r &= ACCCHKR_ASSERT(!__ACCCHKR_FUNCNAME(schedule_insns_bug()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check for the gcc strength-reduce optimization bug */
|
|
||||||
if (r == 1)
|
|
||||||
{
|
|
||||||
static int x[3];
|
|
||||||
static unsigned xn = 3;
|
|
||||||
register unsigned j;
|
|
||||||
|
|
||||||
for (j = 0; j < xn; j++)
|
|
||||||
x[j] = (int)j - 3;
|
|
||||||
r &= ACCCHKR_ASSERT(!__ACCCHKR_FUNCNAME(strength_reduce_bug(x)));
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
static int __ACCCHKR_FUNCNAME(schedule_insns_bug)(void)
|
|
||||||
{
|
|
||||||
const int a[] = {1, 2, 0}; const int* b;
|
|
||||||
b = a; return (*b) ? 0 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int __ACCCHKR_FUNCNAME(strength_reduce_bug)(int* x)
|
|
||||||
{
|
|
||||||
#if 0 && (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
ACC_UNUSED(x); return 0;
|
|
||||||
#else
|
|
||||||
return x[0] != -3 || x[1] != -2 || x[2] != -1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ACC_CXX_H_INCLUDED
|
|
||||||
#define __ACC_CXX_H_INCLUDED 1
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// exception specification
|
|
||||||
// ACC_CXX_NOTHROW
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(ACC_CXX_NOTHROW)
|
|
||||||
#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul))
|
|
||||||
#elif (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
|
|
||||||
#elif (ACC_CC_HIGHC)
|
|
||||||
#elif (ACC_CC_MSC && (_MSC_VER < 1100))
|
|
||||||
#elif (ACC_CC_NDPC)
|
|
||||||
#elif (ACC_CC_TURBOC)
|
|
||||||
#elif (ACC_CC_WATCOMC && !defined(_CPPUNWIND))
|
|
||||||
#elif (ACC_CC_ZORTECHC)
|
|
||||||
#else
|
|
||||||
# define ACC_CXX_NOTHROW throw()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(ACC_CXX_NOTHROW)
|
|
||||||
# define ACC_CXX_NOTHROW
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// disable dynamic allocation of an object - private helpers
|
|
||||||
// __ACC_CXX_DO_NEW
|
|
||||||
// __ACC_CXX_DO_DELETE
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__ACC_CXX_DO_NEW)
|
|
||||||
#elif (ACC_CC_NDPC || ACC_CC_PGI)
|
|
||||||
# define __ACC_CXX_DO_NEW { return 0; }
|
|
||||||
#else
|
|
||||||
# define __ACC_CXX_DO_NEW ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* need an implementation in case a class has virtual members */
|
|
||||||
#if defined(__ACC_CXX_DO_DELETE)
|
|
||||||
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
# define __ACC_CXX_DO_DELETE { }
|
|
||||||
#else
|
|
||||||
# define __ACC_CXX_DO_DELETE ACC_CXX_NOTHROW { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// disable dynamic allocation of an object
|
|
||||||
// ACC_CXX_DISABLE_NEW_DELETE
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
#undef __ACC_CXX_HAVE_ARRAY_NEW
|
|
||||||
#undef __ACC_CXX_HAVE_PLACEMENT_NEW
|
|
||||||
#undef __ACC_CXX_HAVE_PLACEMENT_DELETE
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
|
|
||||||
#elif (ACC_CC_MSC && ACC_MM_HUGE)
|
|
||||||
# define ACC_CXX_DISABLE_NEW_DELETE private:
|
|
||||||
#elif (ACC_CC_MSC && (_MSC_VER < 1100))
|
|
||||||
#elif (ACC_CC_NDPC)
|
|
||||||
#elif (ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
#elif (ACC_CC_TURBOC)
|
|
||||||
#elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
|
|
||||||
#else
|
|
||||||
# define __ACC_CXX_HAVE_ARRAY_NEW 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (__ACC_CXX_HAVE_ARRAY_NEW)
|
|
||||||
# define __ACC_CXX_HAVE_PLACEMENT_NEW 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (__ACC_CXX_HAVE_PLACEMENT_NEW)
|
|
||||||
# if (ACC_CC_GNUC >= 0x030000ul)
|
|
||||||
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
|
|
||||||
# elif (ACC_CC_INTELC)
|
|
||||||
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
|
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER >= 1200))
|
|
||||||
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
|
|
||||||
# elif (ACC_CC_PGI)
|
|
||||||
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(ACC_CXX_DISABLE_NEW_DELETE)
|
|
||||||
#elif defined(new) || defined(delete)
|
|
||||||
# define ACC_CXX_DISABLE_NEW_DELETE private:
|
|
||||||
#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025b00ul))
|
|
||||||
# define ACC_CXX_DISABLE_NEW_DELETE private:
|
|
||||||
#elif (ACC_CC_HIGHC)
|
|
||||||
# define ACC_CXX_DISABLE_NEW_DELETE private:
|
|
||||||
#elif !defined(__ACC_CXX_HAVE_ARRAY_NEW)
|
|
||||||
/* for old compilers use `protected' instead of `private' */
|
|
||||||
# define ACC_CXX_DISABLE_NEW_DELETE \
|
|
||||||
protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
|
|
||||||
protected: static void* operator new(size_t) __ACC_CXX_DO_NEW \
|
|
||||||
private:
|
|
||||||
#else
|
|
||||||
# define ACC_CXX_DISABLE_NEW_DELETE \
|
|
||||||
protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
|
|
||||||
static void operator delete[](void*) __ACC_CXX_DO_DELETE \
|
|
||||||
private: static void* operator new(size_t) __ACC_CXX_DO_NEW \
|
|
||||||
static void* operator new[](size_t) __ACC_CXX_DO_NEW
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// Assist the compiler by defining a unique location for vtables and RTTI.
|
|
||||||
// Every class which has virtual member functions or derives from a class
|
|
||||||
// with virtual members should put this macro at the very top of its
|
|
||||||
// class declaration.
|
|
||||||
// ACC_CXX_TRIGGER_FUNCTION
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(ACC_CXX_TRIGGER_FUNCTION)
|
|
||||||
#else
|
|
||||||
# define ACC_CXX_TRIGGER_FUNCTION \
|
|
||||||
protected: virtual const void* acc_cxx_trigger_function() const; \
|
|
||||||
private:
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ACC_CXX_TRIGGER_FUNCTION_IMPL)
|
|
||||||
#else
|
|
||||||
# define ACC_CXX_TRIGGER_FUNCTION_IMPL(klass) \
|
|
||||||
const void* klass::acc_cxx_trigger_function() const { return 0; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// acc_alignof() / acc_inline
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_CC_GNUC)
|
|
||||||
# define acc_alignof(e) __alignof__(e)
|
|
||||||
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
|
|
||||||
# define acc_alignof(e) __alignof__(e)
|
|
||||||
#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
|
|
||||||
# define acc_alignof(e) __alignof(e)
|
|
||||||
#elif (ACC_CC_PGI)
|
|
||||||
# define acc_alignof(e) __alignof__(e)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_CC_TURBOC && (__TURBOC__ <= 0x0295))
|
|
||||||
#elif defined(__cplusplus)
|
|
||||||
# define acc_inline inline
|
|
||||||
#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
|
|
||||||
# define acc_inline __inline
|
|
||||||
#elif (ACC_CC_DMC)
|
|
||||||
# define acc_inline __inline
|
|
||||||
#elif (ACC_CC_GNUC)
|
|
||||||
# define acc_inline __inline__
|
|
||||||
#elif (ACC_CC_INTELC)
|
|
||||||
# define acc_inline __inline
|
|
||||||
#elif (ACC_CC_MSC && (_MSC_VER >= 1000))
|
|
||||||
# define acc_inline __inline
|
|
||||||
#elif (ACC_CC_PGI)
|
|
||||||
# define acc_inline __inline__
|
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
|
||||||
# define acc_inline inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// ACC_UNUSED / ACC_UNUSED_FUNC
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(ACC_UNUSED)
|
|
||||||
# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
|
|
||||||
# define ACC_UNUSED(var) ((void) &var)
|
|
||||||
# elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_TURBOC)
|
|
||||||
# define ACC_UNUSED(var) if (&var) ; else
|
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER < 900))
|
|
||||||
# define ACC_UNUSED(var) if (&var) ; else
|
|
||||||
# elif (ACC_CC_GNUC)
|
|
||||||
# define ACC_UNUSED(var) ((void) var)
|
|
||||||
# elif (ACC_CC_KEILC)
|
|
||||||
# define ACC_UNUSED(var)
|
|
||||||
# else
|
|
||||||
# define ACC_UNUSED(var) ((void) &var)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if !defined(ACC_UNUSED_FUNC)
|
|
||||||
# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
|
|
||||||
# define ACC_UNUSED_FUNC(func) ((void) func)
|
|
||||||
# elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC)
|
|
||||||
# define ACC_UNUSED_FUNC(func) if (func) ; else
|
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER < 900))
|
|
||||||
# define ACC_UNUSED_FUNC(func) if (func) ; else
|
|
||||||
# elif (ACC_CC_KEILC)
|
|
||||||
# define ACC_UNUSED_FUNC(func)
|
|
||||||
# else
|
|
||||||
# define ACC_UNUSED_FUNC(func) ((void) func)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// compile-time-assertions
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* This can be put into a header file but may get ignored by some compilers. */
|
|
||||||
#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
|
|
||||||
# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
|
|
||||||
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1u-2*!(e)];
|
|
||||||
# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
|
|
||||||
# else
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-2*!(e)];
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This must appear within a function body. */
|
|
||||||
#if !defined(ACC_COMPILE_TIME_ASSERT)
|
|
||||||
# if (ACC_CC_AZTECC)
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-!(e)];}
|
|
||||||
# elif (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
|
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER < 900))
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
|
|
||||||
# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
|
|
||||||
# else
|
|
||||||
# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-2*!(e)];}
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// macros
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(__ACC_UINT_MAX)
|
|
||||||
# define __ACC_INT_MAX(b) ((((1l << ((b)-2)) - 1l) * 2l) + 1l)
|
|
||||||
# define __ACC_UINT_MAX(b) ((((1ul << ((b)-1)) - 1ul) * 2ul) + 1ul)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// get sizes of builtin integral types from <limits.h>
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(__ACC_SHORT_BIT)
|
|
||||||
# if (USHRT_MAX == ACC_0xffffL)
|
|
||||||
# define __ACC_SHORT_BIT 16
|
|
||||||
# elif (USHRT_MAX == ACC_0xffffffffL)
|
|
||||||
# define __ACC_SHORT_BIT 32
|
|
||||||
# elif (USHRT_MAX == __ACC_UINT_MAX(64))
|
|
||||||
# define __ACC_SHORT_BIT 64
|
|
||||||
# elif (USHRT_MAX == __ACC_UINT_MAX(128))
|
|
||||||
# define __ACC_SHORT_BIT 128
|
|
||||||
# else
|
|
||||||
# error "check your compiler installation: USHRT_MAX"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__ACC_INT_BIT)
|
|
||||||
# if (UINT_MAX == ACC_0xffffL)
|
|
||||||
# define __ACC_INT_BIT 16
|
|
||||||
# elif (UINT_MAX == ACC_0xffffffffL)
|
|
||||||
# define __ACC_INT_BIT 32
|
|
||||||
# elif (UINT_MAX == __ACC_UINT_MAX(64))
|
|
||||||
# define __ACC_INT_BIT 64
|
|
||||||
# elif (UINT_MAX == __ACC_UINT_MAX(128))
|
|
||||||
# define __ACC_INT_BIT 128
|
|
||||||
# else
|
|
||||||
# error "check your compiler installation: UINT_MAX"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__ACC_LONG_BIT)
|
|
||||||
# if (ULONG_MAX == ACC_0xffffffffL)
|
|
||||||
# define __ACC_LONG_BIT 32
|
|
||||||
# elif (ULONG_MAX == __ACC_UINT_MAX(64))
|
|
||||||
# define __ACC_LONG_BIT 64
|
|
||||||
# elif (ULONG_MAX == __ACC_UINT_MAX(128))
|
|
||||||
# define __ACC_LONG_BIT 128
|
|
||||||
# else
|
|
||||||
# error "check your compiler installation: ULONG_MAX"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// acc_auto.h supplements
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__)) || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
|
|
||||||
# elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
/* ancient pw32 version */
|
|
||||||
# elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025f00ul)))
|
|
||||||
/* ancient cygwin/mingw version */
|
|
||||||
# else
|
|
||||||
# define ACC_HAVE_WINDOWS_H 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ACC_INCD_H_INCLUDED
|
|
||||||
#define __ACC_INCD_H_INCLUDED 1
|
|
||||||
|
|
||||||
/* default system includes */
|
|
||||||
/* see Autoconf:
|
|
||||||
* headers.m4, _AC_INCLUDES_DEFAULT_REQUIREMENTS ac_includes_default
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#if defined(HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus)
|
|
||||||
# include <time.h>
|
|
||||||
#endif
|
|
||||||
#if HAVE_SYS_TYPES_H
|
|
||||||
# include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
#if HAVE_SYS_STAT_H
|
|
||||||
# include <sys/stat.h>
|
|
||||||
#endif
|
|
||||||
#if STDC_HEADERS
|
|
||||||
# include <stdlib.h>
|
|
||||||
# include <stddef.h>
|
|
||||||
#else
|
|
||||||
# if HAVE_STDLIB_H
|
|
||||||
# include <stdlib.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if HAVE_STRING_H
|
|
||||||
# if !STDC_HEADERS && HAVE_MEMORY_H
|
|
||||||
# include <memory.h>
|
|
||||||
# endif
|
|
||||||
# include <string.h>
|
|
||||||
#endif
|
|
||||||
#if HAVE_STRINGS_H
|
|
||||||
# include <strings.h>
|
|
||||||
#endif
|
|
||||||
#if HAVE_INTTYPES_H
|
|
||||||
# include <inttypes.h>
|
|
||||||
#else
|
|
||||||
# if HAVE_STDINT_H
|
|
||||||
# include <stdint.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if HAVE_UNISTD_H
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ACC_INCE_H_INCLUDED
|
|
||||||
#define __ACC_INCE_H_INCLUDED 1
|
|
||||||
|
|
||||||
/* extra system includes */
|
|
||||||
|
|
||||||
#if defined(HAVE_STDARG_H)
|
|
||||||
# include <stdarg.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_CTYPE_H)
|
|
||||||
# include <ctype.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_ERRNO_H)
|
|
||||||
# include <errno.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_MALLOC_H)
|
|
||||||
# include <malloc.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_ALLOCA_H)
|
|
||||||
# include <alloca.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_FCNTL_H)
|
|
||||||
# include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_DIRENT_H)
|
|
||||||
# include <dirent.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_SETJMP_H)
|
|
||||||
# include <setjmp.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_SIGNAL_H)
|
|
||||||
# include <signal.h>
|
|
||||||
#endif
|
|
||||||
#if defined(TIME_WITH_SYS_TIME)
|
|
||||||
# include <sys/time.h>
|
|
||||||
# include <time.h>
|
|
||||||
#elif defined(HAVE_TIME_H)
|
|
||||||
# include <time.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_UTIME_H)
|
|
||||||
# include <utime.h>
|
|
||||||
#elif defined(HAVE_SYS_UTIME_H)
|
|
||||||
# include <sys/utime.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* DOS, OS/2 & Windows */
|
|
||||||
#if defined(HAVE_IO_H)
|
|
||||||
# include <io.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_DOS_H)
|
|
||||||
# include <dos.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_DIRECT_H)
|
|
||||||
# include <direct.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_SHARE_H)
|
|
||||||
# include <share.h>
|
|
||||||
#endif
|
|
||||||
#if defined(ACC_CC_NDPC)
|
|
||||||
# include <os.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* TOS */
|
|
||||||
#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
|
|
||||||
# include <ext.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ACC_INCI_H_INCLUDED
|
|
||||||
#define __ACC_INCI_H_INCLUDED 1
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// internal system includes
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
|
||||||
# include <tos.h>
|
|
||||||
#elif (ACC_HAVE_WINDOWS_H)
|
|
||||||
# if 1 && !defined(WIN32_LEAN_AND_MEAN)
|
|
||||||
# define WIN32_LEAN_AND_MEAN 1
|
|
||||||
# endif
|
|
||||||
# if 1 && !defined(_WIN32_WINNT)
|
|
||||||
/* Restrict to a subset of Windows NT 4.0 header files */
|
|
||||||
# define _WIN32_WINNT 0x0400
|
|
||||||
# endif
|
|
||||||
# include <windows.h>
|
|
||||||
# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
# include <dir.h>
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_WIN16)
|
|
||||||
# if (ACC_CC_AZTECC)
|
|
||||||
# include <model.h>
|
|
||||||
# include <stat.h>
|
|
||||||
# elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
# include <alloc.h>
|
|
||||||
# include <dir.h>
|
|
||||||
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
# include <sys/exceptn.h>
|
|
||||||
# elif (ACC_CC_PACIFICC)
|
|
||||||
# include <unixio.h>
|
|
||||||
# include <stat.h>
|
|
||||||
# include <sys.h>
|
|
||||||
# elif (ACC_CC_WATCOMC)
|
|
||||||
# include <i86.h>
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_OS216)
|
|
||||||
# if (ACC_CC_WATCOMC)
|
|
||||||
# include <i86.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
|
|
||||||
# if defined(FP_OFF)
|
|
||||||
# define ACC_FP_OFF(x) FP_OFF(x)
|
|
||||||
# elif defined(_FP_OFF)
|
|
||||||
# define ACC_FP_OFF(x) _FP_OFF(x)
|
|
||||||
# else
|
|
||||||
# define ACC_FP_OFF(x) (((const unsigned __far*)&(x))[0])
|
|
||||||
# endif
|
|
||||||
# if defined(FP_SEG)
|
|
||||||
# define ACC_FP_SEG(x) FP_SEG(x)
|
|
||||||
# elif defined(_FP_SEG)
|
|
||||||
# define ACC_FP_SEG(x) _FP_SEG(x)
|
|
||||||
# else
|
|
||||||
# define ACC_FP_SEG(x) (((const unsigned __far*)&(x))[1])
|
|
||||||
# endif
|
|
||||||
# if defined(MK_FP)
|
|
||||||
# define ACC_MK_FP(s,o) MK_FP(s,o)
|
|
||||||
# elif defined(_MK_FP)
|
|
||||||
# define ACC_MK_FP(s,o) _MK_FP(s,o)
|
|
||||||
# else
|
|
||||||
# define ACC_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
|
|
||||||
# endif
|
|
||||||
# if 0
|
|
||||||
# undef ACC_FP_OFF
|
|
||||||
# undef ACC_FP_SEG
|
|
||||||
# undef ACC_MK_FP
|
|
||||||
# define ACC_FP_OFF(x) (((const unsigned __far*)&(x))[0])
|
|
||||||
# define ACC_FP_SEG(x) (((const unsigned __far*)&(x))[1])
|
|
||||||
# define ACC_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,237 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// preprocessor
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* workaround for preprocessor bugs in some compilers */
|
|
||||||
#if 0
|
|
||||||
#define ACC_0xffffL 0xfffful
|
|
||||||
#define ACC_0xffffffffL 0xfffffffful
|
|
||||||
#else
|
|
||||||
#define ACC_0xffffL 65535ul
|
|
||||||
#define ACC_0xffffffffL 4294967295ul
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* some things we cannot work around */
|
|
||||||
#if (ACC_0xffffL == ACC_0xffffffffL)
|
|
||||||
# error "your preprocessor is broken 1"
|
|
||||||
#endif
|
|
||||||
#if (16ul * 16384ul != 262144ul)
|
|
||||||
# error "your preprocessor is broken 2"
|
|
||||||
#endif
|
|
||||||
#if 0
|
|
||||||
#if (32767 >= 4294967295ul)
|
|
||||||
# error "your preprocessor is broken 3"
|
|
||||||
#endif
|
|
||||||
#if (65535u >= 4294967295ul)
|
|
||||||
# error "your preprocessor is broken 4"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// try to detect specific compilers
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (UINT_MAX == ACC_0xffffL)
|
|
||||||
#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
|
|
||||||
# if !defined(MSDOS)
|
|
||||||
# define MSDOS 1
|
|
||||||
# endif
|
|
||||||
# if !defined(_MSDOS)
|
|
||||||
# define _MSDOS 1
|
|
||||||
# endif
|
|
||||||
#elif defined(__VERSION) && defined(MB_LEN_MAX)
|
|
||||||
# if (__VERSION == 520) && (MB_LEN_MAX == 1)
|
|
||||||
# if !defined(__AZTEC_C__)
|
|
||||||
# define __AZTEC_C__ __VERSION
|
|
||||||
# endif
|
|
||||||
# if !defined(__DOS__)
|
|
||||||
# define __DOS__ 1
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// fix incorrect and missing stuff
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* Microsoft C does not correctly define ptrdiff_t for
|
|
||||||
* the 16-bit huge memory model.
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL)
|
|
||||||
# define ptrdiff_t long
|
|
||||||
# define _PTRDIFF_T_DEFINED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Fix old compiler versions. */
|
|
||||||
#if (UINT_MAX == ACC_0xffffL)
|
|
||||||
# undef __ACC_RENAME_A
|
|
||||||
# undef __ACC_RENAME_B
|
|
||||||
# if defined(__AZTEC_C__) && defined(__DOS__)
|
|
||||||
# define __ACC_RENAME_A 1
|
|
||||||
# elif defined(_MSC_VER) && defined(MSDOS)
|
|
||||||
# if (_MSC_VER < 600)
|
|
||||||
# define __ACC_RENAME_A 1
|
|
||||||
# elif (_MSC_VER < 700)
|
|
||||||
# define __ACC_RENAME_B 1
|
|
||||||
# endif
|
|
||||||
# elif defined(__TSC__) && defined(__OS2__)
|
|
||||||
# define __ACC_RENAME_A 1
|
|
||||||
# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
|
|
||||||
# define __ACC_RENAME_A 1
|
|
||||||
# elif defined(__PACIFIC__) && defined(DOS)
|
|
||||||
# if !defined(__far)
|
|
||||||
# define __far far
|
|
||||||
# endif
|
|
||||||
# if !defined(__near)
|
|
||||||
# define __near near
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# if defined(__ACC_RENAME_A)
|
|
||||||
# if !defined(__cdecl)
|
|
||||||
# define __cdecl cdecl
|
|
||||||
# endif
|
|
||||||
# if !defined(__far)
|
|
||||||
# define __far far
|
|
||||||
# endif
|
|
||||||
# if !defined(__huge)
|
|
||||||
# define __huge huge
|
|
||||||
# endif
|
|
||||||
# if !defined(__near)
|
|
||||||
# define __near near
|
|
||||||
# endif
|
|
||||||
# if !defined(__pascal)
|
|
||||||
# define __pascal pascal
|
|
||||||
# endif
|
|
||||||
# if !defined(__huge)
|
|
||||||
# define __huge huge
|
|
||||||
# endif
|
|
||||||
# elif defined(__ACC_RENAME_B)
|
|
||||||
# if !defined(__cdecl)
|
|
||||||
# define __cdecl _cdecl
|
|
||||||
# endif
|
|
||||||
# if !defined(__far)
|
|
||||||
# define __far _far
|
|
||||||
# endif
|
|
||||||
# if !defined(__huge)
|
|
||||||
# define __huge _huge
|
|
||||||
# endif
|
|
||||||
# if !defined(__near)
|
|
||||||
# define __near _near
|
|
||||||
# endif
|
|
||||||
# if !defined(__pascal)
|
|
||||||
# define __pascal _pascal
|
|
||||||
# endif
|
|
||||||
# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
|
|
||||||
# if !defined(__cdecl)
|
|
||||||
# define __cdecl cdecl
|
|
||||||
# endif
|
|
||||||
# if !defined(__pascal)
|
|
||||||
# define __pascal pascal
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# undef __ACC_RENAME_A
|
|
||||||
# undef __ACC_RENAME_B
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (UINT_MAX == ACC_0xffffL)
|
|
||||||
#if defined(__AZTEC_C__) && defined(__DOS__)
|
|
||||||
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
|
|
||||||
#elif defined(_MSC_VER) && defined(MSDOS)
|
|
||||||
# if (_MSC_VER < 600)
|
|
||||||
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
|
|
||||||
# endif
|
|
||||||
# if (_MSC_VER < 700)
|
|
||||||
# define ACC_BROKEN_INTEGRAL_PROMOTION 1
|
|
||||||
# define ACC_BROKEN_SIZEOF 1
|
|
||||||
# endif
|
|
||||||
#elif defined(__PACIFIC__) && defined(DOS)
|
|
||||||
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
|
|
||||||
#elif defined(__TURBOC__) && defined(__MSDOS__)
|
|
||||||
# if (__TURBOC__ < 0x0150)
|
|
||||||
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
|
|
||||||
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
|
|
||||||
# define ACC_BROKEN_INTEGRAL_PROMOTION 1
|
|
||||||
# endif
|
|
||||||
# if (__TURBOC__ < 0x0200)
|
|
||||||
# define ACC_BROKEN_SIZEOF 1
|
|
||||||
# endif
|
|
||||||
# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
|
|
||||||
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
|
|
||||||
# endif
|
|
||||||
#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
|
|
||||||
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
|
|
||||||
# define ACC_BROKEN_SIZEOF 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
|
|
||||||
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// ANSI C preprocessor macros (cpp)
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#define ACC_CPP_STRINGIZE(x) #x
|
|
||||||
#define ACC_CPP_MACRO_EXPAND(x) ACC_CPP_STRINGIZE(x)
|
|
||||||
|
|
||||||
/* concatenate */
|
|
||||||
#define ACC_CPP_CONCAT2(a,b) a ## b
|
|
||||||
#define ACC_CPP_CONCAT3(a,b,c) a ## b ## c
|
|
||||||
#define ACC_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
|
|
||||||
#define ACC_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
|
|
||||||
|
|
||||||
/* expand and concatenate (by using one level of indirection) */
|
|
||||||
#define ACC_CPP_ECONCAT2(a,b) ACC_CPP_CONCAT2(a,b)
|
|
||||||
#define ACC_CPP_ECONCAT3(a,b,c) ACC_CPP_CONCAT3(a,b,c)
|
|
||||||
#define ACC_CPP_ECONCAT4(a,b,c,d) ACC_CPP_CONCAT4(a,b,c,d)
|
|
||||||
#define ACC_CPP_ECONCAT5(a,b,c,d,e) ACC_CPP_CONCAT5(a,b,c,d,e)
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// stdc macros
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
# undef __STDC_CONSTANT_MACROS
|
|
||||||
# undef __STDC_LIMIT_MACROS
|
|
||||||
# define __STDC_CONSTANT_MACROS 1
|
|
||||||
# define __STDC_LIMIT_MACROS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// misc macros
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
# define ACC_EXTERN_C extern "C"
|
|
||||||
#else
|
|
||||||
# define ACC_EXTERN_C extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(ACC_VERSION)
|
|
||||||
# if defined ACC_CONFIG_INCLUDE
|
|
||||||
# include ACC_CONFIG_INCLUDE("acc.h")
|
|
||||||
# else
|
|
||||||
# include "acc.h"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifndef __ACC_INCD_H_INCLUDED
|
|
||||||
# include ACC_CONFIG_INCLUDE("acc_incd.h")
|
|
||||||
#endif
|
|
||||||
#ifndef __ACC_INCE_H_INCLUDED
|
|
||||||
# include ACC_CONFIG_INCLUDE("acc_ince.h")
|
|
||||||
#endif
|
|
||||||
#ifndef __ACC_INCI_H_INCLUDED
|
|
||||||
# include ACC_CONFIG_INCLUDE("acc_inci.h")
|
|
||||||
#endif
|
|
||||||
#ifndef __ACC_LIB_H_INCLUDED
|
|
||||||
# include ACC_CONFIG_INCLUDE("acc_lib.h")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/bele.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/hmemcpy.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/hstring.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/halloc.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/dosalloc.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/hfread.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/hread.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/opendir.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/rand.ch")
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/misc.ch")
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* modules which use floating point are not included by default */
|
|
||||||
#include ACC_CONFIG_INCLUDE("acclib/uclock.ch")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,528 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ACC_LIB_H_INCLUDED
|
|
||||||
#define __ACC_LIB_H_INCLUDED 1
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__ACCLIB_FUNCNAME)
|
|
||||||
# define __ACCLIB_FUNCNAME(f) f
|
|
||||||
#endif
|
|
||||||
#if !defined(ACCLIB_EXTERN)
|
|
||||||
# define ACCLIB_EXTERN(r,f) extern r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__ACCLIB_CONST_CAST_RETURN)
|
|
||||||
#if (ACC_CC_GNUC)
|
|
||||||
# define __ACCLIB_CONST_CAST_RETURN(type,var) \
|
|
||||||
{ union { type a; const type b; } u; u.b = (var); return u.a; }
|
|
||||||
#else
|
|
||||||
# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (var);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_WIN64)
|
|
||||||
# define acclib_handle_t acc_int64l_t
|
|
||||||
# define acclib_uhandle_t acc_uint64l_t
|
|
||||||
#elif (ACC_ARCH_IA32 && ACC_CC_MSC && (_MSC_VER >= 1300))
|
|
||||||
typedef __w64 long acclib_handle_t;
|
|
||||||
typedef __w64 unsigned long acclib_uhandle_t;
|
|
||||||
# define acclib_handle_t acclib_handle_t
|
|
||||||
# define acclib_uhandle_t acclib_uhandle_t
|
|
||||||
#else
|
|
||||||
# define acclib_handle_t long
|
|
||||||
# define acclib_uhandle_t unsigned long
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// wrap <ctype.h>
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_digit) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_islower) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_isupper) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_tolower) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_toupper) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_utolower) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_utoupper) (int);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define acc_ascii_isdigit(c) (((unsigned)(c) - 48) < 10)
|
|
||||||
#define acc_ascii_islower(c) (((unsigned)(c) - 97) < 26)
|
|
||||||
#define acc_ascii_isupper(c) (((unsigned)(c) - 65) < 26)
|
|
||||||
#define acc_ascii_tolower(c) ((int)(c) + (acc_ascii_isupper(c) << 5))
|
|
||||||
#define acc_ascii_toupper(c) ((int)(c) - (acc_ascii_islower(c) << 5))
|
|
||||||
|
|
||||||
#define acc_ascii_utolower(c) acc_ascii_tolower((unsigned char)(c))
|
|
||||||
#define acc_ascii_utoupper(c) acc_ascii_toupper((unsigned char)(c))
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// huge pointer layer
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef acc_hsize_t
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
# define acc_hsize_t unsigned long
|
|
||||||
# define acc_hvoid_p void __huge *
|
|
||||||
# define acc_hchar_p char __huge *
|
|
||||||
# define acc_hchar_pp char __huge * __huge *
|
|
||||||
# define acc_hbyte_p unsigned char __huge *
|
|
||||||
#else
|
|
||||||
# define acc_hsize_t size_t
|
|
||||||
# define acc_hvoid_p void *
|
|
||||||
# define acc_hchar_p char *
|
|
||||||
# define acc_hchar_pp char **
|
|
||||||
# define acc_hbyte_p unsigned char *
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef ACC_FILE_P
|
|
||||||
#define ACC_FILE_P FILE *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* halloc */
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_halloc) (acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(void, acc_hfree) (acc_hvoid_p);
|
|
||||||
|
|
||||||
/* dos_alloc */
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_OS216)
|
|
||||||
ACCLIB_EXTERN(void __far*, acc_dos_alloc) (unsigned long);
|
|
||||||
ACCLIB_EXTERN(int, acc_dos_free) (void __far*);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* string */
|
|
||||||
ACCLIB_EXTERN(int, acc_hmemcmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemset) (acc_hvoid_p, int, acc_hsize_t);
|
|
||||||
|
|
||||||
/* string */
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrlen) (const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_hstrcmp) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_hstrncmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_hstricmp) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_hstrnicmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(int, acc_ascii_hmemicmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrstr) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstristr) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemimem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrcpy) (acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrcat) (acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(int, acc_hstrscpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(int, acc_hstrscat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrccpy) (acc_hchar_p, const acc_hchar_p, int);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemccpy) (acc_hvoid_p, const acc_hvoid_p, int, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrchr) (const acc_hchar_p, int);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrrchr) (const acc_hchar_p, int);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrichr) (const acc_hchar_p, int);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrrichr) (const acc_hchar_p, int);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemchr) (const acc_hvoid_p, int, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemrchr) (const acc_hvoid_p, int, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemichr) (const acc_hvoid_p, int, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemrichr) (const acc_hvoid_p, int, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrspn) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrrspn) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrcspn) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hstrrcspn) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrpbrk) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrrpbrk) (const acc_hchar_p, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrsep) (acc_hchar_pp, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_hstrrsep) (acc_hchar_pp, const acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrlwr) (acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrupr) (acc_hchar_p);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemlwr) (acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemupr) (acc_hvoid_p, acc_hsize_t);
|
|
||||||
|
|
||||||
/* stdio */
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hfread) (ACC_FILE_P, acc_hvoid_p, acc_hsize_t);
|
|
||||||
ACCLIB_EXTERN(acc_hsize_t, acc_hfwrite) (ACC_FILE_P, const acc_hvoid_p, acc_hsize_t);
|
|
||||||
|
|
||||||
/* io */
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
ACCLIB_EXTERN(long, acc_hread) (int, acc_hvoid_p, long);
|
|
||||||
ACCLIB_EXTERN(long, acc_hwrite) (int, const acc_hvoid_p, long);
|
|
||||||
#endif
|
|
||||||
ACCLIB_EXTERN(long, acc_safe_hread) (int, acc_hvoid_p, long);
|
|
||||||
ACCLIB_EXTERN(long, acc_safe_hwrite) (int, const acc_hvoid_p, long);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// wrap filename limits
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
/* maximum length of full pathname (excl. '\0') */
|
|
||||||
#if !defined(ACC_FN_PATH_MAX)
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
# define ACC_FN_PATH_MAX 143
|
|
||||||
#elif (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# define ACC_FN_PATH_MAX 259
|
|
||||||
#elif (ACC_OS_TOS)
|
|
||||||
# define ACC_FN_PATH_MAX 259
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if !defined(ACC_FN_PATH_MAX)
|
|
||||||
/* arbitrary limit for acclib implementation */
|
|
||||||
# define ACC_FN_PATH_MAX 1024
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* maximum length of a filename (a single path component) (excl. '\0') */
|
|
||||||
#if !defined(ACC_FN_NAME_MAX)
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
# define ACC_FN_NAME_MAX 12
|
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
|
||||||
# define ACC_FN_NAME_MAX 12
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
#elif (ACC_OS_DOS32)
|
|
||||||
# define ACC_FN_NAME_MAX 12
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if !defined(ACC_FN_NAME_MAX)
|
|
||||||
# define ACC_FN_NAME_MAX ACC_FN_PATH_MAX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define ACC_FNMATCH_NOESCAPE 1
|
|
||||||
#define ACC_FNMATCH_PATHNAME 2
|
|
||||||
#define ACC_FNMATCH_PATHSTAR 4
|
|
||||||
#define ACC_FNMATCH_PERIOD 8
|
|
||||||
#define ACC_FNMATCH_ASCII_CASEFOLD 16
|
|
||||||
ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// wrap <dirent.h>
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#undef __ACCLIB_USE_OPENDIR
|
|
||||||
#if (HAVE_DIRENT_H || ACC_CC_WATCOMC)
|
|
||||||
# define __ACCLIB_USE_OPENDIR 1
|
|
||||||
# if (ACC_OS_DOS32 && defined(__BORLANDC__))
|
|
||||||
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
# elif (ACC_OS_OS2 || ACC_OS_OS216)
|
|
||||||
# elif (ACC_OS_TOS && ACC_CC_GNUC)
|
|
||||||
# elif (ACC_OS_WIN32 && !defined(ACC_HAVE_WINDOWS_H))
|
|
||||||
# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# undef __ACCLIB_USE_OPENDIR
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
#if defined(__ACCLIB_USE_OPENDIR)
|
|
||||||
void *u_dirp; /* private */
|
|
||||||
# if (ACC_CC_WATCOMC)
|
|
||||||
unsigned short f_time;
|
|
||||||
unsigned short f_date;
|
|
||||||
unsigned long f_size;
|
|
||||||
# endif
|
|
||||||
char f_name[ACC_FN_NAME_MAX+1];
|
|
||||||
#elif (ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
acclib_handle_t u_handle; /* private */
|
|
||||||
unsigned f_attr;
|
|
||||||
unsigned f_size_low;
|
|
||||||
unsigned f_size_high;
|
|
||||||
char f_name[ACC_FN_NAME_MAX+1];
|
|
||||||
#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_TOS || ACC_OS_WIN16)
|
|
||||||
char u_dta[21]; /* private */
|
|
||||||
unsigned char f_attr;
|
|
||||||
unsigned short f_time;
|
|
||||||
unsigned short f_date;
|
|
||||||
unsigned short f_size_low;
|
|
||||||
unsigned short f_size_high;
|
|
||||||
char f_name[ACC_FN_NAME_MAX+1];
|
|
||||||
char u_dirp; /* private */
|
|
||||||
#else
|
|
||||||
void *u_dirp; /* private */
|
|
||||||
char f_name[ACC_FN_NAME_MAX+1];
|
|
||||||
#endif
|
|
||||||
} acc_dir_t;
|
|
||||||
|
|
||||||
#ifndef acc_dir_p
|
|
||||||
#define acc_dir_p acc_dir_t *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(int, acc_opendir) (acc_dir_p, const char*);
|
|
||||||
ACCLIB_EXTERN(int, acc_readdir) (acc_dir_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_closedir) (acc_dir_p);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// wrap misc
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__))
|
|
||||||
# define acc_alloca(x) __builtin_alloca((x))
|
|
||||||
#elif (ACC_CC_BORLANDC) && defined(__linux__)
|
|
||||||
/* FIXME: alloca does not work */
|
|
||||||
#elif (HAVE_ALLOCA)
|
|
||||||
# define acc_alloca(x) alloca((x))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif (ACC_ARCH_IA16 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0410))
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif (ACC_ARCH_IA16 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0400))
|
|
||||||
# if (ACC_OS_WIN16) && (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
# else
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
# endif
|
|
||||||
#elif ((ACC_ARCH_IA16 || ACC_ARCH_IA32) && (ACC_CC_DMC || ACC_CC_SYMANTECC))
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif ((ACC_ARCH_IA16) && ACC_CC_MSC && (_MSC_VER >= 700))
|
|
||||||
# define acc_stackavail() _stackavail()
|
|
||||||
#elif ((ACC_ARCH_IA16) && ACC_CC_MSC)
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif ((ACC_ARCH_IA16 || ACC_ARCH_IA32) && ACC_CC_TURBOC && (__TURBOC__ >= 0x0450))
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif (ACC_ARCH_IA16 && ACC_CC_TURBOC && (__TURBOC__ >= 0x0400))
|
|
||||||
ACC_EXTERN_C size_t __cdecl stackavail(void);
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif ((ACC_ARCH_IA16 || ACC_ARCH_IA32) && (ACC_CC_WATCOMC))
|
|
||||||
# define acc_stackavail() stackavail()
|
|
||||||
#elif (ACC_ARCH_IA16 && ACC_CC_ZORTECHC)
|
|
||||||
# define acc_stackavail() _chkstack()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_isatty) (int);
|
|
||||||
ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned);
|
|
||||||
ACCLIB_EXTERN(int, acc_response) (int*, char***);
|
|
||||||
ACCLIB_EXTERN(int, acc_set_binmode) (int, int);
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(acc_int32l_t, acc_muldiv32) (acc_int32l_t, acc_int32l_t, acc_int32l_t);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_umuldiv32) (acc_uint32l_t, acc_uint32l_t, acc_uint32l_t);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// uclock (real, i.e. "wall" clock)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
ACCLIB_EXTERN(int, acc_tsc_read) (acc_uint32e_t*);
|
|
||||||
ACCLIB_EXTERN(int, acc_tsc_read_add) (acc_uint32e_t*);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct { /* all private */
|
|
||||||
acclib_handle_t h;
|
|
||||||
int mode;
|
|
||||||
#if (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
|
|
||||||
double qpf;
|
|
||||||
#endif
|
|
||||||
} acc_uclock_handle_t;
|
|
||||||
|
|
||||||
typedef struct { /* all private */
|
|
||||||
union {
|
|
||||||
acc_uint32l_t t32;
|
|
||||||
#if !(ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
double td;
|
|
||||||
# if defined(acc_int64l_t)
|
|
||||||
acc_int64l_t t64;
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
} ticks;
|
|
||||||
#if (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
|
|
||||||
acc_int64l_t qpc;
|
|
||||||
#endif
|
|
||||||
} acc_uclock_t;
|
|
||||||
|
|
||||||
#ifndef acc_uclock_handle_p
|
|
||||||
#define acc_uclock_handle_p acc_uclock_handle_t *
|
|
||||||
#endif
|
|
||||||
#ifndef acc_uclock_p
|
|
||||||
#define acc_uclock_p acc_uclock_t *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(int, acc_uclock_open) (acc_uclock_handle_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_uclock_close) (acc_uclock_handle_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_uclock_read) (acc_uclock_handle_p, acc_uclock_p);
|
|
||||||
ACCLIB_EXTERN(double, acc_uclock_get_elapsed) (acc_uclock_handle_p, const acc_uclock_p, const acc_uclock_p);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// performance counters (virtual clock)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(acc_int64l_t)
|
|
||||||
|
|
||||||
typedef struct { /* all private */
|
|
||||||
#if (ACC_OS_POSIX_LINUX)
|
|
||||||
void* h;
|
|
||||||
unsigned cpu_type, cpu_features, cpu_khz, cpu_nrctrs;
|
|
||||||
const char* cpu_name;
|
|
||||||
#else
|
|
||||||
void* h;
|
|
||||||
#endif
|
|
||||||
} acc_perfctr_handle_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
acc_uint64l_t tsc;
|
|
||||||
#if (ACC_OS_POSIX_LINUX)
|
|
||||||
acc_uint64l_t pmc[18];
|
|
||||||
#else
|
|
||||||
acc_uint64l_t pmc[1];
|
|
||||||
#endif
|
|
||||||
} acc_perfctr_clock_t;
|
|
||||||
|
|
||||||
#ifndef acc_perfctr_handle_p
|
|
||||||
#define acc_perfctr_handle_p acc_perfctr_handle_t *
|
|
||||||
#endif
|
|
||||||
#ifndef acc_perfctr_clock_p
|
|
||||||
#define acc_perfctr_clock_p acc_perfctr_clock_t *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(int, acc_perfctr_open) (acc_perfctr_handle_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_perfctr_close) (acc_perfctr_handle_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_perfctr_read) (acc_perfctr_handle_p, acc_perfctr_clock_p);
|
|
||||||
ACCLIB_EXTERN(double, acc_perfctr_get_elapsed) (acc_perfctr_handle_p, const acc_perfctr_clock_p, const acc_perfctr_clock_p);
|
|
||||||
ACCLIB_EXTERN(double, acc_perfctr_get_elapsed_tsc) (acc_perfctr_handle_p, acc_uint64l_t);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// Big Endian / Little Endian
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(unsigned, acc_get_be16) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_get_be24) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_get_be32) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_be16) (acc_hvoid_p, unsigned);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_be24) (acc_hvoid_p, acc_uint32l_t);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_be32) (acc_hvoid_p, acc_uint32l_t);
|
|
||||||
ACCLIB_EXTERN(unsigned, acc_get_le16) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_get_le24) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_get_le32) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_le16) (acc_hvoid_p, unsigned);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_le24) (acc_hvoid_p, acc_uint32l_t);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_le32) (acc_hvoid_p, acc_uint32l_t);
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
ACCLIB_EXTERN(acc_uint64l_t, acc_get_be64) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_be64) (acc_hvoid_p, acc_uint64l_t);
|
|
||||||
ACCLIB_EXTERN(acc_uint64l_t, acc_get_le64) (const acc_hvoid_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_set_le64) (acc_hvoid_p, acc_uint64l_t);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* inline versions */
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
# define ACC_GET_LE16(p) (* (const unsigned short *) (p))
|
|
||||||
# define ACC_GET_LE32(p) (* (const acc_uint32e_t *) (p))
|
|
||||||
# define ACC_SET_LE16(p,v) (* (unsigned short *) (p) = (unsigned short) (v))
|
|
||||||
# define ACC_SET_LE32(p,v) (* (acc_uint32e_t *) (p) = (acc_uint32e_t) (v))
|
|
||||||
#endif
|
|
||||||
#if (ACC_ARCH_AMD64)
|
|
||||||
# define ACC_GET_LE64(p) (* (const acc_uint64l_t *) (p))
|
|
||||||
# define ACC_SET_LE64(p,v) (* (acc_uint64l_t *) (p) = (acc_uint64l_t) (v))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// getopt
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
const char* name;
|
|
||||||
int has_arg;
|
|
||||||
int* flag;
|
|
||||||
int val;
|
|
||||||
} acc_getopt_longopt_t;
|
|
||||||
#ifndef acc_getopt_longopt_p
|
|
||||||
#define acc_getopt_longopt_p acc_getopt_longopt_t *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int go_argc;
|
|
||||||
char** go_argv;
|
|
||||||
const char* go_shortopts;
|
|
||||||
const acc_getopt_longopt_p longopts;
|
|
||||||
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
|
|
||||||
int __acc_cdecl_va (*go_error)(const char *, ...);
|
|
||||||
#else
|
|
||||||
int (__acc_cdecl_va *go_error)(const char *, ...);
|
|
||||||
#endif
|
|
||||||
} acc_getopt_t;
|
|
||||||
#ifndef acc_getopt_p
|
|
||||||
#define acc_getopt_p acc_getopt_t *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ACCLIB_EXTERN(void, acc_getopt_init) (acc_getopt_p);
|
|
||||||
ACCLIB_EXTERN(int, acc_getopt) (acc_getopt_p);
|
|
||||||
ACCLIB_EXTERN(void, acc_getopt_close)(acc_getopt_p);
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// rand
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
typedef struct { /* all private */
|
|
||||||
acc_uint32l_t seed;
|
|
||||||
} acc_rand31_t;
|
|
||||||
#ifndef acc_rand31_p
|
|
||||||
#define acc_rand31_p acc_rand31_t *
|
|
||||||
#endif
|
|
||||||
ACCLIB_EXTERN(void, acc_srand31) (acc_rand31_p, acc_uint32l_t);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_rand31) (acc_rand31_p);
|
|
||||||
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
typedef struct { /* all private */
|
|
||||||
acc_uint64l_t seed;
|
|
||||||
} acc_rand48_t;
|
|
||||||
#ifndef acc_rand48_p
|
|
||||||
#define acc_rand48_p acc_rand48_t *
|
|
||||||
#endif
|
|
||||||
ACCLIB_EXTERN(void, acc_srand48) (acc_rand48_p, acc_uint32l_t);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_rand48) (acc_rand48_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
typedef struct { /* all private */
|
|
||||||
acc_uint64l_t seed;
|
|
||||||
} acc_rand64_t;
|
|
||||||
#ifndef acc_rand64_p
|
|
||||||
#define acc_rand64_p acc_rand64_t *
|
|
||||||
#endif
|
|
||||||
ACCLIB_EXTERN(void, acc_srand64) (acc_rand64_p, acc_uint64l_t);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_rand64) (acc_rand64_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct { /* all private */
|
|
||||||
unsigned n;
|
|
||||||
acc_uint32l_t s[624];
|
|
||||||
} acc_randmt_t;
|
|
||||||
#ifndef acc_randmt_p
|
|
||||||
#define acc_randmt_p acc_randmt_t *
|
|
||||||
#endif
|
|
||||||
ACCLIB_EXTERN(void, acc_srandmt) (acc_randmt_p, acc_uint32l_t);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_randmt) (acc_randmt_p);
|
|
||||||
ACCLIB_EXTERN(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Memory Model - exactly one of:
|
|
||||||
*
|
|
||||||
* ACC_MM_FLAT [default]
|
|
||||||
* ACC_MM_TINY
|
|
||||||
* ACC_MM_SMALL
|
|
||||||
* ACC_MM_MEDIUM
|
|
||||||
* ACC_MM_COMPACT
|
|
||||||
* ACC_MM_LARGE
|
|
||||||
* ACC_MM_HUGE
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
|
|
||||||
|
|
||||||
#if (UINT_MAX != ACC_0xffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
#endif
|
|
||||||
#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
|
|
||||||
# define ACC_MM_TINY 1
|
|
||||||
#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
|
|
||||||
# define ACC_MM_HUGE 1
|
|
||||||
#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
|
|
||||||
# define ACC_MM_SMALL 1
|
|
||||||
#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
|
|
||||||
# define ACC_MM_MEDIUM 1
|
|
||||||
#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
|
|
||||||
# define ACC_MM_COMPACT 1
|
|
||||||
#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
|
|
||||||
# define ACC_MM_LARGE 1
|
|
||||||
#elif (ACC_CC_AZTECC)
|
|
||||||
# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
|
|
||||||
# define ACC_MM_LARGE 1
|
|
||||||
# elif defined(_LARGE_CODE)
|
|
||||||
# define ACC_MM_MEDIUM 1
|
|
||||||
# elif defined(_LARGE_DATA)
|
|
||||||
# define ACC_MM_COMPACT 1
|
|
||||||
# else
|
|
||||||
# define ACC_MM_SMALL 1
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_ZORTECHC && defined(__VCM__))
|
|
||||||
# define ACC_MM_LARGE 1
|
|
||||||
#else
|
|
||||||
# error "unknown memory model"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* ACC_HAVE_MM_HUGE_PTR ... working __huge pointers
|
|
||||||
* ACC_HAVE_MM_HUGE_ARRAY ... char __huge x[256*1024L] works */
|
|
||||||
#define ACC_HAVE_MM_HUGE_PTR 1
|
|
||||||
#define ACC_HAVE_MM_HUGE_ARRAY 1
|
|
||||||
|
|
||||||
#if (ACC_MM_TINY)
|
|
||||||
# undef ACC_HAVE_MM_HUGE_ARRAY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_ZORTECHC)
|
|
||||||
# undef ACC_HAVE_MM_HUGE_PTR
|
|
||||||
# undef ACC_HAVE_MM_HUGE_ARRAY
|
|
||||||
#elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
|
|
||||||
# undef ACC_HAVE_MM_HUGE_ARRAY
|
|
||||||
#elif (ACC_CC_MSC && defined(_QC))
|
|
||||||
# undef ACC_HAVE_MM_HUGE_ARRAY
|
|
||||||
# if (_MSC_VER < 600)
|
|
||||||
# undef ACC_HAVE_MM_HUGE_PTR
|
|
||||||
# endif
|
|
||||||
#elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295))
|
|
||||||
# undef ACC_HAVE_MM_HUGE_ARRAY
|
|
||||||
#elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1200))
|
|
||||||
/* pointer arithmetics with __huge arrays seems broken in OpenWatcom 1.x */
|
|
||||||
# undef ACC_HAVE_MM_HUGE_ARRAY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
|
|
||||||
extern void __near __cdecl _AHSHIFT(void);
|
|
||||||
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
|
|
||||||
#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
extern void __near __cdecl _AHSHIFT(void);
|
|
||||||
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
|
|
||||||
#elif (ACC_CC_MSC || ACC_CC_TOPSPEEDC)
|
|
||||||
extern void __near __cdecl _AHSHIFT(void);
|
|
||||||
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
|
|
||||||
#elif (ACC_CC_TURBOC && (__TURBOC__ >= 0x0295))
|
|
||||||
extern void __near __cdecl _AHSHIFT(void);
|
|
||||||
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
|
|
||||||
#elif ((ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_TURBOC) && ACC_OS_DOS16)
|
|
||||||
# define ACC_MM_AHSHIFT 12
|
|
||||||
#elif (ACC_CC_WATCOMC)
|
|
||||||
extern unsigned char _HShift;
|
|
||||||
# define ACC_MM_AHSHIFT ((unsigned) _HShift)
|
|
||||||
#else
|
|
||||||
# error "FIXME - implement ACC_MM_AHSHIFT"
|
|
||||||
#endif
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#elif (ACC_ARCH_C166)
|
|
||||||
#if !defined(__MODEL__)
|
|
||||||
# error "FIXME - C166 __MODEL__"
|
|
||||||
#elif ((__MODEL__) == 0)
|
|
||||||
# define ACC_MM_SMALL 1
|
|
||||||
#elif ((__MODEL__) == 1)
|
|
||||||
# define ACC_MM_SMALL 1
|
|
||||||
#elif ((__MODEL__) == 2)
|
|
||||||
# define ACC_MM_LARGE 1
|
|
||||||
#elif ((__MODEL__) == 3)
|
|
||||||
# define ACC_MM_TINY 1
|
|
||||||
#elif ((__MODEL__) == 4)
|
|
||||||
# define ACC_MM_XTINY 1
|
|
||||||
#elif ((__MODEL__) == 5)
|
|
||||||
# define ACC_MM_XSMALL 1
|
|
||||||
#else
|
|
||||||
# error "FIXME - C166 __MODEL__"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#elif (ACC_ARCH_MCS251)
|
|
||||||
#if !defined(__MODEL__)
|
|
||||||
# error "FIXME - MCS251 __MODEL__"
|
|
||||||
#elif ((__MODEL__) == 0)
|
|
||||||
# define ACC_MM_SMALL 1
|
|
||||||
#elif ((__MODEL__) == 2)
|
|
||||||
# define ACC_MM_LARGE 1
|
|
||||||
#elif ((__MODEL__) == 3)
|
|
||||||
# define ACC_MM_TINY 1
|
|
||||||
#elif ((__MODEL__) == 4)
|
|
||||||
# define ACC_MM_XTINY 1
|
|
||||||
#elif ((__MODEL__) == 5)
|
|
||||||
# define ACC_MM_XSMALL 1
|
|
||||||
#else
|
|
||||||
# error "FIXME - MCS251 __MODEL__"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#elif (ACC_ARCH_MCS51)
|
|
||||||
#if !defined(__MODEL__)
|
|
||||||
# error "FIXME - MCS51 __MODEL__"
|
|
||||||
#elif ((__MODEL__) == 1)
|
|
||||||
# define ACC_MM_SMALL 1
|
|
||||||
#elif ((__MODEL__) == 2)
|
|
||||||
# define ACC_MM_LARGE 1
|
|
||||||
#elif ((__MODEL__) == 3)
|
|
||||||
# define ACC_MM_TINY 1
|
|
||||||
#elif ((__MODEL__) == 4)
|
|
||||||
# define ACC_MM_XTINY 1
|
|
||||||
#elif ((__MODEL__) == 5)
|
|
||||||
# define ACC_MM_XSMALL 1
|
|
||||||
#else
|
|
||||||
# error "FIXME - MCS51 __MODEL__"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
# define ACC_MM_FLAT 1
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_MM_FLAT)
|
|
||||||
# define ACC_INFO_MM "flat"
|
|
||||||
#elif (ACC_MM_TINY)
|
|
||||||
# define ACC_INFO_MM "tiny"
|
|
||||||
#elif (ACC_MM_SMALL)
|
|
||||||
# define ACC_INFO_MM "small"
|
|
||||||
#elif (ACC_MM_MEDIUM)
|
|
||||||
# define ACC_INFO_MM "medium"
|
|
||||||
#elif (ACC_MM_COMPACT)
|
|
||||||
# define ACC_INFO_MM "compact"
|
|
||||||
#elif (ACC_MM_LARGE)
|
|
||||||
# define ACC_INFO_MM "large"
|
|
||||||
#elif (ACC_MM_HUGE)
|
|
||||||
# define ACC_INFO_MM "huge"
|
|
||||||
#else
|
|
||||||
# error "unknown memory model"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Operating System - exactly one of:
|
|
||||||
*
|
|
||||||
* ACC_OS_POSIX [default]
|
|
||||||
* ACC_OS_AMIGAOS
|
|
||||||
* ACC_OS_BEOS
|
|
||||||
* ACC_OS_CYGWIN hybrid WIN32 and POSIX
|
|
||||||
* ACC_OS_DOS16 16-bit DOS (segmented memory model)
|
|
||||||
* ACC_OS_DOS32
|
|
||||||
* ACC_OS_EMX hybrid OS/2, DOS32, WIN32 (with RSX) and POSIX
|
|
||||||
* ACC_OS_MACCLASSIC Macintosh Classic
|
|
||||||
* ACC_OS_PALMOS
|
|
||||||
* ACC_OS_OS2 OS/2
|
|
||||||
* ACC_OS_OS216 16-bit OS/2 1.x (segmented memory model)
|
|
||||||
* ACC_OS_QNX
|
|
||||||
* ACC_OS_RISCOS
|
|
||||||
* ACC_OS_TOS Atari TOS / MiNT
|
|
||||||
* ACC_OS_VMS
|
|
||||||
* ACC_OS_WIN16 16-bit Windows 3.x (segmented memory model)
|
|
||||||
* ACC_OS_WIN32
|
|
||||||
* ACC_OS_WIN64 64-bit Windows (LLP64 programming model)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__CYGWIN__) && defined(__GNUC__)
|
|
||||||
# define ACC_OS_CYGWIN 1
|
|
||||||
# define ACC_INFO_OS "cygwin"
|
|
||||||
#elif defined(__EMX__) && defined(__GNUC__)
|
|
||||||
# define ACC_OS_EMX 1
|
|
||||||
# define ACC_INFO_OS "emx"
|
|
||||||
#elif defined(__BEOS__)
|
|
||||||
# define ACC_OS_BEOS 1
|
|
||||||
# define ACC_INFO_OS "beos"
|
|
||||||
#elif defined(__QNX__)
|
|
||||||
# define ACC_OS_QNX 1
|
|
||||||
# define ACC_INFO_OS "qnx"
|
|
||||||
#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
|
|
||||||
# define ACC_OS_DOS32 1
|
|
||||||
# define ACC_INFO_OS "dos32"
|
|
||||||
#elif defined(__BORLANDC__) && defined(__DPMI16__)
|
|
||||||
# define ACC_OS_DOS16 1
|
|
||||||
# define ACC_INFO_OS "dos16"
|
|
||||||
#elif defined(__ZTC__) && defined(DOS386)
|
|
||||||
# define ACC_OS_DOS32 1
|
|
||||||
# define ACC_INFO_OS "dos32"
|
|
||||||
#elif defined(__OS2__) || defined(__OS2V2__)
|
|
||||||
# if (UINT_MAX == ACC_0xffffL)
|
|
||||||
# define ACC_OS_OS216 1
|
|
||||||
# define ACC_INFO_OS "os216"
|
|
||||||
# elif (UINT_MAX == ACC_0xffffffffL)
|
|
||||||
# define ACC_OS_OS2 1
|
|
||||||
# define ACC_INFO_OS "os2"
|
|
||||||
# else
|
|
||||||
# error "check your limits.h header"
|
|
||||||
# endif
|
|
||||||
#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
|
|
||||||
# define ACC_OS_WIN64 1
|
|
||||||
# define ACC_INFO_OS "win64"
|
|
||||||
#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
|
|
||||||
# define ACC_OS_WIN32 1
|
|
||||||
# define ACC_INFO_OS "win32"
|
|
||||||
#elif defined(__MWERKS__) && defined(__INTEL__)
|
|
||||||
# define ACC_OS_WIN32 1
|
|
||||||
# define ACC_INFO_OS "win32"
|
|
||||||
#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
|
|
||||||
# if (UINT_MAX == ACC_0xffffL)
|
|
||||||
# define ACC_OS_WIN16 1
|
|
||||||
# define ACC_INFO_OS "win16"
|
|
||||||
# elif (UINT_MAX == ACC_0xffffffffL)
|
|
||||||
# define ACC_OS_WIN32 1
|
|
||||||
# define ACC_INFO_OS "win32"
|
|
||||||
# else
|
|
||||||
# error "check your limits.h header"
|
|
||||||
# endif
|
|
||||||
#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
|
|
||||||
# if (UINT_MAX == ACC_0xffffL)
|
|
||||||
# define ACC_OS_DOS16 1
|
|
||||||
# define ACC_INFO_OS "dos16"
|
|
||||||
# elif (UINT_MAX == ACC_0xffffffffL)
|
|
||||||
# define ACC_OS_DOS32 1
|
|
||||||
# define ACC_INFO_OS "dos32"
|
|
||||||
# else
|
|
||||||
# error "check your limits.h header"
|
|
||||||
# endif
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
# if defined(__NT__) && (UINT_MAX == ACC_0xffffL)
|
|
||||||
/* wcl: NT host defaults to DOS target */
|
|
||||||
# define ACC_OS_DOS16 1
|
|
||||||
# define ACC_INFO_OS "dos16"
|
|
||||||
# elif defined(__NT__) && (__WATCOMC__ < 1100)
|
|
||||||
/* wcl386: Watcom C 11 defines _WIN32 */
|
|
||||||
# define ACC_OS_WIN32 1
|
|
||||||
# define ACC_INFO_OS "win32"
|
|
||||||
# else
|
|
||||||
# error "please specify a target using the -bt compiler option"
|
|
||||||
# endif
|
|
||||||
#elif defined(__palmos__)
|
|
||||||
# if (UINT_MAX == ACC_0xffffL)
|
|
||||||
# define ACC_OS_PALMOS 1
|
|
||||||
# define ACC_INFO_OS "palmos"
|
|
||||||
# else
|
|
||||||
# error "check your limits.h header"
|
|
||||||
# endif
|
|
||||||
#elif defined(__TOS__) || defined(__atarist__)
|
|
||||||
# define ACC_OS_TOS 1
|
|
||||||
# define ACC_INFO_OS "tos"
|
|
||||||
#elif defined(macintosh) && !defined(__ppc__)
|
|
||||||
# define ACC_OS_MACCLASSIC 1
|
|
||||||
# define ACC_INFO_OS "macclassic"
|
|
||||||
#elif defined(__VMS)
|
|
||||||
# define ACC_OS_VMS 1
|
|
||||||
# define ACC_INFO_OS "vms"
|
|
||||||
#else
|
|
||||||
# define ACC_OS_POSIX 1
|
|
||||||
# define ACC_INFO_OS "posix"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_POSIX)
|
|
||||||
# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
|
|
||||||
# define ACC_OS_POSIX_AIX 1
|
|
||||||
# define ACC_INFO_OS_POSIX "aix"
|
|
||||||
# elif defined(__FreeBSD__)
|
|
||||||
# define ACC_OS_POSIX_FREEBSD 1
|
|
||||||
# define ACC_INFO_OS_POSIX "freebsd"
|
|
||||||
# elif defined(__hpux__) || defined(__hpux)
|
|
||||||
# define ACC_OS_POSIX_HPUX 1
|
|
||||||
# define ACC_INFO_OS_POSIX "hpux"
|
|
||||||
# elif defined(__IRIX__) || defined(__irix__)
|
|
||||||
# define ACC_OS_POSIX_IRIX 1
|
|
||||||
# define ACC_INFO_OS_POSIX "irix"
|
|
||||||
# elif defined(__linux__) || defined(__linux)
|
|
||||||
# define ACC_OS_POSIX_LINUX 1
|
|
||||||
# define ACC_INFO_OS_POSIX "linux"
|
|
||||||
# elif defined(__APPLE__) || defined(__MACOS__)
|
|
||||||
# define ACC_OS_POSIX_MACOSX 1
|
|
||||||
# define ACC_INFO_OS_POSIX "macosx"
|
|
||||||
# elif defined(__NetBSD__)
|
|
||||||
# define ACC_OS_POSIX_NETBSD 1
|
|
||||||
# define ACC_INFO_OS_POSIX "netbsd"
|
|
||||||
# elif defined(__OpenBSD__)
|
|
||||||
# define ACC_OS_POSIX_OPENBSD 1
|
|
||||||
# define ACC_INFO_OS_POSIX "openbsd"
|
|
||||||
# elif defined(__osf__)
|
|
||||||
# define ACC_OS_POSIX_OSF 1
|
|
||||||
# define ACC_INFO_OS_POSIX "osf"
|
|
||||||
# elif defined(__solaris__) || defined(__sun)
|
|
||||||
# if defined(__SVR4) || defined(__svr4__)
|
|
||||||
# define ACC_OS_POSIX_SOLARIS 1
|
|
||||||
# define ACC_INFO_OS_POSIX "solaris"
|
|
||||||
# else
|
|
||||||
# define ACC_OS_POSIX_SUNOS 1
|
|
||||||
# define ACC_INFO_OS_POSIX "sunos"
|
|
||||||
# endif
|
|
||||||
# elif defined(__ultrix__) || defined(__ultrix)
|
|
||||||
# define ACC_OS_POSIX_ULTRIX 1
|
|
||||||
# define ACC_INFO_OS_POSIX "ultrix"
|
|
||||||
# else
|
|
||||||
# define ACC_OS_POSIX_UNKNOWN 1
|
|
||||||
# define ACC_INFO_OS_POSIX "unknown"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
|
|
||||||
# if (UINT_MAX != ACC_0xffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
# if (ULONG_MAX != ACC_0xffffffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# if (UINT_MAX != ACC_0xffffffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
# if (ULONG_MAX != ACC_0xffffffffL)
|
|
||||||
# error "this should not happen"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,319 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
//
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_CC_GNUC >= 0x020800ul) /* 2.8.0 */
|
|
||||||
# define __acc_gnuc_extension__ __extension__
|
|
||||||
#else
|
|
||||||
# define __acc_gnuc_extension__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (SIZEOF_LONG_LONG > 0)
|
|
||||||
__acc_gnuc_extension__ typedef long long acc_llong_t;
|
|
||||||
#endif
|
|
||||||
#if (SIZEOF_UNSIGNED_LONG_LONG > 0)
|
|
||||||
__acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (!(SIZEOF_SHORT > 0 && SIZEOF_INT > 0 && SIZEOF_LONG > 0))
|
|
||||||
# error "missing defines for sizes"
|
|
||||||
#endif
|
|
||||||
#if (!(SIZEOF_PTRDIFF_T > 0 && SIZEOF_SIZE_T > 0 && SIZEOF_VOID_P > 0 && SIZEOF_CHAR_P > 0))
|
|
||||||
# error "missing defines for sizes"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// some <stdint.h> types:
|
|
||||||
// required: least & fast: acc_int32l_t, acc_int32f_t
|
|
||||||
// optional: exact32 acc_int32e_t
|
|
||||||
// optional: least64 acc_int64l_t
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* acc_int32e_t is int32_t in <stdint.h> terminology */
|
|
||||||
#if !defined(acc_int32e_t)
|
|
||||||
#if (SIZEOF_INT == 4)
|
|
||||||
# define acc_int32e_t int
|
|
||||||
# define acc_uint32e_t unsigned int
|
|
||||||
# define ACC_INT32E_C(c) c
|
|
||||||
# define ACC_UINT32E_C(c) c##U
|
|
||||||
#elif (SIZEOF_LONG == 4)
|
|
||||||
# define acc_int32e_t long int
|
|
||||||
# define acc_uint32e_t unsigned long int
|
|
||||||
# define ACC_INT32E_C(c) c##L
|
|
||||||
# define ACC_UINT32E_C(c) c##UL
|
|
||||||
#elif (SIZEOF_SHORT == 4)
|
|
||||||
# define acc_int32e_t short int
|
|
||||||
# define acc_uint32e_t unsigned short int
|
|
||||||
# define ACC_INT32E_C(c) c
|
|
||||||
# define ACC_UINT32E_C(c) c##U
|
|
||||||
#elif (SIZEOF_LONG_LONG == 4 && SIZEOF_UNSIGNED_LONG_LONG == 4)
|
|
||||||
# define acc_int32e_t acc_llong_t
|
|
||||||
# define acc_uint32e_t acc_ullong_t
|
|
||||||
# define ACC_INT32E_C(c) c##LL
|
|
||||||
# define ACC_UINT32E_C(c) c##ULL
|
|
||||||
#elif (SIZEOF___INT32 == 4 && SIZEOF_UNSIGNED___INT32 == 4)
|
|
||||||
# define acc_int32e_t __int32
|
|
||||||
# define acc_uint32e_t unsigned __int32
|
|
||||||
# if (SIZEOF_INT > 4)
|
|
||||||
# define ACC_INT32E_C(c) c
|
|
||||||
# define ACC_UINT32E_C(c) c##U
|
|
||||||
# elif (SIZEOF_LONG > 4)
|
|
||||||
# define ACC_INT32E_C(c) c##L
|
|
||||||
# define ACC_UINT32E_C(c) c##UL
|
|
||||||
# else
|
|
||||||
# define ACC_INT32E_C(c) c##i32
|
|
||||||
# define ACC_UINT32E_C(c) c##ui32
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
/* no exact 32-bit integral type on this machine */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
# define SIZEOF_ACC_INT32E_T 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* acc_int32l_t is int_least32_t in <stdint.h> terminology */
|
|
||||||
#if !defined(acc_int32l_t)
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
# define acc_int32l_t acc_int32e_t
|
|
||||||
# define acc_uint32l_t acc_uint32e_t
|
|
||||||
# define ACC_INT32L_C(c) ACC_INT32E_C(c)
|
|
||||||
# define ACC_UINT32L_C(c) ACC_UINT32E_C(c)
|
|
||||||
# define SIZEOF_ACC_INT32L_T SIZEOF_ACC_INT32E_T
|
|
||||||
#elif (SIZEOF_INT > 4)
|
|
||||||
# define acc_int32l_t int
|
|
||||||
# define acc_uint32l_t unsigned int
|
|
||||||
# define ACC_INT32L_C(c) c
|
|
||||||
# define ACC_UINT32L_C(c) c##U
|
|
||||||
# define SIZEOF_ACC_INT32L_T SIZEOF_INT
|
|
||||||
#elif (SIZEOF_LONG > 4)
|
|
||||||
# define acc_int32l_t long int
|
|
||||||
# define acc_uint32l_t unsigned long int
|
|
||||||
# define ACC_INT32L_C(c) c##L
|
|
||||||
# define ACC_UINT32L_C(c) c##UL
|
|
||||||
# define SIZEOF_ACC_INT32L_T SIZEOF_LONG
|
|
||||||
#else
|
|
||||||
# error "acc_int32l_t"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* acc_int32f_t is int_fast32_t in <stdint.h> terminology */
|
|
||||||
#if !defined(acc_int32f_t)
|
|
||||||
#if (SIZEOF_INT >= 4)
|
|
||||||
# define acc_int32f_t int
|
|
||||||
# define acc_uint32f_t unsigned int
|
|
||||||
# define ACC_INT32F_C(c) c
|
|
||||||
# define ACC_UINT32F_C(c) c##U
|
|
||||||
# define SIZEOF_ACC_INT32F_T SIZEOF_INT
|
|
||||||
#elif (SIZEOF_LONG >= 4)
|
|
||||||
# define acc_int32f_t long int
|
|
||||||
# define acc_uint32f_t unsigned long int
|
|
||||||
# define ACC_INT32F_C(c) c##L
|
|
||||||
# define ACC_UINT32F_C(c) c##UL
|
|
||||||
# define SIZEOF_ACC_INT32F_T SIZEOF_LONG
|
|
||||||
#elif defined(acc_int32e_t)
|
|
||||||
# define acc_int32f_t acc_int32e_t
|
|
||||||
# define acc_uint32f_t acc_uint32e_t
|
|
||||||
# define ACC_INT32F_C(c) ACC_INT32E_C(c)
|
|
||||||
# define ACC_UINT32F_C(c) ACC_UINT32E_C(c)
|
|
||||||
# define SIZEOF_ACC_INT32F_T SIZEOF_ACC_INT32E_T
|
|
||||||
#else
|
|
||||||
# error "acc_int32f_t"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* acc_int64l_t is int_least64_t in <stdint.h> terminology */
|
|
||||||
#if !defined(acc_int64l_t)
|
|
||||||
#if (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8)
|
|
||||||
# if (ACC_CC_BORLANDC) && !defined(ACC_CONFIG_PREFER___INT64)
|
|
||||||
# define ACC_CONFIG_PREFER___INT64 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if (SIZEOF_INT >= 8)
|
|
||||||
# define acc_int64l_t int
|
|
||||||
# define acc_uint64l_t unsigned int
|
|
||||||
# define ACC_INT64L_C(c) c
|
|
||||||
# define ACC_UINT64L_C(c) c##U
|
|
||||||
# define SIZEOF_ACC_INT64L_T SIZEOF_INT
|
|
||||||
#elif (SIZEOF_LONG >= 8)
|
|
||||||
# define acc_int64l_t long int
|
|
||||||
# define acc_uint64l_t unsigned long int
|
|
||||||
# define ACC_INT64L_C(c) c##L
|
|
||||||
# define ACC_UINT64L_C(c) c##UL
|
|
||||||
# define SIZEOF_ACC_INT64L_T SIZEOF_LONG
|
|
||||||
#elif (SIZEOF_LONG_LONG >= 8 && SIZEOF_UNSIGNED_LONG_LONG >= 8) && !defined(ACC_CONFIG_PREFER___INT64)
|
|
||||||
# define acc_int64l_t acc_llong_t
|
|
||||||
# define acc_uint64l_t acc_ullong_t
|
|
||||||
# if (ACC_CC_BORLANDC)
|
|
||||||
# define ACC_INT64L_C(c) ((c) + 0ll)
|
|
||||||
# define ACC_UINT64L_C(c) ((c) + 0ull)
|
|
||||||
# else
|
|
||||||
# define ACC_INT64L_C(c) c##LL
|
|
||||||
# define ACC_UINT64L_C(c) c##ULL
|
|
||||||
# endif
|
|
||||||
# define SIZEOF_ACC_INT64L_T SIZEOF_LONG_LONG
|
|
||||||
#elif (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8)
|
|
||||||
# define acc_int64l_t __int64
|
|
||||||
# define acc_uint64l_t unsigned __int64
|
|
||||||
# if (ACC_CC_BORLANDC)
|
|
||||||
# define ACC_INT64L_C(c) ((c) + 0i64)
|
|
||||||
# define ACC_UINT64L_C(c) ((c) + 0ui64)
|
|
||||||
# else
|
|
||||||
# define ACC_INT64L_C(c) c##i64
|
|
||||||
# define ACC_UINT64L_C(c) c##ui64
|
|
||||||
# endif
|
|
||||||
# define SIZEOF_ACC_INT64L_T SIZEOF___INT64
|
|
||||||
#else
|
|
||||||
/* no least 64-bit integral type on this machine */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(acc_intptr_t)
|
|
||||||
#if (ACC_ARCH_IA32 && ACC_CC_MSC && (_MSC_VER >= 1300))
|
|
||||||
typedef __w64 int acc_intptr_t;
|
|
||||||
typedef __w64 unsigned int acc_uintptr_t;
|
|
||||||
# define acc_intptr_t acc_intptr_t
|
|
||||||
# define acc_uintptr_t acc_uintptr_t
|
|
||||||
# define SIZEOF_ACC_INTPTR_T SIZEOF_INT
|
|
||||||
#elif (SIZEOF_INT >= SIZEOF_VOID_P)
|
|
||||||
# define acc_intptr_t int
|
|
||||||
# define acc_uintptr_t unsigned int
|
|
||||||
# define SIZEOF_ACC_INTPTR_T SIZEOF_INT
|
|
||||||
#elif (SIZEOF_LONG >= SIZEOF_VOID_P)
|
|
||||||
# define acc_intptr_t long
|
|
||||||
# define acc_uintptr_t unsigned long
|
|
||||||
# define SIZEOF_ACC_INTPTR_T SIZEOF_LONG
|
|
||||||
#elif (SIZEOF_ACC_INT64L_T >= SIZEOF_VOID_P)
|
|
||||||
# define acc_intptr_t acc_int64l_t
|
|
||||||
# define acc_uintptr_t acc_uint64l_t
|
|
||||||
# define SIZEOF_ACC_INTPTR_T SIZEOF_ACC_INT64L_T
|
|
||||||
#else
|
|
||||||
# error "acc_intptr_t"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* workaround for broken compilers */
|
|
||||||
#if (ACC_BROKEN_INTEGRAL_CONSTANTS)
|
|
||||||
# undef ACC_INT32E_C
|
|
||||||
# undef ACC_UINT32E_C
|
|
||||||
# undef ACC_INT32L_C
|
|
||||||
# undef ACC_UINT32L_C
|
|
||||||
# undef ACC_INT32F_C
|
|
||||||
# undef ACC_UINT32F_C
|
|
||||||
# if (SIZEOF_INT == 4)
|
|
||||||
# define ACC_INT32E_C(c) ((c) + 0)
|
|
||||||
# define ACC_UINT32E_C(c) ((c) + 0U)
|
|
||||||
# define ACC_INT32L_C(c) ((c) + 0)
|
|
||||||
# define ACC_UINT32L_C(c) ((c) + 0U)
|
|
||||||
# define ACC_INT32F_C(c) ((c) + 0)
|
|
||||||
# define ACC_UINT32F_C(c) ((c) + 0U)
|
|
||||||
# elif (SIZEOF_LONG == 4)
|
|
||||||
# define ACC_INT32E_C(c) ((c) + 0L)
|
|
||||||
# define ACC_UINT32E_C(c) ((c) + 0UL)
|
|
||||||
# define ACC_INT32L_C(c) ((c) + 0L)
|
|
||||||
# define ACC_UINT32L_C(c) ((c) + 0UL)
|
|
||||||
# define ACC_INT32F_C(c) ((c) + 0L)
|
|
||||||
# define ACC_UINT32F_C(c) ((c) + 0UL)
|
|
||||||
# else
|
|
||||||
# error "integral constants"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// calling conventions
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC)
|
|
||||||
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
# define __acc_cdecl __cdecl
|
|
||||||
# define __acc_cdecl_atexit
|
|
||||||
# define __acc_cdecl_main __cdecl
|
|
||||||
# if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
|
|
||||||
# define __acc_cdecl_qsort __pascal
|
|
||||||
# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
|
|
||||||
# define __acc_cdecl_qsort _stdcall
|
|
||||||
# else
|
|
||||||
# define __acc_cdecl_qsort __cdecl
|
|
||||||
# endif
|
|
||||||
# elif (ACC_CC_WATCOMC)
|
|
||||||
# define __acc_cdecl __cdecl
|
|
||||||
# else
|
|
||||||
# define __acc_cdecl __cdecl
|
|
||||||
# define __acc_cdecl_atexit __cdecl
|
|
||||||
# define __acc_cdecl_main __cdecl
|
|
||||||
# define __acc_cdecl_qsort __cdecl
|
|
||||||
# endif
|
|
||||||
# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC || ACC_CC_WATCOMC)
|
|
||||||
# elif (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
|
|
||||||
# define __acc_cdecl_sighandler __pascal
|
|
||||||
# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
|
|
||||||
# define __acc_cdecl_sighandler _stdcall
|
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
|
|
||||||
# if defined(_DLL)
|
|
||||||
# define __acc_cdecl_sighandler _far _cdecl _loadds
|
|
||||||
# elif defined(_MT)
|
|
||||||
# define __acc_cdecl_sighandler _far _cdecl
|
|
||||||
# else
|
|
||||||
# define __acc_cdecl_sighandler _cdecl
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define __acc_cdecl_sighandler __cdecl
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
|
||||||
# define __acc_cdecl cdecl
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__acc_cdecl)
|
|
||||||
# define __acc_cdecl
|
|
||||||
#endif
|
|
||||||
#if !defined(__acc_cdecl_atexit)
|
|
||||||
# define __acc_cdecl_atexit
|
|
||||||
#endif
|
|
||||||
#if !defined(__acc_cdecl_main)
|
|
||||||
# define __acc_cdecl_main
|
|
||||||
#endif
|
|
||||||
#if !defined(__acc_cdecl_qsort)
|
|
||||||
# define __acc_cdecl_qsort
|
|
||||||
#endif
|
|
||||||
#if !defined(__acc_cdecl_sighandler)
|
|
||||||
# define __acc_cdecl_sighandler
|
|
||||||
#endif
|
|
||||||
#if !defined(__acc_cdecl_va)
|
|
||||||
# define __acc_cdecl_va __acc_cdecl
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
|
|
||||||
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(int);
|
|
||||||
#elif defined(RETSIGTYPE)
|
|
||||||
typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(int);
|
|
||||||
#else
|
|
||||||
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(int);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
fnmatch.ch
|
|
||||||
getopt.ch
|
|
||||||
perfctr.ch
|
|
||||||
@@ -1,250 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_BELE_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// be16 / be24 / be32
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(unsigned, acc_get_be16) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((unsigned)b[1]) | ((unsigned)b[0] << 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_get_be24) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((acc_uint32l_t)b[2]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[0] << 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_get_be32) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_be16) (acc_hvoid_p p, unsigned v)
|
|
||||||
{
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[1] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[0] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_be24) (acc_hvoid_p p, acc_uint32l_t v)
|
|
||||||
{
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[2] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
b[0] = (unsigned char) ((v >> 16) & 0xff);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_be32) (acc_hvoid_p p, acc_uint32l_t v)
|
|
||||||
{
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[3] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 16) & 0xff);
|
|
||||||
b[0] = (unsigned char) ((v >> 24) & 0xff);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(unsigned, acc_get_le16) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
return (* (const unsigned short *) (p));
|
|
||||||
#else
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((unsigned)b[0]) | ((unsigned)b[1] << 8);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_get_le24) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_get_le32) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
return (* (const acc_uint32e_t *) (p));
|
|
||||||
#else
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// le16 / le24 / le32
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_le16) (acc_hvoid_p p, unsigned v)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
(* (unsigned short *) (p) = (unsigned short) (v));
|
|
||||||
#else
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[0] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_le24) (acc_hvoid_p p, acc_uint32l_t v)
|
|
||||||
{
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[0] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((v >> 16) & 0xff);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_le32) (acc_hvoid_p p, acc_uint32l_t v)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
(* (acc_uint32e_t *) (p) = (acc_uint32e_t) (v));
|
|
||||||
#else
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[0] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((v >> 16) & 0xff);
|
|
||||||
b[3] = (unsigned char) ((v >> 24) & 0xff);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// be64
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint64l_t, acc_get_be64) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
#if (SIZEOF_LONG >= 8) || (SIZEOF_SIZE_T >= 8)
|
|
||||||
return ((acc_uint64l_t)b[7]) | ((acc_uint64l_t)b[6] << 8) | ((acc_uint64l_t)b[5] << 16) | ((acc_uint64l_t)b[4] << 24) | ((acc_uint64l_t)b[3] << 32) | ((acc_uint64l_t)b[2] << 40) | ((acc_uint64l_t)b[1] << 48) | ((acc_uint64l_t)b[0] << 56);
|
|
||||||
#else
|
|
||||||
acc_uint32l_t v0, v1;
|
|
||||||
v1 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
|
|
||||||
b += 4;
|
|
||||||
v0 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
|
|
||||||
return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_be64) (acc_hvoid_p p, acc_uint64l_t v)
|
|
||||||
{
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
#if (SIZEOF_LONG >= 8) || (SIZEOF_SIZE_T >= 8)
|
|
||||||
b[7] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[6] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
b[5] = (unsigned char) ((v >> 16) & 0xff);
|
|
||||||
b[4] = (unsigned char) ((v >> 24) & 0xff);
|
|
||||||
b[3] = (unsigned char) ((v >> 32) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((v >> 40) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 48) & 0xff);
|
|
||||||
b[0] = (unsigned char) ((v >> 56) & 0xff);
|
|
||||||
#else
|
|
||||||
acc_uint32l_t x;
|
|
||||||
x = (acc_uint32l_t) (v >> 0);
|
|
||||||
b[7] = (unsigned char) ((x >> 0) & 0xff);
|
|
||||||
b[6] = (unsigned char) ((x >> 8) & 0xff);
|
|
||||||
b[5] = (unsigned char) ((x >> 16) & 0xff);
|
|
||||||
b[4] = (unsigned char) ((x >> 24) & 0xff);
|
|
||||||
x = (acc_uint32l_t) (v >> 32);
|
|
||||||
b[3] = (unsigned char) ((x >> 0) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((x >> 8) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((x >> 16) & 0xff);
|
|
||||||
b[0] = (unsigned char) ((x >> 24) & 0xff);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* acc_uint64l_t */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// le64
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint64l_t, acc_get_le64) (const acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64)
|
|
||||||
return (* (const acc_uint64l_t *) (p));
|
|
||||||
#elif (ACC_ARCH_IA32)
|
|
||||||
const acc_uint32e_t* b = (const acc_uint32e_t*) p;
|
|
||||||
return ((acc_uint64l_t)b[0]) | ((acc_uint64l_t)b[1] << 32);
|
|
||||||
#elif (SIZEOF_LONG >= 8) || (SIZEOF_SIZE_T >= 8)
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
return ((acc_uint64l_t)b[0]) | ((acc_uint64l_t)b[1] << 8) | ((acc_uint64l_t)b[2] << 16) | ((acc_uint64l_t)b[3] << 24) | ((acc_uint64l_t)b[4] << 32) | ((acc_uint64l_t)b[5] << 40) | ((acc_uint64l_t)b[6] << 48) | ((acc_uint64l_t)b[7] << 56);
|
|
||||||
#else
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) p;
|
|
||||||
acc_uint32l_t v0, v1;
|
|
||||||
v0 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
|
|
||||||
b += 4;
|
|
||||||
v1 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
|
|
||||||
return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64)
|
|
||||||
(* (acc_uint64l_t *) (p)) = v;
|
|
||||||
#elif (ACC_ARCH_IA32)
|
|
||||||
(((acc_uint32e_t *)(p))[0] = (acc_uint32e_t) (v >> 0));
|
|
||||||
(((acc_uint32e_t *)(p))[1] = (acc_uint32e_t) (v >> 32));
|
|
||||||
#elif (SIZEOF_LONG >= 8) || (SIZEOF_SIZE_T >= 8)
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
b[0] = (unsigned char) ((v >> 0) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((v >> 8) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((v >> 16) & 0xff);
|
|
||||||
b[3] = (unsigned char) ((v >> 24) & 0xff);
|
|
||||||
b[4] = (unsigned char) ((v >> 32) & 0xff);
|
|
||||||
b[5] = (unsigned char) ((v >> 40) & 0xff);
|
|
||||||
b[6] = (unsigned char) ((v >> 48) & 0xff);
|
|
||||||
b[7] = (unsigned char) ((v >> 56) & 0xff);
|
|
||||||
#else
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) p;
|
|
||||||
acc_uint32l_t x;
|
|
||||||
x = (acc_uint32l_t) (v >> 0);
|
|
||||||
b[0] = (unsigned char) ((x >> 0) & 0xff);
|
|
||||||
b[1] = (unsigned char) ((x >> 8) & 0xff);
|
|
||||||
b[2] = (unsigned char) ((x >> 16) & 0xff);
|
|
||||||
b[3] = (unsigned char) ((x >> 24) & 0xff);
|
|
||||||
x = (acc_uint32l_t) (v >> 32);
|
|
||||||
b[4] = (unsigned char) ((x >> 0) & 0xff);
|
|
||||||
b[5] = (unsigned char) ((x >> 8) & 0xff);
|
|
||||||
b[6] = (unsigned char) ((x >> 16) & 0xff);
|
|
||||||
b[7] = (unsigned char) ((x >> 24) & 0xff);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* acc_uint64l_t */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_DOSALLOC_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_OS216)
|
|
||||||
ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
|
|
||||||
ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// dos_alloc
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
#if !defined(ACC_CC_AZTECC)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
|
|
||||||
{
|
|
||||||
void __far* p = 0;
|
|
||||||
union REGS ri, ro;
|
|
||||||
|
|
||||||
if ((long)size <= 0)
|
|
||||||
return p;
|
|
||||||
size = (size + 15) >> 4;
|
|
||||||
if (size > 0xffffu)
|
|
||||||
return p;
|
|
||||||
ri.x.ax = 0x4800;
|
|
||||||
ri.x.bx = (unsigned short) size;
|
|
||||||
int86(0x21, &ri, &ro);
|
|
||||||
if ((ro.x.cflag & 1) == 0) /* if carry flag not set */
|
|
||||||
p = (void __far*) ACC_MK_FP(ro.x.ax, 0);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
|
|
||||||
{
|
|
||||||
union REGS ri, ro;
|
|
||||||
struct SREGS rs;
|
|
||||||
|
|
||||||
if (!p)
|
|
||||||
return 0;
|
|
||||||
if (ACC_FP_OFF(p) != 0)
|
|
||||||
return -1;
|
|
||||||
segread(&rs);
|
|
||||||
ri.x.ax = 0x4900;
|
|
||||||
rs.es = ACC_FP_SEG(p);
|
|
||||||
int86x(0x21, &ri, &ro, &rs);
|
|
||||||
if (ro.x.cflag & 1) /* if carry flag set */
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_OS216)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
|
|
||||||
{
|
|
||||||
void __far* p = 0;
|
|
||||||
unsigned short sel = 0;
|
|
||||||
|
|
||||||
if ((long)size <= 0)
|
|
||||||
return p;
|
|
||||||
if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
|
|
||||||
p = (void __far*) ACC_MK_FP(sel, 0);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
|
|
||||||
{
|
|
||||||
if (!p)
|
|
||||||
return 0;
|
|
||||||
if (ACC_FP_OFF(p) != 0)
|
|
||||||
return -1;
|
|
||||||
if (DosFreeSeg(ACC_FP_SEG(p)) != 0)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_HALLOC_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
#if 1 && (ACC_OS_DOS16 && defined(BLX286))
|
|
||||||
# define __ACCLIB_HALLOC_USE_DAH 1
|
|
||||||
#elif 1 && (ACC_OS_DOS16 && defined(DOSX286))
|
|
||||||
# define __ACCLIB_HALLOC_USE_DAH 1
|
|
||||||
#elif 1 && (ACC_OS_OS216)
|
|
||||||
# define __ACCLIB_HALLOC_USE_DAH 1
|
|
||||||
#elif 1 && (ACC_OS_WIN16)
|
|
||||||
# define __ACCLIB_HALLOC_USE_GA 1
|
|
||||||
#elif 1 && (ACC_OS_DOS16) && (ACC_CC_BORLANDC) && defined(__DPMI16__)
|
|
||||||
# define __ACCLIB_HALLOC_USE_GA 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (__ACCLIB_HALLOC_USE_DAH)
|
|
||||||
#if 0 && (ACC_OS_OS216)
|
|
||||||
#include <os2.h>
|
|
||||||
#else
|
|
||||||
ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
|
|
||||||
ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (__ACCLIB_HALLOC_USE_GA)
|
|
||||||
#if 0
|
|
||||||
#define STRICT 1
|
|
||||||
#include <windows.h>
|
|
||||||
#else
|
|
||||||
ACC_EXTERN_C const void __near* __far __pascal GlobalAlloc(unsigned, unsigned long);
|
|
||||||
ACC_EXTERN_C const void __near* __far __pascal GlobalFree(const void __near*);
|
|
||||||
ACC_EXTERN_C unsigned long __far __pascal GlobalHandle(unsigned);
|
|
||||||
ACC_EXTERN_C void __far* __far __pascal GlobalLock(const void __near*);
|
|
||||||
ACC_EXTERN_C int __far __pascal GlobalUnlock(const void __near*);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// halloc
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
|
|
||||||
{
|
|
||||||
acc_hvoid_p p = 0;
|
|
||||||
|
|
||||||
if (size <= 0)
|
|
||||||
return p;
|
|
||||||
|
|
||||||
#if 0 && defined(__palmos__)
|
|
||||||
p = MemPtrNew(size);
|
|
||||||
#elif !defined(ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
if (size < (size_t) -1)
|
|
||||||
p = malloc((size_t) size);
|
|
||||||
#else
|
|
||||||
if ((long)size <= 0)
|
|
||||||
return p;
|
|
||||||
{
|
|
||||||
#if (__ACCLIB_HALLOC_USE_DAH)
|
|
||||||
unsigned short sel = 0;
|
|
||||||
if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
|
|
||||||
p = (acc_hvoid_p) ACC_MK_FP(sel, 0);
|
|
||||||
#elif (__ACCLIB_HALLOC_USE_GA)
|
|
||||||
const void __near* h = GlobalAlloc(2, size);
|
|
||||||
if (h) {
|
|
||||||
p = GlobalLock(h);
|
|
||||||
if (p && ACC_FP_OFF(p) != 0) {
|
|
||||||
GlobalUnlock(h);
|
|
||||||
p = 0;
|
|
||||||
}
|
|
||||||
if (!p)
|
|
||||||
GlobalFree(h);
|
|
||||||
}
|
|
||||||
#elif (ACC_CC_MSC && (_MSC_VER >= 700))
|
|
||||||
p = _halloc(size, 1);
|
|
||||||
#elif (ACC_CC_MSC || ACC_CC_WATCOMC)
|
|
||||||
p = halloc(size, 1);
|
|
||||||
#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
p = farmalloc(size);
|
|
||||||
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
p = farmalloc(size);
|
|
||||||
#elif defined(ACC_CC_AZTECC)
|
|
||||||
p = lmalloc(size);
|
|
||||||
#else
|
|
||||||
if (size < (size_t) -1)
|
|
||||||
p = malloc((size_t) size);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_hfree) (acc_hvoid_p p)
|
|
||||||
{
|
|
||||||
if (!p)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#if 0 && defined(__palmos__)
|
|
||||||
MemPtrFree(p);
|
|
||||||
#elif !defined(ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
free(p);
|
|
||||||
#else
|
|
||||||
#if (__ACCLIB_HALLOC_USE_DAH)
|
|
||||||
if (ACC_FP_OFF(p) == 0)
|
|
||||||
DosFreeSeg((unsigned short) ACC_FP_SEG(p));
|
|
||||||
#elif (__ACCLIB_HALLOC_USE_GA)
|
|
||||||
if (ACC_FP_OFF(p) == 0) {
|
|
||||||
const void __near* h = (const void __near*) (unsigned) GlobalHandle(ACC_FP_SEG(p));
|
|
||||||
if (h) {
|
|
||||||
GlobalUnlock(h);
|
|
||||||
GlobalFree(h);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#elif (ACC_CC_MSC && (_MSC_VER >= 700))
|
|
||||||
_hfree(p);
|
|
||||||
#elif (ACC_CC_MSC || ACC_CC_WATCOMC)
|
|
||||||
hfree(p);
|
|
||||||
#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
|
|
||||||
farfree((void __far*) p);
|
|
||||||
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
farfree((void __far*) p);
|
|
||||||
#elif defined(ACC_CC_AZTECC)
|
|
||||||
lfree(p);
|
|
||||||
#else
|
|
||||||
free(p);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_HFREAD_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// huge pointer layer - stdio.h
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hfread) (ACC_FILE_P fp, acc_hvoid_p buf, acc_hsize_t size)
|
|
||||||
{
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
|
|
||||||
unsigned char tmp[512];
|
|
||||||
acc_hsize_t l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
|
|
||||||
n = fread(tmp, 1, n, fp);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
__ACCLIB_FUNCNAME(acc_hmemcpy)((acc_hbyte_p)buf + l, tmp, (acc_hsize_t)n);
|
|
||||||
l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) buf;
|
|
||||||
acc_hsize_t l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
size_t n;
|
|
||||||
n = ACC_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
|
|
||||||
if ((acc_hsize_t) n > size - l)
|
|
||||||
n = (size_t) (size - l);
|
|
||||||
n = fread((void __far*)b, 1, n, fp);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
b += n; l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#else
|
|
||||||
# error "unknown memory model"
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
return fread(buf, 1, size, fp);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hfwrite) (ACC_FILE_P fp, const acc_hvoid_p buf, acc_hsize_t size)
|
|
||||||
{
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
|
|
||||||
unsigned char tmp[512];
|
|
||||||
acc_hsize_t l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
|
|
||||||
__ACCLIB_FUNCNAME(acc_hmemcpy)(tmp, (const acc_hbyte_p)buf + l, (acc_hsize_t)n);
|
|
||||||
n = fwrite(tmp, 1, n, fp);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) buf;
|
|
||||||
acc_hsize_t l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
size_t n;
|
|
||||||
n = ACC_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
|
|
||||||
if ((acc_hsize_t) n > size - l)
|
|
||||||
n = (size_t) (size - l);
|
|
||||||
n = fwrite((void __far*)b, 1, n, fp);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
b += n; l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#else
|
|
||||||
# error "unknown memory model"
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
return fwrite(buf, 1, size, fp);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_HMEMCPY_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// memcmp, memcpy, memmove, memset
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_hmemcmp) (const acc_hvoid_p s1, const acc_hvoid_p s2, acc_hsize_t len)
|
|
||||||
{
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP)
|
|
||||||
const acc_hbyte_p p1 = (const acc_hbyte_p) s1;
|
|
||||||
const acc_hbyte_p p2 = (const acc_hbyte_p) s2;
|
|
||||||
|
|
||||||
if (len > 0) do
|
|
||||||
{
|
|
||||||
int d = *p1 - *p2;
|
|
||||||
if (d != 0)
|
|
||||||
return d;
|
|
||||||
p1++; p2++;
|
|
||||||
} while (--len > 0);
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
return memcmp(s1, s2, len);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
|
|
||||||
{
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY)
|
|
||||||
acc_hbyte_p p1 = (acc_hbyte_p) dest;
|
|
||||||
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
|
|
||||||
|
|
||||||
if (len <= 0 || p1 == p2)
|
|
||||||
return dest;
|
|
||||||
do
|
|
||||||
*p1++ = *p2++;
|
|
||||||
while (--len > 0);
|
|
||||||
return dest;
|
|
||||||
#else
|
|
||||||
return memcpy(dest, src, len);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
|
|
||||||
{
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE)
|
|
||||||
acc_hbyte_p p1 = (acc_hbyte_p) dest;
|
|
||||||
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
|
|
||||||
|
|
||||||
if (len <= 0 || p1 == p2)
|
|
||||||
return dest;
|
|
||||||
|
|
||||||
if (p1 < p2)
|
|
||||||
{
|
|
||||||
do
|
|
||||||
*p1++ = *p2++;
|
|
||||||
while (--len > 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p1 += len;
|
|
||||||
p2 += len;
|
|
||||||
do
|
|
||||||
*--p1 = *--p2;
|
|
||||||
while (--len > 0);
|
|
||||||
}
|
|
||||||
return dest;
|
|
||||||
#else
|
|
||||||
return memmove(dest, src, len);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemset) (acc_hvoid_p s, int c, acc_hsize_t len)
|
|
||||||
{
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET)
|
|
||||||
acc_hbyte_p p = (acc_hbyte_p) s;
|
|
||||||
|
|
||||||
if (len > 0) do
|
|
||||||
*p++ = (unsigned char) c;
|
|
||||||
while (--len > 0);
|
|
||||||
return s;
|
|
||||||
#else
|
|
||||||
return memset(s, c, len);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_HREAD_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// huge pointer layer - read/write
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(long, acc_hread) (int fd, acc_hvoid_p buf, long size)
|
|
||||||
{
|
|
||||||
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
|
|
||||||
unsigned char tmp[512];
|
|
||||||
long l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
int n = size - l > (long)sizeof(tmp) ? (int) sizeof(tmp) : (int) (size - l);
|
|
||||||
n = read(fd, tmp, n);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
if (n < 0)
|
|
||||||
return -1;
|
|
||||||
__ACCLIB_FUNCNAME(acc_hmemcpy)((acc_hbyte_p)buf + l, tmp, (acc_hsize_t)n);
|
|
||||||
l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) buf;
|
|
||||||
long l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
unsigned n;
|
|
||||||
n = ACC_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
|
|
||||||
if ((long) n > size - l)
|
|
||||||
n = (unsigned) (size - l);
|
|
||||||
n = read(fd, (void __far*)b, n);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
if (n == (unsigned)-1)
|
|
||||||
return -1;
|
|
||||||
b += n; l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#else
|
|
||||||
# error "unknown memory model"
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(long, acc_hwrite) (int fd, const acc_hvoid_p buf, long size)
|
|
||||||
{
|
|
||||||
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
|
|
||||||
#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
|
|
||||||
unsigned char tmp[512];
|
|
||||||
long l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
int n = size - l > (long)sizeof(tmp) ? (int) sizeof(tmp) : (int) (size - l);
|
|
||||||
__ACCLIB_FUNCNAME(acc_hmemcpy)(tmp, (const acc_hbyte_p)buf + l, (acc_hsize_t)n);
|
|
||||||
n = write(fd, tmp, n);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
if (n < 0)
|
|
||||||
return -1;
|
|
||||||
l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) buf;
|
|
||||||
long l = 0;
|
|
||||||
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
unsigned n;
|
|
||||||
n = ACC_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
|
|
||||||
if ((long) n > size - l)
|
|
||||||
n = (unsigned) (size - l);
|
|
||||||
n = write(fd, (void __far*)b, n);
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
if (n == (unsigned)-1)
|
|
||||||
return -1;
|
|
||||||
b += n; l += n;
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
#else
|
|
||||||
# error "unknown memory model"
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* #if (ACC_HAVE_MM_HUGE_PTR) */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_HSREAD_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// huge pointer layer - safe read/write
|
|
||||||
// handles partial pipe writes and interrupted system calls
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(long, acc_safe_hread) (int fd, acc_hvoid_p buf, long size)
|
|
||||||
{
|
|
||||||
acc_hbyte_p b = (acc_hbyte_p) buf;
|
|
||||||
long l = 0;
|
|
||||||
int saved_errno;
|
|
||||||
|
|
||||||
saved_errno = errno;
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
long n = size - l;
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
# define __ACCLIB_REQUIRE_HREAD_CH 1
|
|
||||||
errno = 0; n = acc_hread(fd, b, n);
|
|
||||||
#elif (ACC_OS_DOS32) && defined(__DJGPP__)
|
|
||||||
errno = 0; n = _read(fd, b, n);
|
|
||||||
#else
|
|
||||||
errno = 0; n = read(fd, b, n);
|
|
||||||
#endif
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
if (n < 0) {
|
|
||||||
#if defined(EINTR)
|
|
||||||
if (errno == (EINTR)) continue;
|
|
||||||
#endif
|
|
||||||
if (errno == 0) errno = 1;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
b += n; l += n;
|
|
||||||
}
|
|
||||||
errno = saved_errno;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(long, acc_safe_hwrite) (int fd, const acc_hvoid_p buf, long size)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p b = (const acc_hbyte_p) buf;
|
|
||||||
long l = 0;
|
|
||||||
int saved_errno;
|
|
||||||
|
|
||||||
saved_errno = errno;
|
|
||||||
while (l < size)
|
|
||||||
{
|
|
||||||
long n = size - l;
|
|
||||||
#if (ACC_HAVE_MM_HUGE_PTR)
|
|
||||||
# define __ACCLIB_REQUIRE_HREAD_CH 1
|
|
||||||
errno = 0; n = acc_hwrite(fd, b, n);
|
|
||||||
#elif (ACC_OS_DOS32) && defined(__DJGPP__)
|
|
||||||
errno = 0; n = _write(fd, b, n);
|
|
||||||
#else
|
|
||||||
errno = 0; n = write(fd, b, n);
|
|
||||||
#endif
|
|
||||||
if (n == 0)
|
|
||||||
break;
|
|
||||||
if (n < 0) {
|
|
||||||
#if defined(EINTR)
|
|
||||||
if (errno == (EINTR)) continue;
|
|
||||||
#endif
|
|
||||||
if (errno == 0) errno = 1;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
b += n; l += n;
|
|
||||||
}
|
|
||||||
errno = saved_errno;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,566 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_HSTRING_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strlen
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrlen) (const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
/* TODO: which one is the fastest generic version? */
|
|
||||||
#if 1
|
|
||||||
const acc_hchar_p start = s; while (*s) ++s;
|
|
||||||
return (acc_hsize_t) (s - start);
|
|
||||||
#elif 1
|
|
||||||
acc_hsize_t n = 0; while (*s) ++s, ++n; return n;
|
|
||||||
#elif 1
|
|
||||||
acc_hsize_t n = 0; while (s[n]) ++n; return n;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strcmp, strncmp, ascii_stricmp, ascii_strnicmp, ascii_memicmp
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_hstrcmp) (const acc_hchar_p p, const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
for ( ; *p; ++p, ++s) {
|
|
||||||
if (*p != *s)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (unsigned char)*p - (unsigned char)*s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_hstrncmp) (const acc_hchar_p p, const acc_hchar_p s, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
for ( ; *p && n > 0; ++p, ++s, --n) {
|
|
||||||
if (*p != *s)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (unsigned char)*p - (unsigned char)*s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_ascii_hstricmp) (const acc_hchar_p p, const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
for ( ; *p; ++p, ++s) {
|
|
||||||
if (*p != *s) {
|
|
||||||
int d = acc_ascii_utolower(*p) - acc_ascii_utolower(*s);
|
|
||||||
if (d != 0)
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return acc_ascii_utolower(*p) - acc_ascii_utolower(*s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_ascii_hstrnicmp) (const acc_hchar_p p, const acc_hchar_p s, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
for ( ; *p && n > 0; ++p, ++s, --n) {
|
|
||||||
if (*p != *s) {
|
|
||||||
int d = acc_ascii_utolower(*p) - acc_ascii_utolower(*s);
|
|
||||||
if (d != 0)
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return acc_ascii_utolower(*p) - acc_ascii_utolower(*s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_ascii_hmemicmp) (const acc_hvoid_p pp, const acc_hvoid_p ss, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p p = (const acc_hbyte_p) pp;
|
|
||||||
const acc_hbyte_p s = (const acc_hbyte_p) ss;
|
|
||||||
for ( ; n > 0; ++p, ++s, --n) {
|
|
||||||
if (*p != *s) {
|
|
||||||
int d = acc_ascii_utolower(*p) - acc_ascii_utolower(*s);
|
|
||||||
if (d != 0)
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return acc_ascii_utolower(*p) - acc_ascii_utolower(*s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strstr, ascii_stristr, memmem, ascii_memimem
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrstr) (const acc_hchar_p p, const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
acc_hsize_t pn = __ACCLIB_FUNCNAME(acc_hstrlen)(p);
|
|
||||||
acc_hsize_t sn = __ACCLIB_FUNCNAME(acc_hstrlen)(s);
|
|
||||||
return (acc_hchar_p) __ACCLIB_FUNCNAME(acc_hmemmem)(p, pn, s, sn);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_ascii_hstristr) (const acc_hchar_p p, const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
acc_hsize_t pn = __ACCLIB_FUNCNAME(acc_hstrlen)(p);
|
|
||||||
acc_hsize_t sn = __ACCLIB_FUNCNAME(acc_hstrlen)(s);
|
|
||||||
return (acc_hchar_p) __ACCLIB_FUNCNAME(acc_ascii_hmemimem)(p, pn, s, sn);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmem) (const acc_hvoid_p p, acc_hsize_t pn, const acc_hvoid_p s, acc_hsize_t sn)
|
|
||||||
{
|
|
||||||
#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
|
|
||||||
if (sn == 0) __ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
for ( ; pn >= sn; --pn) {
|
|
||||||
if (__ACCLIB_FUNCNAME(acc_hmemcmp)(p, s, sn) == 0)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
p = (const acc_hbyte_p)p + 1;
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_ascii_hmemimem) (const acc_hvoid_p p, acc_hsize_t pn, const acc_hvoid_p s, acc_hsize_t sn)
|
|
||||||
{
|
|
||||||
if (sn == 0) __ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
for ( ; pn >= sn; --pn) {
|
|
||||||
if (__ACCLIB_FUNCNAME(acc_ascii_hmemicmp)(p, s, sn) == 0)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
p = (const acc_hbyte_p)p + 1;
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strcpy, strcat
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrcpy) (acc_hchar_p d, const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
acc_hchar_p dest = d;
|
|
||||||
for (;;) {
|
|
||||||
if ((*d = *s) == 0) return dest;
|
|
||||||
++d; ++s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrcat) (acc_hchar_p d, const acc_hchar_p s)
|
|
||||||
{
|
|
||||||
acc_hchar_p dest = d;
|
|
||||||
while (*d) ++d;
|
|
||||||
for (;;) {
|
|
||||||
if ((*d = *s) == 0) return dest;
|
|
||||||
++d; ++s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strlcpy, strlcat
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrlcpy) (acc_hchar_p d, const acc_hchar_p s, acc_hsize_t size)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
if (n != size) {
|
|
||||||
do {
|
|
||||||
if ((*d = *s) == 0) return n;
|
|
||||||
++d; ++s; ++n;
|
|
||||||
} while (n != size);
|
|
||||||
d[-1] = 0;
|
|
||||||
}
|
|
||||||
while (*s) ++s, ++n;
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrlcat) (acc_hchar_p d, const acc_hchar_p s, acc_hsize_t size)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
while (*d && n != size) ++d, ++n;
|
|
||||||
if (n != size) {
|
|
||||||
do {
|
|
||||||
if ((*d = *s) == 0) return n;
|
|
||||||
++d; ++s; ++n;
|
|
||||||
} while (n != size);
|
|
||||||
d[-1] = 0;
|
|
||||||
}
|
|
||||||
while (*s) ++s, ++n;
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strscpy, strscat
|
|
||||||
// (same as strlcpy/strlcat, but just return -1 in case of failure)
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_hstrscpy) (acc_hchar_p d, const acc_hchar_p s, acc_hsize_t size)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
if (n != size) {
|
|
||||||
do {
|
|
||||||
if ((*d = *s) == 0) return 0;
|
|
||||||
++d; ++s; ++n;
|
|
||||||
} while (n != size);
|
|
||||||
d[-1] = 0;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_hstrscat) (acc_hchar_p d, const acc_hchar_p s, acc_hsize_t size)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
while (*d && n != size) ++d, ++n;
|
|
||||||
if (n != size) {
|
|
||||||
do {
|
|
||||||
if ((*d = *s) == 0) return 0;
|
|
||||||
++d; ++s; ++n;
|
|
||||||
} while (n != size);
|
|
||||||
d[-1] = 0;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strccpy, memccpy
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrccpy) (acc_hchar_p d, const acc_hchar_p s, int c)
|
|
||||||
{
|
|
||||||
for (;;) {
|
|
||||||
if ((*d = *s) == 0) break;
|
|
||||||
if (*d++ == (char) c) return d;
|
|
||||||
++s;
|
|
||||||
}
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemccpy) (acc_hvoid_p d, const acc_hvoid_p s, int c, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
acc_hbyte_p a = (acc_hbyte_p) d;
|
|
||||||
const acc_hbyte_p p = (const acc_hbyte_p) s;
|
|
||||||
const acc_hbyte_p e = (const acc_hbyte_p) s + n;
|
|
||||||
while (p != e) {
|
|
||||||
if ((*a++ = *p++) == (unsigned char) c)
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strchr, strrchr, ascii_strichr, ascii_strrichr
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrchr) (const acc_hchar_p s, int c)
|
|
||||||
{
|
|
||||||
for ( ; *s; ++s) {
|
|
||||||
if (*s == (char) c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
}
|
|
||||||
if ((char) c == 0) __ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrrchr) (const acc_hchar_p s, int c)
|
|
||||||
{
|
|
||||||
const acc_hchar_p start = s;
|
|
||||||
while (*s) ++s;
|
|
||||||
if ((char) c == 0) __ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
for (;;) {
|
|
||||||
if (s == start) break; --s;
|
|
||||||
if (*s == (char) c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
}
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_ascii_hstrichr) (const acc_hchar_p s, int c)
|
|
||||||
{
|
|
||||||
c = acc_ascii_utolower(c);
|
|
||||||
for ( ; *s; ++s) {
|
|
||||||
if (acc_ascii_utolower(*s) == c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
}
|
|
||||||
if (c == 0) __ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_ascii_hstrrichr) (const acc_hchar_p s, int c)
|
|
||||||
{
|
|
||||||
const acc_hchar_p start = s;
|
|
||||||
c = acc_ascii_utolower(c);
|
|
||||||
while (*s) ++s;
|
|
||||||
if (c == 0) __ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
for (;;) {
|
|
||||||
if (s == start) break; --s;
|
|
||||||
if (acc_ascii_utolower(*s) == c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
}
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// memchr, memrchr, ascii_memichr, ascii_memrichr
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemchr) (const acc_hvoid_p s, int c, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p p = (const acc_hbyte_p) s;
|
|
||||||
const acc_hbyte_p e = (const acc_hbyte_p) s + n;
|
|
||||||
while (p != e) {
|
|
||||||
if (*p == (unsigned char) c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
++p;
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemrchr) (const acc_hvoid_p s, int c, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p p = (const acc_hbyte_p) s + n;
|
|
||||||
const acc_hbyte_p e = (const acc_hbyte_p) s;
|
|
||||||
while (p != e) {
|
|
||||||
--p;
|
|
||||||
if (*p == (unsigned char) c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_ascii_hmemichr) (const acc_hvoid_p s, int c, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p p = (const acc_hbyte_p) s;
|
|
||||||
const acc_hbyte_p e = (const acc_hbyte_p) s + n;
|
|
||||||
c = acc_ascii_utolower(c);
|
|
||||||
while (p != e) {
|
|
||||||
if (acc_ascii_utolower(*p) == c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
++p;
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_ascii_hmemrichr) (const acc_hvoid_p s, int c, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
const acc_hbyte_p p = (const acc_hbyte_p) s + n;
|
|
||||||
const acc_hbyte_p e = (const acc_hbyte_p) s;
|
|
||||||
c = acc_ascii_utolower(c);
|
|
||||||
while (p != e) {
|
|
||||||
--p;
|
|
||||||
if (acc_ascii_utolower(*p) == c)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hvoid_p, p)
|
|
||||||
}
|
|
||||||
return (acc_hvoid_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strspn, strrspn
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrspn) (const acc_hchar_p s, const acc_hchar_p accept)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
for ( ; *s; ++s) {
|
|
||||||
const acc_hchar_p a;
|
|
||||||
for (a = accept; *a; ++a)
|
|
||||||
if (*s == *a)
|
|
||||||
goto acc_label_next;
|
|
||||||
break;
|
|
||||||
acc_label_next:
|
|
||||||
++n;
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrrspn) (const acc_hchar_p s, const acc_hchar_p accept)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
const acc_hchar_p start = s;
|
|
||||||
while (*s) ++s;
|
|
||||||
for (;;) {
|
|
||||||
const acc_hchar_p a;
|
|
||||||
if (s == start) break; --s;
|
|
||||||
for (a = accept; *a; ++a)
|
|
||||||
if (*s == *a)
|
|
||||||
goto acc_label_next;
|
|
||||||
break;
|
|
||||||
acc_label_next:
|
|
||||||
++n;
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strcspn, strrcspn
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrcspn) (const acc_hchar_p s, const acc_hchar_p reject)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
for ( ; *s; ++s, ++n) {
|
|
||||||
const acc_hchar_p r;
|
|
||||||
for (r = reject; *r; ++r)
|
|
||||||
if (*s == *r)
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hsize_t, acc_hstrrcspn) (const acc_hchar_p s, const acc_hchar_p reject)
|
|
||||||
{
|
|
||||||
acc_hsize_t n = 0;
|
|
||||||
const acc_hchar_p start = s;
|
|
||||||
while (*s) ++s;
|
|
||||||
for ( ; ; ++n) {
|
|
||||||
const acc_hchar_p r;
|
|
||||||
if (s == start) break; --s;
|
|
||||||
for (r = reject; *r; ++r)
|
|
||||||
if (*s == *r)
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strpbrk, strrpbrk
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrpbrk) (const acc_hchar_p s, const acc_hchar_p accept)
|
|
||||||
{
|
|
||||||
for ( ; *s; ++s) {
|
|
||||||
const acc_hchar_p a;
|
|
||||||
for (a = accept; *a; ++a) {
|
|
||||||
if (*s == *a)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrrpbrk) (const acc_hchar_p s, const acc_hchar_p accept)
|
|
||||||
{
|
|
||||||
const acc_hchar_p start = s;
|
|
||||||
while (*s) ++s;
|
|
||||||
for (;;) {
|
|
||||||
const acc_hchar_p a;
|
|
||||||
if (s == start) break; --s;
|
|
||||||
for (a = accept; *a; ++a) {
|
|
||||||
if (*s == *a)
|
|
||||||
__ACCLIB_CONST_CAST_RETURN(acc_hchar_p, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// strsep, strrsep
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrsep) (acc_hchar_pp ss, const acc_hchar_p delim)
|
|
||||||
{
|
|
||||||
acc_hchar_p s = *ss;
|
|
||||||
if (s) {
|
|
||||||
acc_hchar_p p = __ACCLIB_FUNCNAME(acc_hstrpbrk)(s, delim);
|
|
||||||
if (p) *p++ = 0;
|
|
||||||
*ss = p;
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_hstrrsep) (acc_hchar_pp ss, const acc_hchar_p delim)
|
|
||||||
{
|
|
||||||
acc_hchar_p s = *ss;
|
|
||||||
if (s) {
|
|
||||||
acc_hchar_p p = __ACCLIB_FUNCNAME(acc_hstrrpbrk)(s, delim);
|
|
||||||
if (p) {
|
|
||||||
*p++ = 0;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
*ss = (acc_hchar_p) 0;
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// ascii_strlwr, ascii_strupr, ascii_memlwr, ascii_memupr
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_ascii_hstrlwr) (acc_hchar_p s)
|
|
||||||
{
|
|
||||||
acc_hbyte_p p = (acc_hbyte_p) s;
|
|
||||||
for ( ; *p; ++p)
|
|
||||||
*p = (unsigned char) acc_ascii_utolower(*p);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hchar_p, acc_ascii_hstrupr) (acc_hchar_p s)
|
|
||||||
{
|
|
||||||
acc_hbyte_p p = (acc_hbyte_p) s;
|
|
||||||
for ( ; *p; ++p)
|
|
||||||
*p = (unsigned char) acc_ascii_utoupper(*p);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_ascii_hmemlwr) (acc_hvoid_p s, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
acc_hbyte_p p = (acc_hbyte_p) s;
|
|
||||||
acc_hbyte_p e = (acc_hbyte_p) s + n;
|
|
||||||
for ( ; p != e; ++p)
|
|
||||||
*p = (unsigned char) acc_ascii_utolower(*p);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_hvoid_p, acc_ascii_hmemupr) (acc_hvoid_p s, acc_hsize_t n)
|
|
||||||
{
|
|
||||||
acc_hbyte_p p = (acc_hbyte_p) s;
|
|
||||||
acc_hbyte_p e = (acc_hbyte_p) s + n;
|
|
||||||
for ( ; p != e; ++p)
|
|
||||||
*p = (unsigned char) acc_ascii_utoupper(*p);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_MISC_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// wrap misc
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acclib_handle_t, acc_get_osfhandle) (int fd)
|
|
||||||
{
|
|
||||||
if (fd < 0)
|
|
||||||
return -1;
|
|
||||||
#if (ACC_OS_CYGWIN)
|
|
||||||
return get_osfhandle(fd);
|
|
||||||
#elif (ACC_OS_EMX && defined(__RSXNT__))
|
|
||||||
return -1; /* FIXME */
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
return -1; /* FIXME */
|
|
||||||
#elif (ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# if (ACC_CC_PELLESC && (__POCC__ < 280))
|
|
||||||
return -1; /* FIXME */
|
|
||||||
# elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
|
|
||||||
return -1; /* FIXME */
|
|
||||||
# elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
|
|
||||||
return _os_handle(fd);
|
|
||||||
# else
|
|
||||||
return _get_osfhandle(fd);
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
return fd;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
|
|
||||||
{
|
|
||||||
#if (ACC_OS_TOS && defined(__MINT__))
|
|
||||||
FILE* fp; int old_binary;
|
|
||||||
if (fd == STDIN_FILENO) fp = stdin;
|
|
||||||
else if (fd == STDOUT_FILENO) fp = stdout;
|
|
||||||
else if (fd == STDERR_FILENO) fp = stderr;
|
|
||||||
else return -1;
|
|
||||||
old_binary = fp->__mode.__binary;
|
|
||||||
__set_binmode(fp, binary ? 1 : 0);
|
|
||||||
return old_binary ? 1 : 0;
|
|
||||||
#elif (ACC_OS_TOS)
|
|
||||||
ACC_UNUSED(fd); ACC_UNUSED(binary);
|
|
||||||
return -1; /* FIXME */
|
|
||||||
#elif (ACC_OS_DOS16 && (ACC_CC_AZTECC || ACC_CC_PACIFICC))
|
|
||||||
ACC_UNUSED(fd); ACC_UNUSED(binary);
|
|
||||||
return -1; /* FIXME */
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
int r; unsigned old_flags = __djgpp_hwint_flags;
|
|
||||||
ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
|
|
||||||
ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
|
|
||||||
if (fd < 0) return -1;
|
|
||||||
r = setmode(fd, binary ? O_BINARY : O_TEXT);
|
|
||||||
if ((old_flags & 1u) != (__djgpp_hwint_flags & 1u))
|
|
||||||
__djgpp_set_ctrl_c(!(old_flags & 1));
|
|
||||||
if (r == -1) return -1;
|
|
||||||
return (r & O_TEXT) ? 0 : 1;
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
if (fd < 0) return -1;
|
|
||||||
ACC_UNUSED(binary);
|
|
||||||
return 1;
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
|
|
||||||
FILE* fp; int r;
|
|
||||||
if (fd == fileno(stdin)) fp = stdin;
|
|
||||||
else if (fd == fileno(stdout)) fp = stdout;
|
|
||||||
else if (fd == fileno(stderr)) fp = stderr;
|
|
||||||
else return -1;
|
|
||||||
r = _setmode(fp, binary ? _BINARY : _TEXT);
|
|
||||||
if (r == -1) return -1;
|
|
||||||
return (r & _BINARY) ? 1 : 0;
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
|
|
||||||
ACC_UNUSED(fd); ACC_UNUSED(binary);
|
|
||||||
return -1; /* FIXME */
|
|
||||||
#elif (ACC_OS_CYGWIN && (ACC_CC_GNUC < 0x025a00ul))
|
|
||||||
ACC_UNUSED(fd); ACC_UNUSED(binary);
|
|
||||||
return -1; /* FIXME */
|
|
||||||
#elif (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
int r;
|
|
||||||
#if !defined(ACC_CC_ZORTECHC)
|
|
||||||
ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
|
|
||||||
#endif
|
|
||||||
ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
|
|
||||||
if (fd < 0) return -1;
|
|
||||||
r = setmode(fd, binary ? O_BINARY : O_TEXT);
|
|
||||||
if (r == -1) return -1;
|
|
||||||
return (r & O_TEXT) ? 0 : 1;
|
|
||||||
#else
|
|
||||||
if (fd < 0) return -1;
|
|
||||||
ACC_UNUSED(binary);
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_isatty) (int fd)
|
|
||||||
{
|
|
||||||
/* work around library implementations that think that
|
|
||||||
* any character device like `nul' is a tty */
|
|
||||||
if (fd < 0)
|
|
||||||
return 0;
|
|
||||||
#if (ACC_OS_DOS16 && !defined(ACC_CC_AZTECC))
|
|
||||||
{
|
|
||||||
union REGS ri, ro;
|
|
||||||
ri.x.ax = 0x4400; ri.x.bx = fd;
|
|
||||||
int86(0x21, &ri, &ro);
|
|
||||||
if ((ro.x.cflag & 1) == 0) /* if carry flag not set */
|
|
||||||
if ((ro.x.ax & 0x83) != 0x83)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_WATCOMC)
|
|
||||||
{
|
|
||||||
union REGS ri, ro;
|
|
||||||
ri.w.ax = 0x4400; ri.w.bx = (unsigned short) fd;
|
|
||||||
int386(0x21, &ri, &ro);
|
|
||||||
if ((ro.w.cflag & 1) == 0) /* if carry flag not set */
|
|
||||||
if ((ro.w.ax & 0x83) != 0x83)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#elif (ACC_HAVE_WINDOWS_H)
|
|
||||||
{
|
|
||||||
acclib_handle_t h = __ACCLIB_FUNCNAME(acc_get_osfhandle)(fd);
|
|
||||||
if ((HANDLE)h != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
DWORD d = 0;
|
|
||||||
if (GetConsoleMode((HANDLE)h, &d) == 0)
|
|
||||||
return 0; /* GetConsoleMode failed -> not a tty */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return (isatty(fd)) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
|
|
||||||
{
|
|
||||||
#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
|
|
||||||
ACC_UNUSED(mode);
|
|
||||||
return Dcreate(name);
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
return mkdir(name, mode);
|
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
|
|
||||||
return mkdir(name, mode);
|
|
||||||
#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
ACC_UNUSED(mode);
|
|
||||||
# if (ACC_CC_HIGHC || ACC_CC_PACIFICC)
|
|
||||||
return mkdir((char*) name);
|
|
||||||
# else
|
|
||||||
return mkdir(name);
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
return mkdir(name, mode);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_int32l_t, acc_muldiv32) (acc_int32l_t a, acc_int32l_t b, acc_int32l_t x)
|
|
||||||
{
|
|
||||||
acc_int32l_t r = 0;
|
|
||||||
if (x == 0) return x;
|
|
||||||
/* FIXME */
|
|
||||||
ACC_UNUSED(a); ACC_UNUSED(b);
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_umuldiv32) (acc_uint32l_t a, acc_uint32l_t b, acc_uint32l_t x)
|
|
||||||
{
|
|
||||||
acc_uint32l_t r = 0;
|
|
||||||
if (x == 0) return x;
|
|
||||||
/* FIXME */
|
|
||||||
ACC_UNUSED(a); ACC_UNUSED(b);
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,255 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_OPENDIR_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// wrap <dirent.h>
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(__ACCLIB_USE_OPENDIR)
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
|
|
||||||
static int __ACCLIB_FUNCNAME(acc_opendir_init)(acc_dir_p f, const char* path, char* buf, size_t bufsize)
|
|
||||||
{
|
|
||||||
size_t l; char* p;
|
|
||||||
f->f_name[0] = 0; buf[0] = 0;
|
|
||||||
l = strlen(path);
|
|
||||||
if (l == 0 || bufsize <= 4 || l >= bufsize - 4)
|
|
||||||
return -1;
|
|
||||||
strcpy(buf, path); p = buf + l;
|
|
||||||
if (p[-1] == ':' || p[-1] == '\\' || p[-1] == '/')
|
|
||||||
strcpy(p, "*.*");
|
|
||||||
else
|
|
||||||
strcpy(p, "\\*.*");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__ACCLIB_USE_OPENDIR)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_opendir) (acc_dir_p f, const char* path)
|
|
||||||
{
|
|
||||||
f->u_dirp = opendir(path);
|
|
||||||
if (!f->u_dirp)
|
|
||||||
return -2;
|
|
||||||
return __ACCLIB_FUNCNAME(acc_readdir)(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_readdir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
const struct dirent* dp;
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
if (!f->u_dirp)
|
|
||||||
return -1;
|
|
||||||
dp = (const struct dirent*) readdir((DIR*) f->u_dirp);
|
|
||||||
if (!dp)
|
|
||||||
return -1;
|
|
||||||
if (!dp->d_name[0] || strlen(dp->d_name) >= sizeof(f->f_name))
|
|
||||||
return -1;
|
|
||||||
strcpy(f->f_name, dp->d_name);
|
|
||||||
#if (ACC_CC_WATCOMC)
|
|
||||||
ACC_COMPILE_TIME_ASSERT(sizeof(f->f_name) >= sizeof(dp->d_name))
|
|
||||||
f->f_time = dp->d_time;
|
|
||||||
f->f_date = dp->d_date;
|
|
||||||
f->f_size = dp->d_size;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_closedir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
int r = -1;
|
|
||||||
if (f->u_dirp)
|
|
||||||
r = closedir((DIR*) f->u_dirp);
|
|
||||||
f->u_dirp = 0;
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif (ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_opendir) (acc_dir_p f, const char* path)
|
|
||||||
{
|
|
||||||
WIN32_FIND_DATAA d;
|
|
||||||
HANDLE h;
|
|
||||||
if (__ACCLIB_FUNCNAME(acc_opendir_init)(f, path, f->f_name, sizeof(f->f_name)) != 0)
|
|
||||||
return -1;
|
|
||||||
h = FindFirstFileA(f->f_name, &d);
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
if ((f->u_handle = (acclib_handle_t) h) == -1)
|
|
||||||
return -1;
|
|
||||||
if (!d.cFileName[0] || strlen(d.cFileName) >= sizeof(f->f_name))
|
|
||||||
return -1;
|
|
||||||
strcpy(f->f_name, d.cFileName);
|
|
||||||
f->f_attr = d.dwFileAttributes;
|
|
||||||
f->f_size_high = d.nFileSizeHigh;
|
|
||||||
f->f_size_low = d.nFileSizeLow;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_readdir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
WIN32_FIND_DATAA d;
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
if (f->u_handle == -1 || FindNextFileA((HANDLE) f->u_handle, &d) == 0)
|
|
||||||
return -1;
|
|
||||||
if (!d.cFileName[0] || strlen(d.cFileName) >= sizeof(f->f_name))
|
|
||||||
return -1;
|
|
||||||
strcpy(f->f_name, d.cFileName);
|
|
||||||
f->f_attr = d.dwFileAttributes;
|
|
||||||
f->f_size_high = d.nFileSizeHigh;
|
|
||||||
f->f_size_low = d.nFileSizeLow;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_closedir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
int r = -1;
|
|
||||||
if (f->u_handle != -1)
|
|
||||||
r = FindClose((HANDLE) f->u_handle);
|
|
||||||
f->u_handle = -1;
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_WIN16)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_opendir) (acc_dir_p f, const char* path)
|
|
||||||
{
|
|
||||||
char tmp[ACC_FN_PATH_MAX+1];
|
|
||||||
int r;
|
|
||||||
f->u_dirp = 0;
|
|
||||||
if (__ACCLIB_FUNCNAME(acc_opendir_init)(f, path, tmp, sizeof(tmp)) != 0)
|
|
||||||
return -1;
|
|
||||||
#if (ACC_CC_AZTECC || ACC_CC_PACIFICC)
|
|
||||||
r = -1;
|
|
||||||
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
r = findfirst(tmp, (struct ffblk*) f->u_dta, FA_HIDDEN|FA_SYSTEM|FA_RDONLY|FA_DIREC);
|
|
||||||
#else
|
|
||||||
r = _dos_findfirst(tmp, _A_HIDDEN|_A_SYSTEM|_A_RDONLY|_A_SUBDIR, (struct find_t*) f->u_dta);
|
|
||||||
#endif
|
|
||||||
if (r != 0) f->f_name[0] = 0;
|
|
||||||
if (!f->f_name[0]) return -1;
|
|
||||||
f->u_dirp = 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_readdir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
if (!f->u_dirp)
|
|
||||||
return -1;
|
|
||||||
#if (ACC_CC_AZTECC || ACC_CC_PACIFICC)
|
|
||||||
r = -1;
|
|
||||||
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
|
|
||||||
r = findnext((struct ffblk*) f->u_dta);
|
|
||||||
#else
|
|
||||||
r = _dos_findnext((struct find_t*) f->u_dta);
|
|
||||||
#endif
|
|
||||||
if (r != 0) f->f_name[0] = 0;
|
|
||||||
if (!f->f_name[0]) return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_closedir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
ACC_COMPILE_TIME_ASSERT(sizeof(*f) == 44);
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
f->u_dirp = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif (ACC_OS_TOS)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_opendir) (acc_dir_p f, const char* path)
|
|
||||||
{
|
|
||||||
char tmp[ACC_FN_PATH_MAX+1];
|
|
||||||
int r;
|
|
||||||
DTA* olddta;
|
|
||||||
f->u_dirp = 0;
|
|
||||||
if (__ACCLIB_FUNCNAME(acc_opendir_init)(f, path, tmp, sizeof(tmp)) != 0)
|
|
||||||
return -1;
|
|
||||||
olddta = Fgetdta();
|
|
||||||
Fsetdta((DTA*) f->u_dta);
|
|
||||||
r = Fsfirst(tmp, FA_HIDDEN|FA_SYSTEM|FA_READONLY|FA_SUBDIR);
|
|
||||||
Fsetdta(olddta);
|
|
||||||
if (r != 0) f->f_name[0] = 0;
|
|
||||||
if (!f->f_name[0]) return -1;
|
|
||||||
f->u_dirp = 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_readdir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
DTA* olddta;
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
if (!f->u_dirp)
|
|
||||||
return -1;
|
|
||||||
olddta = Fgetdta();
|
|
||||||
Fsetdta((DTA*) f->u_dta);
|
|
||||||
r = Fsnext();
|
|
||||||
Fsetdta(olddta);
|
|
||||||
if (r != 0) f->f_name[0] = 0;
|
|
||||||
if (!f->f_name[0]) return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_closedir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
ACC_COMPILE_TIME_ASSERT(sizeof(*f) == 44);
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
f->u_dirp = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_opendir) (acc_dir_p f, const char* path)
|
|
||||||
{
|
|
||||||
ACC_UNUSED(path);
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
return -3;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_readdir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
f->f_name[0] = 0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_closedir) (acc_dir_p f)
|
|
||||||
{
|
|
||||||
f->u_dirp = 0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_RAND_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// some linear congruential pseudo random number generators (PRNG)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_srand31) (acc_rand31_p r, acc_uint32l_t seed)
|
|
||||||
{
|
|
||||||
r->seed = seed & ACC_UINT32L_C(0xffffffff);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_rand31) (acc_rand31_p r)
|
|
||||||
{
|
|
||||||
r->seed = r->seed * ACC_UINT32L_C(1103515245) + 12345;
|
|
||||||
r->seed &= ACC_UINT32L_C(0x7fffffff);
|
|
||||||
return r->seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_srand48) (acc_rand48_p r, acc_uint32l_t seed)
|
|
||||||
{
|
|
||||||
r->seed = seed & ACC_UINT32L_C(0xffffffff);
|
|
||||||
r->seed <<= 16; r->seed |= 0x330e;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48) (acc_rand48_p r)
|
|
||||||
{
|
|
||||||
r->seed = r->seed * ACC_UINT64L_C(25214903917) + 11;
|
|
||||||
r->seed &= ACC_UINT64L_C(0xffffffffffff);
|
|
||||||
return (acc_uint32l_t) (r->seed >> 17);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p r)
|
|
||||||
{
|
|
||||||
r->seed = r->seed * ACC_UINT64L_C(25214903917) + 11;
|
|
||||||
r->seed &= ACC_UINT64L_C(0xffffffffffff);
|
|
||||||
return (acc_uint32l_t) (r->seed >> 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* acc_uint64l_t */
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(acc_uint64l_t)
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_srand64) (acc_rand64_p r, acc_uint64l_t seed)
|
|
||||||
{
|
|
||||||
r->seed = seed & ACC_UINT64L_C(0xffffffffffffffff);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64) (acc_rand64_p r)
|
|
||||||
{
|
|
||||||
r->seed = r->seed * ACC_UINT64L_C(6364136223846793005) + 1;
|
|
||||||
#if (SIZEOF_ACC_INT64L_T > 8)
|
|
||||||
r->seed &= ACC_UINT64L_C(0xffffffffffffffff);
|
|
||||||
#endif
|
|
||||||
return (acc_uint32l_t) (r->seed >> 33);
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p r)
|
|
||||||
{
|
|
||||||
r->seed = r->seed * ACC_UINT64L_C(6364136223846793005) + 1;
|
|
||||||
#if (SIZEOF_ACC_INT64L_T > 8)
|
|
||||||
r->seed &= ACC_UINT64L_C(0xffffffffffffffff);
|
|
||||||
#endif
|
|
||||||
return (acc_uint32l_t) (r->seed >> 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* acc_uint64l_t */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// mersenne twister PRNG
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_srandmt) (acc_randmt_p r, acc_uint32l_t seed)
|
|
||||||
{
|
|
||||||
unsigned i = 0;
|
|
||||||
do {
|
|
||||||
r->s[i++] = (seed &= ACC_UINT32L_C(0xffffffff));
|
|
||||||
seed ^= seed >> 30;
|
|
||||||
seed = seed * ACC_UINT32L_C(0x6c078965) + i;
|
|
||||||
} while (i != 624);
|
|
||||||
r->n = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt) (acc_randmt_p r)
|
|
||||||
{
|
|
||||||
return (__ACCLIB_FUNCNAME(acc_randmt_r32)(r)) >> 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p r)
|
|
||||||
{
|
|
||||||
acc_uint32l_t v;
|
|
||||||
if (r->n == 624) {
|
|
||||||
int i = 0, j;
|
|
||||||
r->n = 0;
|
|
||||||
do {
|
|
||||||
j = i - 623; if (j < 0) j += 624;
|
|
||||||
v = (r->s[i] & ACC_UINT32L_C(0x80000000)) ^ (r->s[j] & ACC_UINT32L_C(0x7fffffff));
|
|
||||||
j = i - 227; if (j < 0) j += 624;
|
|
||||||
r->s[i] = r->s[j] ^ (v >> 1);
|
|
||||||
if (v & 1) r->s[i] ^= ACC_UINT32L_C(0x9908b0df);
|
|
||||||
} while (++i != 624);
|
|
||||||
}
|
|
||||||
v = r->s[r->n++];
|
|
||||||
v ^= v >> 11; v ^= (v & ACC_UINT32L_C(0x013a58ad)) << 7;
|
|
||||||
v ^= (v & ACC_UINT32L_C(0x0001df8c)) << 15; v ^= v >> 18;
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_RDTSC_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(acc_int32e_t)
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// read TSC
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
|
|
||||||
{
|
|
||||||
#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC)
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
|
||||||
"movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
|
|
||||||
# if (ACC_CC_GNUC >= 0x020000ul)
|
|
||||||
: : "r" (t) : "cc", "memory", "eax", "edx"
|
|
||||||
# else
|
|
||||||
: : "r" (t) : "ax", "dx"
|
|
||||||
# endif
|
|
||||||
);
|
|
||||||
return 0;
|
|
||||||
#elif (ACC_ARCH_IA32 && ACC_CC_INTELC) && defined(__linux__)
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
|
||||||
"movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
|
|
||||||
: : "r" (t) : "memory", "eax", "edx"
|
|
||||||
);
|
|
||||||
return 0;
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC))
|
|
||||||
ACC_UNUSED(t);
|
|
||||||
__asm {
|
|
||||||
mov ecx, t
|
|
||||||
clc
|
|
||||||
# if (ACC_CC_MSC && (_MSC_VER < 1200))
|
|
||||||
_emit 0x0f
|
|
||||||
_emit 0x31
|
|
||||||
# else
|
|
||||||
rdtsc
|
|
||||||
# endif
|
|
||||||
mov [ecx], eax
|
|
||||||
mov [ecx+4], edx
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
t[0] = t[1] = 0;
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// read and add TSC
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_tsc_read_add) (acc_uint32e_t* t)
|
|
||||||
{
|
|
||||||
#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC)
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
|
||||||
"addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n"
|
|
||||||
# if (ACC_CC_GNUC >= 0x020000ul)
|
|
||||||
: : "r" (t) : "cc", "memory", "eax", "edx"
|
|
||||||
# else
|
|
||||||
: : "r" (t) : "ax", "dx"
|
|
||||||
# endif
|
|
||||||
);
|
|
||||||
return 0;
|
|
||||||
#elif (ACC_ARCH_IA32 && ACC_CC_INTELC) && defined(__linux__)
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
|
||||||
"addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n"
|
|
||||||
: : "r" (t) : "memory", "eax", "edx"
|
|
||||||
);
|
|
||||||
return 0;
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC))
|
|
||||||
ACC_UNUSED(t);
|
|
||||||
__asm {
|
|
||||||
mov ecx, t
|
|
||||||
clc
|
|
||||||
# if (ACC_CC_MSC && (_MSC_VER < 1200))
|
|
||||||
_emit 0x0f
|
|
||||||
_emit 0x31
|
|
||||||
# else
|
|
||||||
rdtsc
|
|
||||||
# endif
|
|
||||||
add [ecx], eax
|
|
||||||
adc edx, 0
|
|
||||||
add [ecx+4], edx
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
acc_uint32e_t v[2];
|
|
||||||
int r;
|
|
||||||
r = acc_tsc_read(v);
|
|
||||||
t[0] += v[0];
|
|
||||||
if (t[0] < v[0]) t[1] += 1;
|
|
||||||
t[1] += v[1];
|
|
||||||
return r;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* defined(acc_int32e_t) */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
/* ACC -- Automatic Compiler Configuration
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of
|
|
||||||
the GNU General Public License. Please consult the file "ACC_LICENSE"
|
|
||||||
for details.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#define __ACCLIB_UCLOCK_CH_INCLUDED 1
|
|
||||||
#if !defined(ACCLIB_PUBLIC)
|
|
||||||
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
#elif (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
|
|
||||||
# if defined(acc_int64l_t)
|
|
||||||
/* See also: KB Q274323: PRB: Performance Counter Value May
|
|
||||||
* Unexpectedly Leap Forward */
|
|
||||||
# define __ACCLIB_UCLOCK_USE_QPC 1
|
|
||||||
# endif
|
|
||||||
/* fallbacks */
|
|
||||||
# if ((ACC_CC_DMC && (__DMC__ < 0x838)) || ACC_CC_LCC)
|
|
||||||
/* winmm.lib is missing */
|
|
||||||
# define __ACCLIB_UCLOCK_USE_CLOCK 1
|
|
||||||
# else
|
|
||||||
# define __ACCLIB_UCLOCK_USE_WINMM 1
|
|
||||||
# if (ACC_CC_MSC && (_MSC_VER >= 1000))
|
|
||||||
/* avoid `-W4' warnings in <mmsystem.h> */
|
|
||||||
# pragma warning(disable: 4201)
|
|
||||||
# elif (ACC_CC_MWERKS)
|
|
||||||
/* avoid duplicate typedef in <mmsystem.h> */
|
|
||||||
# define LPUINT __ACC_MMSYSTEM_H_LPUINT
|
|
||||||
# endif
|
|
||||||
# if 1
|
|
||||||
# include <mmsystem.h>
|
|
||||||
# else
|
|
||||||
# if (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)
|
|
||||||
ACC_EXTERN_C __declspec(dllimport) unsigned long __stdcall timeGetTime(void);
|
|
||||||
# else
|
|
||||||
ACC_EXTERN_C unsigned long __stdcall timeGetTime(void);
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# if (ACC_CC_DMC)
|
|
||||||
# pragma DMC includelib "winmm.lib"
|
|
||||||
# elif (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)
|
|
||||||
# pragma comment(lib, "winmm.lib")
|
|
||||||
# elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3000))
|
|
||||||
# pragma comment(lib, "winmm.lib")
|
|
||||||
# elif (ACC_CC_SYMANTECC)
|
|
||||||
# pragma SC includelib "winmm.lib"
|
|
||||||
# elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1050))
|
|
||||||
# pragma library("winmm.lib")
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_EMX) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
|
|
||||||
# define __ACCLIB_UCLOCK_USE_QPC 1
|
|
||||||
#elif (ACC_OS_CYGWIN || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN32 || ACC_OS_WIN64)
|
|
||||||
# define __ACCLIB_UCLOCK_USE_CLOCK 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (__ACCLIB_UCLOCK_USE_CLOCK) && !defined(CLOCKS_PER_SEC)
|
|
||||||
# if defined(CLK_TCK)
|
|
||||||
# define CLOCKS_PER_SEC CLK_TCK
|
|
||||||
# else
|
|
||||||
# undef __ACCLIB_UCLOCK_USE_CLOCK
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h)
|
|
||||||
{
|
|
||||||
acc_uclock_t c;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#if (__ACCLIB_UCLOCK_USE_QPC)
|
|
||||||
LARGE_INTEGER li;
|
|
||||||
h->qpf = 0.0;
|
|
||||||
if (QueryPerformanceFrequency(&li) != 0) {
|
|
||||||
h->qpf = (double) li.QuadPart;
|
|
||||||
if (h->qpf <= 0.0 || QueryPerformanceCounter(&li) == 0) {
|
|
||||||
h->qpf = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#elif (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
|
|
||||||
h->qpf = 0.0;
|
|
||||||
#endif
|
|
||||||
h->h = 1;
|
|
||||||
h->mode = 0;
|
|
||||||
|
|
||||||
/* warm up */
|
|
||||||
i = 100;
|
|
||||||
do {
|
|
||||||
acc_uclock_read(h, &c);
|
|
||||||
#if (__ACCLIB_UCLOCK_USE_QPC)
|
|
||||||
if (h->qpf > 0.0 && c.qpc == 0) { h->qpf = 0.0; i = 100; }
|
|
||||||
#endif
|
|
||||||
} while (--i > 0);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_uclock_close) (acc_uclock_handle_p h)
|
|
||||||
{
|
|
||||||
h->h = 0;
|
|
||||||
h->mode = -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
|
|
||||||
{
|
|
||||||
#if (__ACCLIB_UCLOCK_USE_QPC)
|
|
||||||
if (h->qpf > 0.0) {
|
|
||||||
LARGE_INTEGER li;
|
|
||||||
if (QueryPerformanceCounter(&li) != 0) {
|
|
||||||
c->qpc = (acc_int64l_t) li.QuadPart;
|
|
||||||
if (c->qpc > 0)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
c->qpc = 0; /* failed */
|
|
||||||
}
|
|
||||||
#elif (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
|
|
||||||
/* c->qpc = 0; */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
# if (ACC_CC_AZTECC)
|
|
||||||
c->ticks.t32 = 0;
|
|
||||||
# else
|
|
||||||
union REGS ri, ro;
|
|
||||||
ri.x.ax = 0x2c00; int86(0x21, &ri, &ro);
|
|
||||||
c->ticks.t32 = ro.h.ch*60UL*60UL*100UL + ro.h.cl*60UL*100UL + ro.h.dh*100UL + ro.h.dl;
|
|
||||||
# endif
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
c->ticks.t64 = uclock();
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t)
|
|
||||||
c->ticks.t64 = clock();
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_CLOCK)
|
|
||||||
c->ticks.t32 = clock();
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_WINMM)
|
|
||||||
c->ticks.t32 = timeGetTime();
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)
|
|
||||||
struct rusage ru;
|
|
||||||
if (getrusage(RUSAGE_SELF, &ru) != 0) c->ticks.rd = 0;
|
|
||||||
else c->ticks.td = ru.ru_utime.tv_sec + ru.ru_utime.tv_usec / 1000000.0;
|
|
||||||
#elif (HAVE_GETTIMEOFDAY)
|
|
||||||
struct timeval tv;
|
|
||||||
if (gettimeofday(&tv, 0) != 0) c->ticks.td = 0;
|
|
||||||
else c->ticks.td = tv.tv_sec + tv.tv_usec / 1000000.0;
|
|
||||||
#else
|
|
||||||
ACC_UNUSED(c);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
ACC_UNUSED(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
//
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
ACCLIB_PUBLIC(double, acc_uclock_get_elapsed) (acc_uclock_handle_p h, const acc_uclock_p start, const acc_uclock_p stop)
|
|
||||||
{
|
|
||||||
double d;
|
|
||||||
|
|
||||||
if (!h->h) {
|
|
||||||
h->mode = -1;
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (__ACCLIB_UCLOCK_USE_QPC)
|
|
||||||
if (h->qpf > 0.0) {
|
|
||||||
h->mode = 1;
|
|
||||||
if (start->qpc == 0 || stop->qpc == 0) return 0.0;
|
|
||||||
return (double) (stop->qpc - start->qpc) / h->qpf;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
|
|
||||||
h->mode = 2;
|
|
||||||
d = (double) (stop->ticks.t32 - start->ticks.t32) / 100.0;
|
|
||||||
if (d < 0.0) d += 86400.0; /* midnight passed */
|
|
||||||
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
|
|
||||||
h->mode = 3;
|
|
||||||
d = (double) (stop->ticks.t64 - start->ticks.t64) / (UCLOCKS_PER_SEC);
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t)
|
|
||||||
h->mode = 4;
|
|
||||||
d = (double) (stop->ticks.t64 - start->ticks.t64) / (CLOCKS_PER_SEC);
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_CLOCK)
|
|
||||||
h->mode = 5;
|
|
||||||
d = (double) (stop->ticks.t32 - start->ticks.t32) / (CLOCKS_PER_SEC);
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_WINMM)
|
|
||||||
h->mode = 6;
|
|
||||||
d = (double) (stop->ticks.t32 - start->ticks.t32) / 1000.0;
|
|
||||||
#elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)
|
|
||||||
h->mode = 7;
|
|
||||||
d = stop->ticks.td - start->ticks.td;
|
|
||||||
#elif (HAVE_GETTIMEOFDAY)
|
|
||||||
h->mode = 8;
|
|
||||||
d = stop->ticks.td - start->ticks.td;
|
|
||||||
#else
|
|
||||||
h->mode = 0;
|
|
||||||
d = 0.0;
|
|
||||||
#endif
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
+588
-290
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2004 Laszlo Molnar
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -22,395 +22,693 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#ifndef UPX_BELE_H__
|
||||||
|
#define UPX_BELE_H__ 1
|
||||||
|
|
||||||
#ifndef __UPX_BELE_H
|
// BE - Big Endian
|
||||||
#define __UPX_BELE_H
|
// LE - Little Endian
|
||||||
|
// NE - Native Endianness (aka host endianness)
|
||||||
|
// TE - Target Endianness (not used here, see various packers)
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// core
|
// core - NE
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
inline unsigned get_be16(const void *bb)
|
__acc_static_forceinline unsigned get_ne16(const void *p) {
|
||||||
{
|
upx_uint16_t v = 0;
|
||||||
const unsigned char* b = (const unsigned char*) bb;
|
upx_memcpy_inline(&v, p, sizeof(v));
|
||||||
unsigned v;
|
|
||||||
v = (unsigned) b[1] << 0;
|
|
||||||
v |= (unsigned) b[0] << 8;
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void set_be16(void *bb, unsigned v)
|
__acc_static_forceinline unsigned get_ne32(const void *p) {
|
||||||
{
|
upx_uint32_t v = 0;
|
||||||
unsigned char* b = (unsigned char*) bb;
|
upx_memcpy_inline(&v, p, sizeof(v));
|
||||||
b[1] = (unsigned char) (v >> 0);
|
|
||||||
b[0] = (unsigned char) (v >> 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline unsigned get_be24(const void *bb)
|
|
||||||
{
|
|
||||||
const unsigned char* b = (const unsigned char*) bb;
|
|
||||||
unsigned v;
|
|
||||||
v = (unsigned) b[2] << 0;
|
|
||||||
v |= (unsigned) b[1] << 8;
|
|
||||||
v |= (unsigned) b[0] << 16;
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void set_be24(void *bb, unsigned v)
|
__acc_static_forceinline upx_uint64_t get_ne64(const void *p) {
|
||||||
{
|
upx_uint64_t v = 0;
|
||||||
unsigned char* b = (unsigned char*) bb;
|
upx_memcpy_inline(&v, p, sizeof(v));
|
||||||
b[2] = (unsigned char) (v >> 0);
|
|
||||||
b[1] = (unsigned char) (v >> 8);
|
|
||||||
b[0] = (unsigned char) (v >> 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline unsigned get_be32(const void *bb)
|
|
||||||
{
|
|
||||||
const unsigned char* b = (const unsigned char*) bb;
|
|
||||||
unsigned v;
|
|
||||||
v = (unsigned) b[3] << 0;
|
|
||||||
v |= (unsigned) b[2] << 8;
|
|
||||||
v |= (unsigned) b[1] << 16;
|
|
||||||
v |= (unsigned) b[0] << 24;
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void set_be32(void *bb, unsigned v)
|
__acc_static_forceinline void set_ne16(void *p, unsigned vv) {
|
||||||
{
|
upx_uint16_t v = (upx_uint16_t)(vv & 0xffff);
|
||||||
unsigned char* b = (unsigned char*) bb;
|
upx_memcpy_inline(p, &v, sizeof(v));
|
||||||
b[3] = (unsigned char) (v >> 0);
|
|
||||||
b[2] = (unsigned char) (v >> 8);
|
|
||||||
b[1] = (unsigned char) (v >> 16);
|
|
||||||
b[0] = (unsigned char) (v >> 24);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__acc_static_forceinline void set_ne32(void *p, unsigned vv) {
|
||||||
inline unsigned get_le16(const void *bb)
|
upx_uint32_t v = vv;
|
||||||
{
|
upx_memcpy_inline(p, &v, sizeof(v));
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
return * (const unsigned short *) bb;
|
|
||||||
#else
|
|
||||||
const unsigned char* b = (const unsigned char*) bb;
|
|
||||||
unsigned v;
|
|
||||||
v = (unsigned) b[0] << 0;
|
|
||||||
v |= (unsigned) b[1] << 8;
|
|
||||||
return v;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void set_le16(void *bb, unsigned v)
|
__acc_static_forceinline void set_ne64(void *p, upx_uint64_t vv) {
|
||||||
{
|
upx_uint64_t v = vv;
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
upx_memcpy_inline(p, &v, sizeof(v));
|
||||||
(* (unsigned short *) bb) = (unsigned short) (v & 0xffff);
|
|
||||||
#else
|
|
||||||
unsigned char* b = (unsigned char*) bb;
|
|
||||||
b[0] = (unsigned char) (v >> 0);
|
|
||||||
b[1] = (unsigned char) (v >> 8);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline unsigned get_le24(const void *bb)
|
|
||||||
{
|
|
||||||
const unsigned char* b = (const unsigned char*) bb;
|
|
||||||
unsigned v;
|
|
||||||
v = (unsigned) b[0] << 0;
|
|
||||||
v |= (unsigned) b[1] << 8;
|
|
||||||
v |= (unsigned) b[2] << 16;
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void set_le24(void *bb, unsigned v)
|
|
||||||
{
|
|
||||||
unsigned char* b = (unsigned char*) bb;
|
|
||||||
b[0] = (unsigned char) (v >> 0);
|
|
||||||
b[1] = (unsigned char) (v >> 8);
|
|
||||||
b[2] = (unsigned char) (v >> 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline unsigned get_le32(const void *bb)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
return * (const acc_uint32e_t *) bb;
|
|
||||||
#else
|
|
||||||
const unsigned char* b = (const unsigned char*) bb;
|
|
||||||
unsigned v;
|
|
||||||
v = (unsigned) b[0] << 0;
|
|
||||||
v |= (unsigned) b[1] << 8;
|
|
||||||
v |= (unsigned) b[2] << 16;
|
|
||||||
v |= (unsigned) b[3] << 24;
|
|
||||||
return v;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void set_le32(void *bb, unsigned v)
|
|
||||||
{
|
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
|
||||||
(* (acc_uint32e_t *) bb) = v;
|
|
||||||
#else
|
|
||||||
unsigned char* b = (unsigned char*) bb;
|
|
||||||
b[0] = (unsigned char) (v >> 0);
|
|
||||||
b[1] = (unsigned char) (v >> 8);
|
|
||||||
b[2] = (unsigned char) (v >> 16);
|
|
||||||
b[3] = (unsigned char) (v >> 24);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// get signed values, i.e. sign-extend
|
// core - bswap
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
inline int sign_extend(int v, int bits)
|
#if (ACC_CC_MSC)
|
||||||
{
|
|
||||||
const int sign_bit = 1 << (bits - 1);
|
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
|
||||||
v |= -(v & sign_bit);
|
|
||||||
return v;
|
__acc_static_forceinline unsigned bswap16(unsigned v) {
|
||||||
|
return (unsigned) _byteswap_ulong(v << 16);
|
||||||
|
}
|
||||||
|
__acc_static_forceinline unsigned bswap32(unsigned v) { return (unsigned) _byteswap_ulong(v); }
|
||||||
|
__acc_static_forceinline upx_uint64_t bswap64(upx_uint64_t v) { return _byteswap_uint64(v); }
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
__acc_static_forceinline constexpr unsigned bswap16(unsigned v) {
|
||||||
|
// return __builtin_bswap16((upx_uint16_t) (v & 0xffff));
|
||||||
|
// return (unsigned) __builtin_bswap64((upx_uint64_t) v << 48);
|
||||||
|
return __builtin_bswap32(v << 16);
|
||||||
|
}
|
||||||
|
__acc_static_forceinline constexpr unsigned bswap32(unsigned v) {
|
||||||
|
// return (unsigned) __builtin_bswap64((upx_uint64_t) v << 32);
|
||||||
|
return __builtin_bswap32(v);
|
||||||
|
}
|
||||||
|
__acc_static_forceinline constexpr upx_uint64_t bswap64(upx_uint64_t v) {
|
||||||
|
return __builtin_bswap64(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_be16_signed(const void *bb)
|
#endif
|
||||||
{
|
|
||||||
int v = get_be16(bb);
|
__acc_static_forceinline constexpr unsigned no_bswap16(unsigned v) {
|
||||||
|
return v & 0xffff; // needed so that this is equivalent to bswap16() above
|
||||||
|
}
|
||||||
|
|
||||||
|
__acc_static_forceinline constexpr unsigned no_bswap32(unsigned v) { return v; }
|
||||||
|
|
||||||
|
__acc_static_forceinline constexpr upx_uint64_t no_bswap64(upx_uint64_t v) { return v; }
|
||||||
|
|
||||||
|
#if (ACC_ABI_BIG_ENDIAN)
|
||||||
|
#define ne16_to_be16(v) no_bswap16(v)
|
||||||
|
#define ne32_to_be32(v) no_bswap32(v)
|
||||||
|
#define ne64_to_be64(v) no_bswap64(v)
|
||||||
|
#define ne16_to_le16(v) bswap16(v)
|
||||||
|
#define ne32_to_le32(v) bswap32(v)
|
||||||
|
#define ne64_to_le64(v) bswap64(v)
|
||||||
|
#else
|
||||||
|
#define ne16_to_be16(v) bswap16(v)
|
||||||
|
#define ne32_to_be32(v) bswap32(v)
|
||||||
|
#define ne64_to_be64(v) bswap64(v)
|
||||||
|
#define ne16_to_le16(v) no_bswap16(v)
|
||||||
|
#define ne32_to_le32(v) no_bswap32(v)
|
||||||
|
#define ne64_to_le64(v) no_bswap64(v)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// get/set 16/32/64
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
inline unsigned get_be16(const void *p) { return ne16_to_be16(get_ne16(p)); }
|
||||||
|
inline unsigned get_be32(const void *p) { return ne32_to_be32(get_ne32(p)); }
|
||||||
|
inline upx_uint64_t get_be64(const void *p) { return ne64_to_be64(get_ne64(p)); }
|
||||||
|
inline unsigned get_le16(const void *p) { return ne16_to_le16(get_ne16(p)); }
|
||||||
|
inline unsigned get_le32(const void *p) { return ne32_to_le32(get_ne32(p)); }
|
||||||
|
inline upx_uint64_t get_le64(const void *p) { return ne64_to_le64(get_ne64(p)); }
|
||||||
|
inline void set_be16(void *p, unsigned v) { set_ne16(p, ne16_to_be16(v)); }
|
||||||
|
inline void set_be32(void *p, unsigned v) { set_ne32(p, ne32_to_be32(v)); }
|
||||||
|
inline void set_be64(void *p, upx_uint64_t v) { set_ne64(p, ne64_to_be64(v)); }
|
||||||
|
inline void set_le16(void *p, unsigned v) { set_ne16(p, ne16_to_le16(v)); }
|
||||||
|
inline void set_le32(void *p, unsigned v) { set_ne32(p, ne32_to_le32(v)); }
|
||||||
|
inline void set_le64(void *p, upx_uint64_t v) { set_ne64(p, ne64_to_le64(v)); }
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// get/set 24/26
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
inline unsigned get_be24(const void *p) {
|
||||||
|
const unsigned char *b = ACC_CCAST(const unsigned char *, p);
|
||||||
|
return (b[0] << 16) | (b[1] << 8) | (b[2] << 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned get_le24(const void *p) {
|
||||||
|
const unsigned char *b = ACC_CCAST(const unsigned char *, p);
|
||||||
|
return (b[0] << 0) | (b[1] << 8) | (b[2] << 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void set_be24(void *p, unsigned v) {
|
||||||
|
unsigned char *b = ACC_PCAST(unsigned char *, p);
|
||||||
|
b[0] = ACC_ICONV(unsigned char, (v >> 16) & 0xff);
|
||||||
|
b[1] = ACC_ICONV(unsigned char, (v >> 8) & 0xff);
|
||||||
|
b[2] = ACC_ICONV(unsigned char, (v >> 0) & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void set_le24(void *p, unsigned v) {
|
||||||
|
unsigned char *b = ACC_PCAST(unsigned char *, p);
|
||||||
|
b[0] = ACC_ICONV(unsigned char, (v >> 0) & 0xff);
|
||||||
|
b[1] = ACC_ICONV(unsigned char, (v >> 8) & 0xff);
|
||||||
|
b[2] = ACC_ICONV(unsigned char, (v >> 16) & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned get_le26(const void *p) { return get_le32(p) & 0x03ffffff; }
|
||||||
|
|
||||||
|
inline void set_le26(void *p, unsigned v) {
|
||||||
|
// preserve the top 6 bits
|
||||||
|
// set_le32(p, (get_le32(p) & 0xfc000000) | (v & 0x03ffffff));
|
||||||
|
// optimized version, saving a runtime bswap32
|
||||||
|
set_ne32(p, (get_ne32(p) & ne32_to_le32(0xfc000000)) |
|
||||||
|
(ne32_to_le32(v) & ne32_to_le32(0x03ffffff)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// get signed values
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
__acc_static_forceinline int sign_extend(unsigned v, unsigned bits) {
|
||||||
|
const unsigned sign_bit = 1u << (bits - 1);
|
||||||
|
v &= sign_bit | (sign_bit - 1);
|
||||||
|
v |= 0 - (v & sign_bit);
|
||||||
|
return ACC_ICAST(int, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
__acc_static_forceinline upx_int64_t sign_extend(upx_uint64_t v, unsigned bits) {
|
||||||
|
const upx_uint64_t sign_bit = 1ull << (bits - 1);
|
||||||
|
v &= sign_bit | (sign_bit - 1);
|
||||||
|
v |= 0 - (v & sign_bit);
|
||||||
|
return ACC_ICAST(upx_int64_t, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int get_be16_signed(const void *p) {
|
||||||
|
unsigned v = get_be16(p);
|
||||||
return sign_extend(v, 16);
|
return sign_extend(v, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_be24_signed(const void *bb)
|
inline int get_be24_signed(const void *p) {
|
||||||
{
|
unsigned v = get_be24(p);
|
||||||
int v = get_be24(bb);
|
|
||||||
return sign_extend(v, 24);
|
return sign_extend(v, 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_be32_signed(const void *bb)
|
inline int get_be32_signed(const void *p) {
|
||||||
{
|
unsigned v = get_be32(p);
|
||||||
int v = get_be32(bb);
|
|
||||||
return sign_extend(v, 32);
|
return sign_extend(v, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_le16_signed(const void *bb)
|
inline upx_int64_t get_be64_signed(const void *p) {
|
||||||
{
|
upx_uint64_t v = get_be64(p);
|
||||||
int v = get_le16(bb);
|
return sign_extend(v, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int get_le16_signed(const void *p) {
|
||||||
|
unsigned v = get_le16(p);
|
||||||
return sign_extend(v, 16);
|
return sign_extend(v, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_le24_signed(const void *bb)
|
inline int get_le24_signed(const void *p) {
|
||||||
{
|
unsigned v = get_le24(p);
|
||||||
int v = get_le24(bb);
|
|
||||||
return sign_extend(v, 24);
|
return sign_extend(v, 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_le32_signed(const void *bb)
|
inline int get_le32_signed(const void *p) {
|
||||||
{
|
unsigned v = get_le32(p);
|
||||||
int v = get_le32(bb);
|
|
||||||
return sign_extend(v, 32);
|
return sign_extend(v, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline upx_int64_t get_le64_signed(const void *p) {
|
||||||
|
upx_uint64_t v = get_le64(p);
|
||||||
|
return sign_extend(v, 64);
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// classes for portable unaligned access
|
// classes for portable unaligned access
|
||||||
|
//
|
||||||
|
// Important: these classes must be PODs (Plain Old Data), i.e. no
|
||||||
|
// constructor, no destructor, no virtual functions and no default
|
||||||
|
// assignment operator, and all fields must be public(!).
|
||||||
|
//
|
||||||
|
// [Actually we _can_ use a safe non-POD subset, but for this we need
|
||||||
|
// to have gcc bug 17519 fixed - see http://gcc.gnu.org/PR17519 ]
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
class BE16
|
struct alignas(1) BE16 {
|
||||||
{
|
|
||||||
unsigned char d[2];
|
unsigned char d[2];
|
||||||
|
|
||||||
public:
|
BE16 &operator=(unsigned v) {
|
||||||
BE16() { }
|
set_be16(d, v);
|
||||||
BE16& operator = (const BE16 &v) {
|
return *this;
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
}
|
||||||
* (acc_uint32e_t *) d = * (const acc_uint32e_t *) v.d;
|
BE16 &operator+=(unsigned v) {
|
||||||
#else
|
set_be16(d, get_be16(d) + v);
|
||||||
memcpy(d, v.d, sizeof(d));
|
return *this;
|
||||||
#endif
|
}
|
||||||
|
BE16 &operator-=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) - v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator*=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) * v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator/=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) / v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator&=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) & v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator|=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) | v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator^=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) ^ v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator<<=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) << v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE16 &operator>>=(unsigned v) {
|
||||||
|
set_be16(d, get_be16(d) >> v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
BE16& operator = (unsigned v) { set_be16(d, v); return *this; }
|
operator unsigned() const { return get_be16(d); }
|
||||||
BE16& operator += (unsigned v) { set_be16(d, get_be16(d) + v); return *this; }
|
|
||||||
BE16& operator -= (unsigned v) { set_be16(d, get_be16(d) - v); return *this; }
|
|
||||||
BE16& operator &= (unsigned v) { set_be16(d, get_be16(d) & v); return *this; }
|
|
||||||
BE16& operator |= (unsigned v) { set_be16(d, get_be16(d) | v); return *this; }
|
|
||||||
|
|
||||||
operator unsigned () const { return get_be16(d); }
|
bool operator<(const BE16 &v) const { return unsigned(*this) < unsigned(v); }
|
||||||
}
|
};
|
||||||
__attribute_packed;
|
|
||||||
|
|
||||||
|
struct alignas(1) BE32 {
|
||||||
class BE32
|
|
||||||
{
|
|
||||||
unsigned char d[4];
|
unsigned char d[4];
|
||||||
|
|
||||||
public:
|
BE32 &operator=(unsigned v) {
|
||||||
BE32() { }
|
set_be32(d, v);
|
||||||
BE32& operator = (const BE32 &v) {
|
return *this;
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
}
|
||||||
* (unsigned int *) d = * (const unsigned int *) v.d;
|
BE32 &operator+=(unsigned v) {
|
||||||
#else
|
set_be32(d, get_be32(d) + v);
|
||||||
memcpy(d, v.d, sizeof(d));
|
return *this;
|
||||||
#endif
|
}
|
||||||
|
BE32 &operator-=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) - v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator*=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) * v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator/=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) / v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator&=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) & v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator|=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) | v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator^=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) ^ v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator<<=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) << v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE32 &operator>>=(unsigned v) {
|
||||||
|
set_be32(d, get_be32(d) >> v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
BE32& operator = (unsigned v) { set_be32(d, v); return *this; }
|
operator unsigned() const { return get_be32(d); }
|
||||||
BE32& operator += (unsigned v) { set_be32(d, get_be32(d) + v); return *this; }
|
|
||||||
BE32& operator -= (unsigned v) { set_be32(d, get_be32(d) - v); return *this; }
|
|
||||||
BE32& operator &= (unsigned v) { set_be32(d, get_be32(d) & v); return *this; }
|
|
||||||
BE32& operator |= (unsigned v) { set_be32(d, get_be32(d) | v); return *this; }
|
|
||||||
|
|
||||||
operator unsigned () const { return get_be32(d); }
|
bool operator<(const BE32 &v) const { return unsigned(*this) < unsigned(v); }
|
||||||
}
|
};
|
||||||
__attribute_packed;
|
|
||||||
|
|
||||||
|
struct alignas(1) BE64 {
|
||||||
|
unsigned char d[8];
|
||||||
|
|
||||||
class LE16
|
BE64 &operator=(upx_uint64_t v) {
|
||||||
{
|
set_be64(d, v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator+=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) + v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator-=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) - v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator*=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) * v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator/=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) / v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator&=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) & v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator|=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) | v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator^=(upx_uint64_t v) {
|
||||||
|
set_be64(d, get_be64(d) ^ v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator<<=(unsigned v) {
|
||||||
|
set_be64(d, get_be64(d) << v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BE64 &operator>>=(unsigned v) {
|
||||||
|
set_be64(d, get_be64(d) >> v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator upx_uint64_t() const { return get_be64(d); }
|
||||||
|
|
||||||
|
bool operator<(const BE64 &v) const { return upx_uint64_t(*this) < upx_uint64_t(v); }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct alignas(1) LE16 {
|
||||||
unsigned char d[2];
|
unsigned char d[2];
|
||||||
|
|
||||||
public:
|
LE16 &operator=(unsigned v) {
|
||||||
LE16() { }
|
set_le16(d, v);
|
||||||
LE16& operator = (const LE16 &v) {
|
return *this;
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
}
|
||||||
* (unsigned short *) d = * (const unsigned short *) v.d;
|
LE16 &operator+=(unsigned v) {
|
||||||
#else
|
set_le16(d, get_le16(d) + v);
|
||||||
memcpy(d, v.d, sizeof(d));
|
return *this;
|
||||||
#endif
|
}
|
||||||
|
LE16 &operator-=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) - v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator*=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) * v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator/=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) / v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator&=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) & v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator|=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) | v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator^=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) ^ v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator<<=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) << v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE16 &operator>>=(unsigned v) {
|
||||||
|
set_le16(d, get_le16(d) >> v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
LE16& operator = (unsigned v) { set_le16(d, v); return *this; }
|
operator unsigned() const { return get_le16(d); }
|
||||||
LE16& operator += (unsigned v) { set_le16(d, get_le16(d) + v); return *this; }
|
|
||||||
LE16& operator -= (unsigned v) { set_le16(d, get_le16(d) - v); return *this; }
|
|
||||||
LE16& operator &= (unsigned v) { set_le16(d, get_le16(d) & v); return *this; }
|
|
||||||
LE16& operator |= (unsigned v) { set_le16(d, get_le16(d) | v); return *this; }
|
|
||||||
|
|
||||||
operator unsigned () const { return get_le16(d); }
|
bool operator<(const LE16 &v) const { return unsigned(*this) < unsigned(v); }
|
||||||
}
|
};
|
||||||
__attribute_packed;
|
|
||||||
|
|
||||||
|
struct alignas(1) LE32 {
|
||||||
class LE32
|
|
||||||
{
|
|
||||||
unsigned char d[4];
|
unsigned char d[4];
|
||||||
|
|
||||||
public:
|
LE32 &operator=(unsigned v) {
|
||||||
LE32() { }
|
set_le32(d, v);
|
||||||
LE32& operator = (const LE32 &v) {
|
return *this;
|
||||||
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
|
}
|
||||||
* (acc_uint32e_t *) d = * (const acc_uint32e_t *) v.d;
|
LE32 &operator+=(unsigned v) {
|
||||||
#else
|
set_le32(d, get_le32(d) + v);
|
||||||
memcpy(d, v.d, sizeof(d));
|
return *this;
|
||||||
#endif
|
}
|
||||||
|
LE32 &operator-=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) - v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator*=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) * v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator/=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) / v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator&=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) & v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator|=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) | v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator^=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) ^ v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator<<=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) << v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE32 &operator>>=(unsigned v) {
|
||||||
|
set_le32(d, get_le32(d) >> v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
LE32& operator = (unsigned v) { set_le32(d, v); return *this; }
|
operator unsigned() const { return get_le32(d); }
|
||||||
LE32& operator += (unsigned v) { set_le32(d, get_le32(d) + v); return *this; }
|
|
||||||
LE32& operator -= (unsigned v) { set_le32(d, get_le32(d) - v); return *this; }
|
|
||||||
LE32& operator &= (unsigned v) { set_le32(d, get_le32(d) & v); return *this; }
|
|
||||||
LE32& operator |= (unsigned v) { set_le32(d, get_le32(d) | v); return *this; }
|
|
||||||
|
|
||||||
operator unsigned () const { return get_le32(d); }
|
bool operator<(const LE32 &v) const { return unsigned(*this) < unsigned(v); }
|
||||||
}
|
};
|
||||||
__attribute_packed;
|
|
||||||
|
|
||||||
|
struct alignas(1) LE64 {
|
||||||
|
unsigned char d[8];
|
||||||
|
|
||||||
|
LE64 &operator=(upx_uint64_t v) {
|
||||||
|
set_le64(d, v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator+=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) + v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator-=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) - v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator*=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) * v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator/=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) / v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator&=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) & v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator|=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) | v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator^=(upx_uint64_t v) {
|
||||||
|
set_le64(d, get_le64(d) ^ v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator<<=(unsigned v) {
|
||||||
|
set_le64(d, get_le64(d) << v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
LE64 &operator>>=(unsigned v) {
|
||||||
|
set_le64(d, get_le64(d) >> v);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator upx_uint64_t() const { return get_le64(d); }
|
||||||
|
|
||||||
|
bool operator<(const LE64 &v) const { return upx_uint64_t(*this) < upx_uint64_t(v); }
|
||||||
|
};
|
||||||
|
|
||||||
|
// native types
|
||||||
|
#if (ACC_ABI_BIG_ENDIAN)
|
||||||
|
typedef BE16 NE16;
|
||||||
|
typedef BE32 NE32;
|
||||||
|
typedef BE64 NE64;
|
||||||
|
#else
|
||||||
|
typedef LE16 NE16;
|
||||||
|
typedef LE32 NE32;
|
||||||
|
typedef LE64 NE64;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// global operators
|
// global operators (pointer addition/subtraction)
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
inline bool operator < (const BE16& v1, const BE16& v2)
|
template <class T>
|
||||||
{
|
inline T *operator+(T *ptr, const BE16 &v) {
|
||||||
return (unsigned)v1 < (unsigned)v2;
|
return ptr + unsigned(v);
|
||||||
|
}
|
||||||
|
template <class T>
|
||||||
|
inline T *operator-(T *ptr, const BE16 &v) {
|
||||||
|
return ptr - unsigned(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator < (const BE32& v1, const BE32& v2)
|
template <class T>
|
||||||
{
|
inline T *operator+(T *ptr, const BE32 &v) {
|
||||||
return (unsigned)v1 < (unsigned)v2;
|
return ptr + unsigned(v);
|
||||||
|
}
|
||||||
|
template <class T>
|
||||||
|
inline T *operator-(T *ptr, const BE32 &v) {
|
||||||
|
return ptr - unsigned(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator < (const LE16& v1, const LE16& v2)
|
// these are not implemented on purpose and will cause link-time errors
|
||||||
{
|
template <class T>
|
||||||
return (unsigned)v1 < (unsigned)v2;
|
T *operator+(T *ptr, const BE64 &v);
|
||||||
|
template <class T>
|
||||||
|
T *operator-(T *ptr, const BE64 &v);
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline T *operator+(T *ptr, const LE16 &v) {
|
||||||
|
return ptr + unsigned(v);
|
||||||
|
}
|
||||||
|
template <class T>
|
||||||
|
inline T *operator-(T *ptr, const LE16 &v) {
|
||||||
|
return ptr - unsigned(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator < (const LE32& v1, const LE32& v2)
|
template <class T>
|
||||||
{
|
inline T *operator+(T *ptr, const LE32 &v) {
|
||||||
return (unsigned)v1 < (unsigned)v2;
|
return ptr + unsigned(v);
|
||||||
|
}
|
||||||
|
template <class T>
|
||||||
|
inline T *operator-(T *ptr, const LE32 &v) {
|
||||||
|
return ptr - unsigned(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// these are not implemented on purpose and will cause link-time errors
|
||||||
template <class T>
|
template <class T>
|
||||||
inline T* operator + (T* ptr, const BE16& v) { return ptr + (unsigned) v; }
|
T *operator+(T *ptr, const LE64 &v);
|
||||||
template <class T>
|
template <class T>
|
||||||
inline T* operator - (T* ptr, const BE16& v) { return ptr - (unsigned) v; }
|
T *operator-(T *ptr, const LE64 &v);
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline T* operator + (T* ptr, const BE32& v) { return ptr + (unsigned) v; }
|
|
||||||
template <class T>
|
|
||||||
inline T* operator - (T* ptr, const BE32& v) { return ptr - (unsigned) v; }
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline T* operator + (T* ptr, const LE16& v) { return ptr + (unsigned) v; }
|
|
||||||
template <class T>
|
|
||||||
inline T* operator - (T* ptr, const LE16& v) { return ptr - (unsigned) v; }
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline T* operator + (T* ptr, const LE32& v) { return ptr + (unsigned) v; }
|
|
||||||
template <class T>
|
|
||||||
inline T* operator - (T* ptr, const LE32& v) { return ptr - (unsigned) v; }
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// misc
|
// global overloads
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
inline unsigned ALIGN_DOWN(unsigned a, const BE32 &b) { return ALIGN_DOWN(a, unsigned(b)); }
|
||||||
|
inline unsigned ALIGN_DOWN(const BE32 &a, unsigned b) { return ALIGN_DOWN(unsigned(a), b); }
|
||||||
|
inline unsigned ALIGN_UP(unsigned a, const BE32 &b) { return ALIGN_UP(a, unsigned(b)); }
|
||||||
|
inline unsigned ALIGN_UP(const BE32 &a, unsigned b) { return ALIGN_UP(unsigned(a), b); }
|
||||||
|
|
||||||
|
inline unsigned ALIGN_DOWN(unsigned a, const LE32 &b) { return ALIGN_DOWN(a, unsigned(b)); }
|
||||||
|
inline unsigned ALIGN_DOWN(const LE32 &a, unsigned b) { return ALIGN_DOWN(unsigned(a), b); }
|
||||||
|
inline unsigned ALIGN_UP(unsigned a, const LE32 &b) { return ALIGN_UP(a, unsigned(b)); }
|
||||||
|
inline unsigned ALIGN_UP(const LE32 &a, unsigned b) { return ALIGN_UP(unsigned(a), b); }
|
||||||
|
|
||||||
|
inline unsigned UPX_MAX(unsigned a, const BE16 &b) { return UPX_MAX(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MAX(const BE16 &a, unsigned b) { return UPX_MAX(unsigned(a), b); }
|
||||||
|
inline unsigned UPX_MIN(unsigned a, const BE16 &b) { return UPX_MIN(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MIN(const BE16 &a, unsigned b) { return UPX_MIN(unsigned(a), b); }
|
||||||
|
|
||||||
|
inline unsigned UPX_MAX(unsigned a, const BE32 &b) { return UPX_MAX(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MAX(const BE32 &a, unsigned b) { return UPX_MAX(unsigned(a), b); }
|
||||||
|
inline unsigned UPX_MIN(unsigned a, const BE32 &b) { return UPX_MIN(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MIN(const BE32 &a, unsigned b) { return UPX_MIN(unsigned(a), b); }
|
||||||
|
|
||||||
|
inline unsigned UPX_MAX(unsigned a, const LE16 &b) { return UPX_MAX(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MAX(const LE16 &a, unsigned b) { return UPX_MAX(unsigned(a), b); }
|
||||||
|
inline unsigned UPX_MIN(unsigned a, const LE16 &b) { return UPX_MIN(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MIN(const LE16 &a, unsigned b) { return UPX_MIN(unsigned(a), b); }
|
||||||
|
|
||||||
|
inline unsigned UPX_MAX(unsigned a, const LE32 &b) { return UPX_MAX(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MAX(const LE32 &a, unsigned b) { return UPX_MAX(unsigned(a), b); }
|
||||||
|
inline unsigned UPX_MIN(unsigned a, const LE32 &b) { return UPX_MIN(a, unsigned(b)); }
|
||||||
|
inline unsigned UPX_MIN(const LE32 &a, unsigned b) { return UPX_MIN(unsigned(a), b); }
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// misc support
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
// for use with qsort()
|
// for use with qsort()
|
||||||
int __acc_cdecl_qsort be16_compare(const void *e1, const void *e2);
|
extern "C" {
|
||||||
int __acc_cdecl_qsort be24_compare(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be16_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort be32_compare(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be24_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort le16_compare(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be32_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort le24_compare(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be64_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort le32_compare(const void *e1, const void *e2);
|
int __acc_cdecl_qsort le16_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort be16_compare_signed(const void *e1, const void *e2);
|
int __acc_cdecl_qsort le24_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort be24_compare_signed(const void *e1, const void *e2);
|
int __acc_cdecl_qsort le32_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort be32_compare_signed(const void *e1, const void *e2);
|
int __acc_cdecl_qsort le64_compare(const void *, const void *);
|
||||||
int __acc_cdecl_qsort le16_compare_signed(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be16_compare_signed(const void *, const void *);
|
||||||
int __acc_cdecl_qsort le24_compare_signed(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be24_compare_signed(const void *, const void *);
|
||||||
int __acc_cdecl_qsort le32_compare_signed(const void *e1, const void *e2);
|
int __acc_cdecl_qsort be32_compare_signed(const void *, const void *);
|
||||||
|
int __acc_cdecl_qsort be64_compare_signed(const void *, const void *);
|
||||||
|
int __acc_cdecl_qsort le16_compare_signed(const void *, const void *);
|
||||||
|
int __acc_cdecl_qsort le24_compare_signed(const void *, const void *);
|
||||||
|
int __acc_cdecl_qsort le32_compare_signed(const void *, const void *);
|
||||||
|
int __acc_cdecl_qsort le64_compare_signed(const void *, const void *);
|
||||||
|
} // extern "C"
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
// Provide namespaces and classes to abstract endianness policies.
|
||||||
|
//
|
||||||
|
// CTP - Compile-Time Polymorphism (templates)
|
||||||
|
// RTP - Run-Time Polymorphism (virtual functions)
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
// just for testing...
|
// forward declarations
|
||||||
#if 1 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && (ACC_CC_GNUC >= 0x030200)
|
namespace N_BELE_CTP {
|
||||||
typedef unsigned short LE16_unaligned __attribute__((__aligned__(1)));
|
struct BEPolicy;
|
||||||
typedef acc_uint32e_t LE32_unaligned __attribute__((__aligned__(1)));
|
struct LEPolicy;
|
||||||
# define LE16 LE16_unaligned
|
extern const BEPolicy be_policy;
|
||||||
# define LE32 LE32_unaligned
|
extern const LEPolicy le_policy;
|
||||||
#endif
|
} // namespace N_BELE_CTP
|
||||||
#if 0 && (ACC_ARCH_IA32) && (ACC_CC_INTELC)
|
namespace N_BELE_RTP {
|
||||||
typedef __declspec(align(1)) unsigned short LE16_unaligned;
|
struct AbstractPolicy;
|
||||||
typedef __declspec(align(1)) acc_uint32e_t LE32_unaligned;
|
struct BEPolicy;
|
||||||
# define LE16 LE16_unaligned
|
struct LEPolicy;
|
||||||
# define LE32 LE32_unaligned
|
extern const BEPolicy be_policy;
|
||||||
#endif
|
extern const LEPolicy le_policy;
|
||||||
#if 0 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && (ACC_CC_MSC) && (_MSC_VER >= 1200)
|
} // namespace N_BELE_RTP
|
||||||
typedef __declspec(align(1)) unsigned short LE16_unaligned;
|
|
||||||
typedef __declspec(align(1)) acc_uint32e_t LE32_unaligned;
|
|
||||||
# define LE16 LE16_unaligned
|
|
||||||
# define LE32 LE32_unaligned
|
|
||||||
# pragma warning(disable: 4244) // Wx: conversion, possible loss of data
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
namespace N_BELE_CTP {
|
||||||
|
#define BELE_CTP 1
|
||||||
|
#include "bele_policy.h"
|
||||||
|
#undef BELE_CTP
|
||||||
|
} // namespace N_BELE_CTP
|
||||||
|
namespace N_BELE_RTP {
|
||||||
|
#define BELE_RTP 1
|
||||||
|
#include "bele_policy.h"
|
||||||
|
#undef BELE_RTP
|
||||||
|
} // namespace N_BELE_RTP
|
||||||
|
|
||||||
|
// util
|
||||||
|
namespace N_BELE_CTP {
|
||||||
|
inline const N_BELE_RTP::AbstractPolicy *getRTP(const BEPolicy * /*dummy*/) {
|
||||||
|
return &N_BELE_RTP::be_policy;
|
||||||
|
}
|
||||||
|
inline const N_BELE_RTP::AbstractPolicy *getRTP(const LEPolicy * /*dummy*/) {
|
||||||
|
return &N_BELE_RTP::le_policy;
|
||||||
|
}
|
||||||
|
} // namespace N_BELE_CTP
|
||||||
|
|
||||||
#endif /* already included */
|
#endif /* already included */
|
||||||
|
|
||||||
|
/* vim:set ts=4 sw=4 et: */
|
||||||
/*
|
|
||||||
vi:ts=4:et:nowrap
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,250 @@
|
|||||||
|
/* bele_policy.h -- access memory in BigEndian and LittleEndian byte order
|
||||||
|
|
||||||
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
and/or modify them under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
|
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef UPX_BELE_H__
|
||||||
|
#error "this is an internal include file"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
//
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#if defined(BELE_CTP)
|
||||||
|
// CTP - Compile-Time Polymorphism (templates)
|
||||||
|
#define V static inline
|
||||||
|
#define S static int __acc_cdecl_qsort
|
||||||
|
#define C /*empty*/
|
||||||
|
#elif defined(BELE_RTP)
|
||||||
|
// RTP - Run-Time Polymorphism (virtual functions)
|
||||||
|
#define V virtual
|
||||||
|
#define S virtual int
|
||||||
|
#define C const
|
||||||
|
#else
|
||||||
|
#error
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BELE_RTP)
|
||||||
|
struct AbstractPolicy {
|
||||||
|
inline AbstractPolicy() {}
|
||||||
|
virtual inline ~AbstractPolicy() {}
|
||||||
|
V bool isBE() C = 0;
|
||||||
|
V bool isLE() C = 0;
|
||||||
|
|
||||||
|
V unsigned get16(const void *p) C = 0;
|
||||||
|
V unsigned get24(const void *p) C = 0;
|
||||||
|
V unsigned get32(const void *p) C = 0;
|
||||||
|
V upx_uint64_t get64(const void *p) C = 0;
|
||||||
|
|
||||||
|
V void set16(void *p, unsigned v) C = 0;
|
||||||
|
V void set24(void *p, unsigned v) C = 0;
|
||||||
|
V void set32(void *p, unsigned v) C = 0;
|
||||||
|
V void set64(void *p, upx_uint64_t v) C = 0;
|
||||||
|
|
||||||
|
V int get16_signed(const void *p) C = 0;
|
||||||
|
V int get24_signed(const void *p) C = 0;
|
||||||
|
V int get32_signed(const void *p) C = 0;
|
||||||
|
V upx_int64_t get64_signed(const void *p) C = 0;
|
||||||
|
|
||||||
|
S u16_compare(const void *a, const void *b) C = 0;
|
||||||
|
S u24_compare(const void *a, const void *b) C = 0;
|
||||||
|
S u32_compare(const void *a, const void *b) C = 0;
|
||||||
|
S u64_compare(const void *a, const void *b) C = 0;
|
||||||
|
|
||||||
|
S u16_compare_signed(const void *a, const void *b) C = 0;
|
||||||
|
S u24_compare_signed(const void *a, const void *b) C = 0;
|
||||||
|
S u32_compare_signed(const void *a, const void *b) C = 0;
|
||||||
|
S u64_compare_signed(const void *a, const void *b) C = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// disable copy, assignment and move assignment
|
||||||
|
AbstractPolicy(const AbstractPolicy &) = delete;
|
||||||
|
AbstractPolicy &operator=(const AbstractPolicy &) = delete;
|
||||||
|
AbstractPolicy &operator=(AbstractPolicy &&) = delete;
|
||||||
|
// disable dynamic allocation
|
||||||
|
ACC_CXX_DISABLE_NEW_DELETE
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BELE_RTP)
|
||||||
|
#undef C
|
||||||
|
#define C const override
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct BEPolicy
|
||||||
|
#if defined(BELE_RTP)
|
||||||
|
final : public AbstractPolicy
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
inline BEPolicy() {}
|
||||||
|
#if defined(BELE_CTP)
|
||||||
|
typedef N_BELE_RTP::BEPolicy RTP_Policy;
|
||||||
|
#elif defined(BELE_RTP)
|
||||||
|
typedef N_BELE_CTP::BEPolicy CTP_Policy;
|
||||||
|
#endif
|
||||||
|
V bool isBE() C { return true; }
|
||||||
|
V bool isLE() C { return false; }
|
||||||
|
|
||||||
|
typedef BE16 U16;
|
||||||
|
typedef BE32 U32;
|
||||||
|
typedef BE64 U64;
|
||||||
|
|
||||||
|
V unsigned get16(const void *p) C { return get_be16(p); }
|
||||||
|
V unsigned get24(const void *p) C { return get_be24(p); }
|
||||||
|
V unsigned get32(const void *p) C { return get_be32(p); }
|
||||||
|
V upx_uint64_t get64(const void *p) C { return get_be64(p); }
|
||||||
|
|
||||||
|
V void set16(void *p, unsigned v) C { set_be16(p, v); }
|
||||||
|
V void set24(void *p, unsigned v) C { set_be24(p, v); }
|
||||||
|
V void set32(void *p, unsigned v) C { set_be32(p, v); }
|
||||||
|
V void set64(void *p, upx_uint64_t v) C { set_be64(p, v); }
|
||||||
|
|
||||||
|
V int get16_signed(const void *p) C { return get_be16_signed(p); }
|
||||||
|
V int get24_signed(const void *p) C { return get_be24_signed(p); }
|
||||||
|
V int get32_signed(const void *p) C { return get_be32_signed(p); }
|
||||||
|
V upx_int64_t get64_signed(const void *p) C { return get_be64_signed(p); }
|
||||||
|
|
||||||
|
S u16_compare(const void *a, const void *b) C { return be16_compare(a, b); }
|
||||||
|
S u24_compare(const void *a, const void *b) C { return be24_compare(a, b); }
|
||||||
|
S u32_compare(const void *a, const void *b) C { return be32_compare(a, b); }
|
||||||
|
S u64_compare(const void *a, const void *b) C { return be64_compare(a, b); }
|
||||||
|
|
||||||
|
S u16_compare_signed(const void *a, const void *b) C { return be16_compare_signed(a, b); }
|
||||||
|
S u24_compare_signed(const void *a, const void *b) C { return be24_compare_signed(a, b); }
|
||||||
|
S u32_compare_signed(const void *a, const void *b) C { return be32_compare_signed(a, b); }
|
||||||
|
S u64_compare_signed(const void *a, const void *b) C { return be64_compare_signed(a, b); }
|
||||||
|
|
||||||
|
static void compileTimeAssertions() {
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U16) == 2)
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U32) == 4)
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U64) == 8)
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1(U16)
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1(U32)
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1(U64)
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// disable copy, assignment and move assignment
|
||||||
|
BEPolicy(const BEPolicy &) = delete;
|
||||||
|
BEPolicy &operator=(const BEPolicy &) = delete;
|
||||||
|
BEPolicy &operator=(BEPolicy &&) = delete;
|
||||||
|
// disable dynamic allocation
|
||||||
|
ACC_CXX_DISABLE_NEW_DELETE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LEPolicy
|
||||||
|
#if defined(BELE_RTP)
|
||||||
|
final : public AbstractPolicy
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
inline LEPolicy() {}
|
||||||
|
#if defined(BELE_CTP)
|
||||||
|
typedef N_BELE_RTP::LEPolicy RTP_Policy;
|
||||||
|
#elif defined(BELE_RTP)
|
||||||
|
typedef N_BELE_CTP::LEPolicy CTP_Policy;
|
||||||
|
#endif
|
||||||
|
V bool isBE() C { return false; }
|
||||||
|
V bool isLE() C { return true; }
|
||||||
|
|
||||||
|
typedef LE16 U16;
|
||||||
|
typedef LE32 U32;
|
||||||
|
typedef LE64 U64;
|
||||||
|
|
||||||
|
V unsigned get16(const void *p) C { return get_le16(p); }
|
||||||
|
V unsigned get24(const void *p) C { return get_le24(p); }
|
||||||
|
V unsigned get32(const void *p) C { return get_le32(p); }
|
||||||
|
V upx_uint64_t get64(const void *p) C { return get_le64(p); }
|
||||||
|
|
||||||
|
V void set16(void *p, unsigned v) C { set_le16(p, v); }
|
||||||
|
V void set24(void *p, unsigned v) C { set_le24(p, v); }
|
||||||
|
V void set32(void *p, unsigned v) C { set_le32(p, v); }
|
||||||
|
V void set64(void *p, upx_uint64_t v) C { set_le64(p, v); }
|
||||||
|
|
||||||
|
V int get16_signed(const void *p) C { return get_le16_signed(p); }
|
||||||
|
V int get24_signed(const void *p) C { return get_le24_signed(p); }
|
||||||
|
V int get32_signed(const void *p) C { return get_le32_signed(p); }
|
||||||
|
V upx_int64_t get64_signed(const void *p) C { return get_le64_signed(p); }
|
||||||
|
|
||||||
|
S u16_compare(const void *a, const void *b) C { return le16_compare(a, b); }
|
||||||
|
S u24_compare(const void *a, const void *b) C { return le24_compare(a, b); }
|
||||||
|
S u32_compare(const void *a, const void *b) C { return le32_compare(a, b); }
|
||||||
|
S u64_compare(const void *a, const void *b) C { return le64_compare(a, b); }
|
||||||
|
|
||||||
|
S u16_compare_signed(const void *a, const void *b) C { return le16_compare_signed(a, b); }
|
||||||
|
S u24_compare_signed(const void *a, const void *b) C { return le24_compare_signed(a, b); }
|
||||||
|
S u32_compare_signed(const void *a, const void *b) C { return le32_compare_signed(a, b); }
|
||||||
|
S u64_compare_signed(const void *a, const void *b) C { return le64_compare_signed(a, b); }
|
||||||
|
|
||||||
|
static void compileTimeAssertions() {
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U16) == 2)
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U32) == 4)
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U64) == 8)
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1(U16)
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1(U32)
|
||||||
|
COMPILE_TIME_ASSERT_ALIGNED1(U64)
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// disable copy, assignment and move assignment
|
||||||
|
LEPolicy(const LEPolicy &) = delete;
|
||||||
|
LEPolicy &operator=(const LEPolicy &) = delete;
|
||||||
|
LEPolicy &operator=(LEPolicy &&) = delete;
|
||||||
|
// disable dynamic allocation
|
||||||
|
ACC_CXX_DISABLE_NEW_DELETE
|
||||||
|
};
|
||||||
|
|
||||||
|
// native policy (aka host policy)
|
||||||
|
#if (ACC_ABI_BIG_ENDIAN)
|
||||||
|
typedef BEPolicy HostPolicy;
|
||||||
|
#elif (ACC_ABI_LITTLE_ENDIAN)
|
||||||
|
typedef LEPolicy HostPolicy;
|
||||||
|
#else
|
||||||
|
#error "ACC_ABI_ENDIAN"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
|
struct HostAlignedPolicy {
|
||||||
|
#if defined(BELE_CTP)
|
||||||
|
enum { isBE = HostPolicy::isBE, isLE = HostPolicy::isLE };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef upx_uint16_t U16;
|
||||||
|
typedef upx_uint32_t U32;
|
||||||
|
typedef upx_uint64_t U64;
|
||||||
|
|
||||||
|
static void compileTimeAssertions() {
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U16) == 2)
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U32) == 4)
|
||||||
|
COMPILE_TIME_ASSERT(sizeof(U64) == 8)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef V
|
||||||
|
#undef S
|
||||||
|
#undef C
|
||||||
|
|
||||||
|
/* vim:set ts=4 sw=4 et: */
|
||||||
-115
@@ -1,115 +0,0 @@
|
|||||||
/* bptr.h --
|
|
||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996-2004 Laszlo Molnar
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
|
||||||
and/or modify them under the terms of the GNU General Public License as
|
|
||||||
published by the Free Software Foundation; either version 2 of
|
|
||||||
the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING.
|
|
||||||
If not, write to the Free Software Foundation, Inc.,
|
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __UPX_BPTR_H
|
|
||||||
#define __UPX_BPTR_H
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
// BoundedPtr
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class BoundedPtr
|
|
||||||
{
|
|
||||||
// typedef BoundedPtr<T> Self;
|
|
||||||
public:
|
|
||||||
typedef T* StoredType;
|
|
||||||
typedef T* PointerType;
|
|
||||||
typedef T& ReferenceType;
|
|
||||||
|
|
||||||
~BoundedPtr() { }
|
|
||||||
|
|
||||||
explicit BoundedPtr(void* base, unsigned size, T* ptr=0)
|
|
||||||
: ptr_(ptr), base_(base), size_(size) { check(); }
|
|
||||||
BoundedPtr& operator= (const BoundedPtr& other) {
|
|
||||||
assert(base_ == other.base_); assert(size_ == other.size_);
|
|
||||||
ptr_ = other.ptr_; check(); return *this;
|
|
||||||
}
|
|
||||||
BoundedPtr& operator= (T* other) {
|
|
||||||
ptr_ = other; check(); return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator T* () { check(); return ptr_; }
|
|
||||||
operator const T* () const { check(); return ptr_; }
|
|
||||||
|
|
||||||
BoundedPtr& operator += (size_t n) {
|
|
||||||
checkStrict(); ptr_ += n; checkStrict(); return *this;
|
|
||||||
}
|
|
||||||
BoundedPtr& operator -= (size_t n) {
|
|
||||||
checkStrict(); ptr_ -= n; checkStrict(); return *this;
|
|
||||||
}
|
|
||||||
BoundedPtr& operator ++ (void) {
|
|
||||||
checkStrict(); ptr_ += 1; checkStrict(); return *this;
|
|
||||||
}
|
|
||||||
// T* operator ++ (int) {
|
|
||||||
// T* p = ptr_; checkStrict(); ptr_ += 1; checkStrict(); return p;
|
|
||||||
// }
|
|
||||||
// BoundedPtr& operator -- (void) {
|
|
||||||
// checkStrict(); ptr_ -= 1; checkStrict(); return *this;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
void checkNULL() const {
|
|
||||||
if (!ptr_)
|
|
||||||
throwCantUnpack("unexpected NULL pointer; take care!");
|
|
||||||
}
|
|
||||||
void checkRange(size_t extra=0) const {
|
|
||||||
size_t off = (const char *) ptr_ - (const char *) base_;
|
|
||||||
if (off > size_ || off + extra > size_)
|
|
||||||
throwCantUnpack("pointer out of range; take care!");
|
|
||||||
}
|
|
||||||
void checkStrict(size_t extra=0) const {
|
|
||||||
checkNULL();
|
|
||||||
checkRange(extra);
|
|
||||||
}
|
|
||||||
void check(size_t extra=0) const {
|
|
||||||
if (ptr_) checkRange(extra);
|
|
||||||
}
|
|
||||||
|
|
||||||
T* ptr_;
|
|
||||||
void* base_;
|
|
||||||
size_t size_;
|
|
||||||
|
|
||||||
// disable copy
|
|
||||||
BoundedPtr(const BoundedPtr&); // {}
|
|
||||||
// BoundedPtr& operator= (const BoundedPtr&); // { return *this; }
|
|
||||||
|
|
||||||
// disable dynamic allocation
|
|
||||||
DISABLE_NEW_DELETE
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
|
|
||||||
+6
-10
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2004 Laszlo Molnar
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -22,13 +22,13 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
#if defined(USE_CONSOLE)
|
#if (USE_CONSOLE)
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
//
|
//
|
||||||
@@ -72,7 +72,7 @@ static void print0(FILE *f, const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static upx_bool intro(FILE *f)
|
static bool intro(FILE *f)
|
||||||
{
|
{
|
||||||
UNUSED(f);
|
UNUSED(f);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -89,8 +89,4 @@ console_t console_file =
|
|||||||
|
|
||||||
#endif /* USE_CONSOLE */
|
#endif /* USE_CONSOLE */
|
||||||
|
|
||||||
|
/* vim:set ts=4 sw=4 et: */
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|||||||
+14
-18
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
This file is part of the UPX executable compressor.
|
This file is part of the UPX executable compressor.
|
||||||
|
|
||||||
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2022 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2004 Laszlo Molnar
|
Copyright (C) 1996-2022 Laszlo Molnar
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
@@ -22,15 +22,15 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
FILE *con_term = NULL;
|
FILE *con_term = nullptr;
|
||||||
|
|
||||||
#if defined(USE_CONSOLE)
|
#if (USE_CONSOLE)
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
//
|
//
|
||||||
@@ -60,7 +60,7 @@ static void try_init(console_t *c, FILE *f)
|
|||||||
{
|
{
|
||||||
con_mode = k;
|
con_mode = k;
|
||||||
con = c;
|
con = c;
|
||||||
con->init = 0;
|
con->init = nullptr;
|
||||||
if (!con->set_fg)
|
if (!con->set_fg)
|
||||||
con->set_fg = console_none.set_fg;
|
con->set_fg = console_none.set_fg;
|
||||||
if (!con->print0)
|
if (!con->print0)
|
||||||
@@ -84,14 +84,14 @@ static int do_init(FILE *f)
|
|||||||
if (!acc_isatty(STDIN_FILENO) || !acc_isatty(STDOUT_FILENO) || !acc_isatty(STDERR_FILENO))
|
if (!acc_isatty(STDIN_FILENO) || !acc_isatty(STDOUT_FILENO) || !acc_isatty(STDERR_FILENO))
|
||||||
return con_mode;
|
return con_mode;
|
||||||
|
|
||||||
#if defined(USE_ANSI)
|
#if (USE_ANSI)
|
||||||
try_init(&console_ansi_mono,f);
|
try_init(&console_ansi_mono,f);
|
||||||
try_init(&console_ansi_color,f);
|
try_init(&console_ansi_color,f);
|
||||||
#endif
|
#endif
|
||||||
#if defined(USE_SCREEN)
|
#if (USE_SCREEN)
|
||||||
try_init(&console_screen,f);
|
try_init(&console_screen,f);
|
||||||
#endif
|
#endif
|
||||||
#if defined(USE_AALIB)
|
#if (USE_AALIB)
|
||||||
try_init(&console_aalib,f);
|
try_init(&console_aalib,f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ static int set_fg(FILE *f, int fg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static upx_bool intro(FILE *f)
|
static bool intro(FILE *f)
|
||||||
{
|
{
|
||||||
if (con == me)
|
if (con == me)
|
||||||
init(f,-1,-1);
|
init(f,-1,-1);
|
||||||
@@ -137,18 +137,18 @@ console_t console_init =
|
|||||||
{
|
{
|
||||||
init,
|
init,
|
||||||
set_fg,
|
set_fg,
|
||||||
0,
|
nullptr,
|
||||||
intro
|
intro
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void __acc_cdecl_va con_fprintf(FILE *f, const char *format, ...)
|
void con_fprintf(FILE *f, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
char buf[80*25];
|
char buf[80*25];
|
||||||
|
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
upx_vsnprintf(buf, sizeof(buf), format,args);
|
upx_safe_vsnprintf(buf, sizeof(buf), format,args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (con == me)
|
if (con == me)
|
||||||
@@ -159,8 +159,4 @@ void __acc_cdecl_va con_fprintf(FILE *f, const char *format, ...)
|
|||||||
|
|
||||||
#endif /* USE_CONSOLE */
|
#endif /* USE_CONSOLE */
|
||||||
|
|
||||||
|
/* vim:set ts=4 sw=4 et: */
|
||||||
/*
|
|
||||||
vi:ts=4:et
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user