Compare commits
614 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5a2cf85b6c | ||
|
80de5766ac | ||
|
2c0183dcef | ||
|
8a90fc699e | ||
|
b1816005fd | ||
|
f478fa843d | ||
|
046c345f65 | ||
|
9692f92c6b | ||
|
bc26d2ede6 | ||
|
36b01f136f | ||
|
ca43d155d8 | ||
|
e04d0f504c | ||
|
acca8f79cf | ||
|
2c38f693d7 | ||
|
4faa95b460 | ||
|
5f9ebdf149 | ||
|
31a571dc70 | ||
|
897ff83dcd | ||
|
a63794ccd6 | ||
|
b15e605614 | ||
|
18335392a1 | ||
|
b1c22da6a1 | ||
|
b95ff65eae | ||
|
005a09cd98 | ||
|
e0f5066ded | ||
|
2b15bcbb4f | ||
|
db646d5d2d | ||
|
b58e20dde4 | ||
|
b11e772acc | ||
|
d1bc03351b | ||
|
d1f551da2c | ||
|
6425c53d61 | ||
|
118e547175 | ||
|
d696daf5af | ||
|
ac60d9426c | ||
|
209796a07e | ||
|
a1f19305f4 | ||
|
dd3243aa70 | ||
|
09893bfd36 | ||
|
a98c475a3c | ||
|
59b147b6fb | ||
|
17f28667b3 | ||
|
63a62e7ea0 | ||
|
56cacbd5bc | ||
|
8b9d5cff91 | ||
|
eede1b4881 | ||
|
492449e9fb | ||
|
b43336582d | ||
|
67863a427d | ||
|
1382857c83 | ||
|
84c2cadc50 | ||
|
16b4fd0ff5 | ||
|
cfe3995aa8 | ||
|
5382216725 | ||
|
c06f77b9e9 | ||
|
0c930e277b | ||
|
2a2712ab90 | ||
|
9f6f599d78 | ||
|
a76243a65e | ||
|
16babcc6bc | ||
|
3d60b3cc62 | ||
|
acd042c234 | ||
|
a2e384df58 | ||
|
735180ac04 | ||
|
06a84499d7 | ||
|
caa70a1e9d | ||
|
deb832c9c6 | ||
|
d7feb2719e | ||
|
4b91978af6 | ||
|
7e078f2d07 | ||
|
2b0b71b9f6 | ||
|
938e652c45 | ||
|
20bd22ea22 | ||
|
c7c9d20b8b | ||
|
dd6aeb26e8 | ||
|
ba0df6e973 | ||
|
a0f48adf5c | ||
|
2b0cac5d4d | ||
|
afeaabdca4 | ||
|
6b584a78b2 | ||
|
4bf248f513 | ||
|
93b54f8f44 | ||
|
dd7c776ff4 | ||
|
ff3ae25d16 | ||
|
bdc16df418 | ||
|
9ef59366ba | ||
|
dda8157a7b | ||
|
023062b2f1 | ||
|
ad92c3b025 | ||
|
8f3d405b34 | ||
|
20268d5291 | ||
|
152c4f2f1b | ||
|
c2f6c70044 | ||
|
9a70f0e564 | ||
|
0efd995b9b | ||
|
a33fbe32c6 | ||
|
dc6d6bd539 | ||
|
880747d0e0 | ||
|
dc67352ac5 | ||
|
cb87c244c3 | ||
|
ae25c01d36 | ||
|
fa38d97192 | ||
|
9a173ce91e | ||
|
fbba3d1be6 | ||
|
782a91f7e6 | ||
|
52e871b810 | ||
|
143da8380e | ||
|
a63677e255 | ||
|
850150dc00 | ||
|
0d197f8906 | ||
|
03b4e160ec | ||
|
18dc19b1e8 | ||
|
0d9db273a0 | ||
|
1a3de05096 | ||
|
c9928a873d | ||
|
ebcdac7d13 | ||
|
f4a867b70f | ||
|
c2fcf23855 | ||
|
ba65a34a01 | ||
|
f163aad38c | ||
|
dd27c42293 | ||
|
0c20d7a125 | ||
|
c9fd8061c2 | ||
|
ee4d980955 | ||
|
1f609c7ebd | ||
|
cf76d9254a | ||
|
d8ca5ef205 | ||
|
30791de5bc | ||
|
3a7e8647bb | ||
|
f1a1e0814c | ||
|
feb1a758c1 | ||
|
0adad68471 | ||
|
dc76879188 | ||
|
bcd27ca259 | ||
|
4c4e0593a7 | ||
|
2189fe94ed | ||
|
a2d2c0418d | ||
|
1059189e2c | ||
|
7da9e7a599 | ||
|
bc9130ded3 | ||
|
2f3939396e | ||
|
14ac7b556e | ||
|
812cd9760f | ||
|
93216a51f4 | ||
|
357fbac62b | ||
|
0bc9016124 | ||
|
310ad7fa37 | ||
|
23914e9a9f | ||
|
bb3990a076 | ||
|
a27dfa8b70 | ||
|
a3873930a0 | ||
|
b948474d01 | ||
|
85946b0c40 | ||
|
075565e6fa | ||
|
eef4d9b102 | ||
|
f11aad515b | ||
|
85b829a1e3 | ||
|
73fca9114e | ||
|
57479cef8c | ||
|
ea1658c818 | ||
|
7c4b718789 | ||
|
f151c7131d | ||
|
36a562e1f1 | ||
|
dd8590e6c8 | ||
|
f7b029eb05 | ||
|
e8d6514bd3 | ||
|
95092bfadb | ||
|
08e791b60d | ||
|
6b7030cd6f | ||
|
b736f0a558 | ||
|
807b2e9d6e | ||
|
034d2f0c08 | ||
|
4a39321d74 | ||
|
0041e9f0c1 | ||
|
969a26fb5d | ||
|
dac12a122f | ||
|
2702b6ffc8 | ||
|
25bac30862 | ||
|
a8de81a51b | ||
|
b719bbfefc | ||
|
de6ee749fe | ||
|
33d9094cdc | ||
|
63fed427f4 | ||
|
ae89ca0a5f | ||
|
25dce61369 | ||
|
8cb7483b2c | ||
|
1e2fde0df1 | ||
|
859515315c | ||
|
7f169e391d | ||
|
6a7a7ada2e | ||
|
21b2e2ca1e | ||
|
1d31f1b0b8 | ||
|
dab4239aca | ||
|
8908c2c027 | ||
|
974cb4162a | ||
|
dba78717fa | ||
|
48a214c3f1 | ||
|
e320b2e928 | ||
|
1748a7bd57 | ||
|
6cf24936df | ||
|
651637d637 | ||
|
26ee5028e1 | ||
|
d900a6d9dd | ||
|
5d6a622b18 | ||
|
009bd1a507 | ||
|
34a3454784 | ||
|
14f0e8658c | ||
|
6dda4ad41c | ||
|
2b3f7f43ce | ||
|
5019493332 | ||
|
0086020b5c | ||
|
adc6adb6d5 | ||
|
8ab9f0f860 | ||
|
19f409a85b | ||
|
6a4f817693 | ||
|
4cd7af3da1 | ||
|
d7d3fec058 | ||
|
8d61df7cc9 | ||
|
b383a382eb | ||
|
bee1285e3a | ||
|
c89889cc57 | ||
|
a1c5afa383 | ||
|
a00024cf51 | ||
|
a5325d9021 | ||
|
719b1cb90f | ||
|
8530e6c4a5 | ||
|
6605e1f6f2 | ||
|
1f1bdcde51 | ||
|
298cf37121 | ||
|
c4a2dcc1fb | ||
|
dfe20e116b | ||
|
68e953345f | ||
|
b98d44ce10 | ||
|
734c0dbce1 | ||
|
1ab0829ab3 | ||
|
3da5823905 | ||
|
b533644f3f | ||
|
7badca3aa5 | ||
|
3ca7f3eece | ||
|
9c23186172 | ||
|
2b0309e159 | ||
|
be232fa1f2 | ||
|
3df99fbced | ||
|
85f9bd97f1 | ||
|
2ddac1ce68 | ||
|
41e8c4f887 | ||
|
bc2660f509 | ||
|
230962230f | ||
|
a9cc5c5258 | ||
|
ba5f92c6dd | ||
|
ca149d2eed | ||
|
b9fec2fcc4 | ||
|
6d40f2dd1a | ||
|
54c3cd5494 | ||
|
fe7cfddd29 | ||
|
8d9025f2ca | ||
|
38874fbb0a | ||
|
90a09f20b3 | ||
|
7365e0486b | ||
|
593056113c | ||
|
c48e0821c5 | ||
|
259a1774ca | ||
|
888d80240d | ||
|
45e8a0525c | ||
|
f9dbd7bc78 | ||
|
274992e50d | ||
|
8fe264bbd7 | ||
|
36a612af9a | ||
|
98e7308597 | ||
|
2d22f2aeff | ||
|
a9178bd468 | ||
|
78e2c12202 | ||
|
2d2e60a197 | ||
|
3f85b11e12 | ||
|
91dd5fe68a | ||
|
fe1649a2c1 | ||
|
9be897eb6b | ||
|
14576f599c | ||
|
e119f7f402 | ||
|
ad94e9a7d2 | ||
|
bc67216f7f | ||
|
0814c28998 | ||
|
d04a1fcb8f | ||
|
c0a72edf9a | ||
|
c221bf09f6 | ||
|
b32ec5342e | ||
|
9e3f2ae9f9 | ||
|
dba1acd302 | ||
|
f8bf48a522 | ||
|
f0158ae505 | ||
|
6de83dddd6 | ||
|
e2d85d78a7 | ||
|
6b4f2d0a91 | ||
|
8716f362f8 | ||
|
9125b6c251 | ||
|
4b71b7aa29 | ||
|
c81401ab2d | ||
|
c44b299750 | ||
|
9ce9147dad | ||
|
c1800094d0 | ||
|
a6b698d4eb | ||
|
51422f4b1e | ||
|
f197f6b1eb | ||
|
01c8245846 | ||
|
b13640e4a1 | ||
|
a73ad9b089 | ||
|
1ebaf677e0 | ||
|
36ef254c73 | ||
|
ad7545d149 | ||
|
3924a16048 | ||
|
0bfd409bdf | ||
|
916ff33058 | ||
|
30903686bd | ||
|
82e1138158 | ||
|
ccbb78d4e9 | ||
|
5b664f3681 | ||
|
77207eaaae | ||
|
de83cfd53c | ||
|
eb56c2b56e | ||
|
bb2faaddc0 | ||
|
1c2b5acb2c | ||
|
89c095f79e | ||
|
dff7636701 | ||
|
3b83fa530c | ||
|
bca087f111 | ||
|
ae647699a4 | ||
|
3a67ee6d11 | ||
|
c227e3c7b4 | ||
|
6a1c52b904 | ||
|
7003559c74 | ||
|
6b710ff3b3 | ||
|
4e8ef7c6ed | ||
|
26e1b14020 | ||
|
d4123b8fa6 | ||
|
dd6bc339bf | ||
|
7d5a97137d | ||
|
5c6ec587ac | ||
|
d7c5630509 | ||
|
c1bc6acd26 | ||
|
903b243308 | ||
|
72cd6d168e | ||
|
6c970612bf | ||
|
a042cbf885 | ||
|
44d56393db | ||
|
edd47b12a8 | ||
|
6e51b4191e | ||
|
8d4d1a3285 | ||
|
341557c34e | ||
|
af0a6fdf20 | ||
|
7f5d7cf7dd | ||
|
aac7b0404a | ||
|
aad19f1a35 | ||
|
872148c35c | ||
|
d24babb96e | ||
|
9fe863b5d7 | ||
|
f1bc06473f | ||
|
bab6a63822 | ||
|
1bd05d136b | ||
|
ec08550fd9 | ||
|
6f4ed5f66d | ||
|
f852996f97 | ||
|
38da8ef86c | ||
|
dd7f70d6e8 | ||
|
89608ade3b | ||
|
f8f89a0946 | ||
|
e99928aa44 | ||
|
1011fd4891 | ||
|
673a1291e1 | ||
|
8aa73318c8 | ||
|
04a95e3aa8 | ||
|
ff68840220 | ||
|
f2625b7ff5 | ||
|
4440d3edd5 | ||
|
efa21b2531 | ||
|
2de5d92d3a | ||
|
2e320d28d9 | ||
|
e58429a044 | ||
|
ed5bf3420c | ||
|
a7cf34d2eb | ||
|
de5016dda8 | ||
|
1cf1d616c6 | ||
|
c46c019c83 | ||
|
a2f747fb0c | ||
|
38c39321d0 | ||
|
7ab81ef19a | ||
|
2e503f7f8c | ||
|
3d41629170 | ||
|
7959cf39fa | ||
|
d48921bfc8 | ||
|
04c02d4add | ||
|
2c2b3d2f36 | ||
|
0e60c5802d | ||
|
7adf30e326 | ||
|
f9a3315d75 | ||
|
c0ca68e2db | ||
|
fdc9fbe876 | ||
|
18f1ac6c62 | ||
|
81ef40fbb7 | ||
|
41abe17286 | ||
|
a01b4d0566 | ||
|
11f00a2e6e | ||
|
07f0a107d3 | ||
|
30ab6f79ff | ||
|
125072a30e | ||
|
aec31c43c0 | ||
|
83e5832bc1 | ||
|
244ca93aa4 | ||
|
ff68c047f9 | ||
|
b662cb77a4 | ||
|
3e2863dca5 | ||
|
6e95b0d052 | ||
|
da4aa69c89 | ||
|
84970e9e9b | ||
|
37ac1aa62c | ||
|
69b8a4faf1 | ||
|
8a6988d381 | ||
|
79779b51da | ||
|
8b60585004 | ||
|
df6a397e52 | ||
|
274c6306a8 | ||
|
a398c8af2f | ||
|
fc82cf1cf2 | ||
|
48b1de0b59 | ||
|
3edc30d067 | ||
|
ff6dc727f5 | ||
|
a0d4e4ed3f | ||
|
71759e3752 | ||
|
79345119c6 | ||
|
9af8ceb063 | ||
|
f5a0429f0d | ||
|
cc22c9d61c | ||
|
45f5afd2b7 | ||
|
c9acc2912e | ||
|
f0604d1e97 | ||
|
531c657b64 | ||
|
c50ccd4e06 | ||
|
184f79ad3f | ||
|
e78e810cfe | ||
|
c804ef1888 | ||
|
037abd7037 | ||
|
75f462f0e1 | ||
|
9f92449e15 | ||
|
a917590862 | ||
|
41b92740ea | ||
|
d2964576c7 | ||
|
9a28ad590c | ||
|
15fe6ce23f | ||
|
17f90de677 | ||
|
631fd755c8 | ||
|
9bceb65ad8 | ||
|
56ffa7af79 | ||
|
f210708f3b | ||
|
916cf0ae0d | ||
|
e6540229cb | ||
|
360f0e8ffd | ||
|
038bb1f6bc | ||
|
d73bee81ab | ||
|
f93187b024 | ||
|
49b45ddd18 | ||
|
8b7a737ceb | ||
|
5b88213f61 | ||
|
785df62183 | ||
|
1b025f681c | ||
|
114a9b041d | ||
|
fbd100ef10 | ||
|
e458c56139 | ||
|
b68b2a907b | ||
|
905f9190ae | ||
|
aa4f8b6fa7 | ||
|
9100e3fb65 | ||
|
47527d48ee | ||
|
989c217b3f | ||
|
1961dcf824 | ||
|
4b00eb4a9f | ||
|
6cc152e26f | ||
|
d403dcf95c | ||
|
c0e849b394 | ||
|
2e4c2d3ca8 | ||
|
1391a2d858 | ||
|
ee441b6b9a | ||
|
c384df9651 | ||
|
6479d6bb6f | ||
|
fd029201b0 | ||
|
a7c0ba6d28 | ||
|
66e9f5a8bf | ||
|
10df3ec227 | ||
|
9c0fe73102 | ||
|
1af1ba6b5f | ||
|
bea3bc74b2 | ||
|
7e4d0d83ff | ||
|
4138d4a178 | ||
|
f9202c6951 | ||
|
a3297b9ea4 | ||
|
b46f376f32 | ||
|
f02b98efe7 | ||
|
7d4bdfc913 | ||
|
1964e4f370 | ||
|
14cd81a7a1 | ||
|
1123c20da0 | ||
|
fc810dc87b | ||
|
8729616698 | ||
|
b43d986537 | ||
|
04d3dd6df1 | ||
|
603a9c4c6e | ||
|
914fdd5f0a | ||
|
08f6c222ca | ||
|
3ead4eba89 | ||
|
af51513614 | ||
|
4cf3bb9930 | ||
|
3a7bb24b40 | ||
|
729ee08631 | ||
|
80b0ac2492 | ||
|
e9a16912c3 | ||
|
4928b6d3e3 | ||
|
d0db4770ed | ||
|
38e93ed6e3 | ||
|
d52aa5a72b | ||
|
3d10636a8f | ||
|
5591666069 | ||
|
fd98dc236a | ||
|
325e116624 | ||
|
7798f09dc7 | ||
|
8e08df2fd2 | ||
|
9e9cddedc5 | ||
|
1651b041de | ||
|
30dd7d6fe4 | ||
|
71f06530df | ||
|
5601c7a672 | ||
|
35c2a729ec | ||
|
850e355049 | ||
|
6f89c51db5 | ||
|
6bf1ef0170 | ||
|
4e039a9bce | ||
|
7b44fa3737 | ||
|
f96e9d5ab7 | ||
|
f041571674 | ||
|
bb4aeed874 | ||
|
076a69907c | ||
|
fa5e326d5e | ||
|
55bfab95f9 | ||
|
fbaae0f080 | ||
|
d53a47b12f | ||
|
e3e52f6d06 | ||
|
b5897b336a | ||
|
60224ccd23 | ||
|
168b1aac2f | ||
|
fc1d6c7e84 | ||
|
e3dd4a6581 | ||
|
9cb7d727c2 | ||
|
e049b80f1a | ||
|
beb9af4313 | ||
|
8bba0df054 | ||
|
27f02d5f9f | ||
|
79ffb95f05 | ||
|
1b0ddae4eb | ||
|
ad0d876b18 | ||
|
2f371e884e | ||
|
f05a328474 | ||
|
c40f212e23 | ||
|
61859dfe14 | ||
|
eb140fd30f | ||
|
a07b0e5953 | ||
|
9975b4e4cd | ||
|
5ad1a48489 | ||
|
62681adcfb | ||
|
1720d3e096 | ||
|
92d787c817 | ||
|
816fc3ee43 | ||
|
7004a51ce6 | ||
|
3cc18d30de | ||
|
bd3665e111 | ||
|
a680220d28 | ||
|
2d1fdec618 | ||
|
b1a2215829 | ||
|
eb5f7c6a7b | ||
|
1bc23354d3 | ||
|
e6a72b2f78 | ||
|
5bed17a8af | ||
|
7b21749a19 | ||
|
0b5587fd6a | ||
|
776f77a8d4 | ||
|
583f45e2da | ||
|
9b474f239f | ||
|
9665ff15ae | ||
|
b6bf6d9bc9 | ||
|
3d9be9484d | ||
|
35fd43a6b4 | ||
|
294453fdc1 | ||
|
30a7f9f7f5 | ||
|
8f38462bbe | ||
|
ebf54c6d04 | ||
|
d7659b5093 | ||
|
e00c568ae9 | ||
|
a3988374f0 | ||
|
9732636155 | ||
|
986aee4297 | ||
|
66d3e96a1a | ||
|
9f4e1ee373 | ||
|
ff0c6b6365 | ||
|
7397efaf6d | ||
|
aadc15ce66 | ||
|
ad7c925a1a | ||
|
57be6f94bb | ||
|
35b188762c | ||
|
7c6e429854 | ||
|
c15aefd968 | ||
|
4a712354f1 | ||
|
4545c84a11 | ||
|
a66297bed8 | ||
|
f4dadfd90b | ||
|
955134b162 | ||
|
68795137da | ||
|
6ed2d61586 | ||
|
a96782218f |
189
CHANGELOG.md
189
CHANGELOG.md
@ -1,3 +1,192 @@
|
||||
# v2.10.0
|
||||
- [#904](https://github.com/xmrig/xmrig/issues/904) Added new algorithm `cn-pico/trtl` (aliases `cryptonight-turtle`, `cn-trtl`) for upcoming TurtleCoin (TRTL) fork.
|
||||
- Default value for option `max-cpu-usage` changed to `100` also this option now deprecated.
|
||||
|
||||
# v2.9.4
|
||||
- [#913](https://github.com/xmrig/xmrig/issues/913) Fixed Masari (MSR) support (this update required for upcoming fork).
|
||||
- [#915](https://github.com/xmrig/xmrig/pull/915) Improved security, JIT memory now read-only after patching.
|
||||
|
||||
# v2.9.3
|
||||
- [#909](https://github.com/xmrig/xmrig/issues/909) Fixed compile errors on FreeBSD.
|
||||
- [#912](https://github.com/xmrig/xmrig/pull/912) Fixed, C++ implementation of `cn/half` was produce up to 13% of invalid hashes.
|
||||
|
||||
# v2.9.2
|
||||
- [#907](https://github.com/xmrig/xmrig/pull/907) Fixed crash on Linux.
|
||||
|
||||
# v2.9.1
|
||||
- Restored compatibility with https://stellite.hashvault.pro.
|
||||
|
||||
# v2.9.0
|
||||
- [#899](https://github.com/xmrig/xmrig/issues/899) Added support for new algorithm `cn/half` for Masari and Stellite forks.
|
||||
- [#834](https://github.com/xmrig/xmrig/pull/834) Added ASM optimized code for AMD Bulldozer.
|
||||
- [#839](https://github.com/xmrig/xmrig/issues/839) Fixed FreeBSD compile.
|
||||
- [#857](https://github.com/xmrig/xmrig/pull/857) Fixed impossible to build for macOS without clang.
|
||||
|
||||
# v2.8.3
|
||||
- [#813](https://github.com/xmrig/xmrig/issues/813) Fixed critical bug with Minergate pool and variant 2.
|
||||
|
||||
# v2.8.1
|
||||
- [#768](https://github.com/xmrig/xmrig/issues/768) Fixed build with Visual Studio 2015.
|
||||
- [#769](https://github.com/xmrig/xmrig/issues/769) Fixed regression, some ANSI escape sequences was in log with disabled colors.
|
||||
- [#777](https://github.com/xmrig/xmrig/issues/777) Better report about pool connection issues.
|
||||
- Simplified checks for ASM auto detection, only AES support necessary.
|
||||
- Added missing options to `--help` output.
|
||||
|
||||
# v2.8.0
|
||||
- **[#753](https://github.com/xmrig/xmrig/issues/753) Added new algorithm [CryptoNight variant 2](https://github.com/xmrig/xmrig/issues/753) for Monero fork, thanks [@SChernykh](https://github.com/SChernykh).**
|
||||
- Added global and per thread option `"asm"` and and command line equivalent.
|
||||
- **[#758](https://github.com/xmrig/xmrig/issues/758) Added SSL/TLS support for secure connections to pools.**
|
||||
- Added per pool options `"tls"` and `"tls-fingerprint"` and command line equivalents.
|
||||
- [#767](https://github.com/xmrig/xmrig/issues/767) Added config autosave feature, same with GPU miners.
|
||||
- [#245](https://github.com/xmrig/xmrig-proxy/issues/245) Fixed API ID collision when run multiple miners on same machine.
|
||||
- [#757](https://github.com/xmrig/xmrig/issues/757) Fixed send buffer overflow.
|
||||
|
||||
# v2.6.4
|
||||
- [#700](https://github.com/xmrig/xmrig/issues/700) `cryptonight-lite/ipbc` replaced to `cryptonight-heavy/tube` for **Bittube (TUBE)**.
|
||||
- Added `cryptonight/rto` (cryptonight variant 1 with IPBC/TUBE mod) variant for **Arto (RTO)** coin.
|
||||
- Added `cryptonight/xao` (original cryptonight with bigger iteration count) variant for **Alloy (XAO)** coin.
|
||||
- Better variant detection for **nicehash.com** and **minergate.com**.
|
||||
- [#692](https://github.com/xmrig/xmrig/issues/692) Added support for specify both algorithm and variant via single `algo` option.
|
||||
|
||||
# v2.6.3
|
||||
- **Added support for new cryptonight-heavy variant xhv** (`cn-heavy/xhv`) for upcoming Haven Protocol fork.
|
||||
- **Added support for new cryptonight variant msr** (`cn/msr`) also known as `cryptonight-fast` for upcoming Masari fork.
|
||||
- Added new detailed hashrate report.
|
||||
- [#446](https://github.com/xmrig/xmrig/issues/446) Likely fixed SIGBUS error on 32 bit ARM CPUs.
|
||||
- [#551](https://github.com/xmrig/xmrig/issues/551) Fixed `cn-heavy` algorithm on ARMv8.
|
||||
- [#614](https://github.com/xmrig/xmrig/issues/614) Fixed display issue with huge pages percentage when colors disabled.
|
||||
- [#615](https://github.com/xmrig/xmrig/issues/615) Fixed build without libcpuid.
|
||||
- [#629](https://github.com/xmrig/xmrig/pull/629) Fixed file logging with non-seekable files.
|
||||
- [#672](https://github.com/xmrig/xmrig/pull/672) Reverted back `cryptonight-light` and exit if no valid algorithm specified.
|
||||
|
||||
# v2.6.2
|
||||
- [#607](https://github.com/xmrig/xmrig/issues/607) Fixed donation bug.
|
||||
- [#610](https://github.com/xmrig/xmrig/issues/610) Fixed ARM build.
|
||||
|
||||
# v2.6.1
|
||||
- [#168](https://github.com/xmrig/xmrig-proxy/issues/168) Added support for [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/blob/dev/doc/STRATUM_EXT.md#1-mining-algorithm-negotiation).
|
||||
- Added IPBC coin support, base algorithm `cn-lite` variant `ipbc`.
|
||||
- [#581](https://github.com/xmrig/xmrig/issues/581) Added support for upcoming Stellite (XTL) fork, base algorithm `cn` variant `xtl`, variant can set now, no need do it after fork.
|
||||
- Added support for **rig-id** stratum protocol extensions, compatible with xmr-stak.
|
||||
- Changed behavior for option `variant=-1` for `cryptonight`, now variant is `1` by default, if you mine old coins need change `variant` to `0`.
|
||||
- A lot of small fixes and better unification with proxy code.
|
||||
|
||||
# v2.6.0-beta3
|
||||
- [#563](https://github.com/xmrig/xmrig/issues/563) **Added [advanced threads mode](https://github.com/xmrig/xmrig/issues/563), now possible configure each thread individually.**
|
||||
- [#255](https://github.com/xmrig/xmrig/issues/563) Low power mode extended to **triple**, **quard** and **penta** modes.
|
||||
- [#519](https://github.com/xmrig/xmrig/issues/519) Fixed high donation levels, improved donation start time randomization.
|
||||
- [#554](https://github.com/xmrig/xmrig/issues/554) Fixed regression with `print-time` option.
|
||||
|
||||
# v2.6.0-beta2
|
||||
- Improved performance for `cryptonight v7` especially in double hash mode.
|
||||
- [#499](https://github.com/xmrig/xmrig/issues/499) IPv6 disabled for internal HTTP API by default, was causing issues on some systems.
|
||||
- Added short aliases for algorithm names: `cn`, `cn-lite` and `cn-heavy`.
|
||||
- Fixed regressions (v2.6.0-beta1 affected)
|
||||
- [#494](https://github.com/xmrig/xmrig/issues/494) Command line option `--donate-level` was broken.
|
||||
- [#502](https://github.com/xmrig/xmrig/issues/502) Build without libmicrohttpd was broken.
|
||||
- Fixed nonce calculation for `--av 4` (software AES, double hash) was causing reduction of effective hashrate and rejected shares on nicehash.
|
||||
|
||||
# v2.6.0-beta1
|
||||
- [#476](https://github.com/xmrig/xmrig/issues/476) **Added Cryptonight-Heavy support for Sumokoin ASIC resistance fork.**
|
||||
- HTTP server now runs in main loop, it make possible easy extend API without worry about thread synchronization.
|
||||
- Added initial graceful reload support, miner will reload configuration if config file changed, disabled by default until it will be fully implemented and tested.
|
||||
- Added API endpoint `PUT /1/config` to update current config.
|
||||
- Added API endpoint `GET /1/config` to get current active config.
|
||||
- Added API endpoint `GET /1/threads` to get current active threads configuration.
|
||||
- API endpoint `GET /` now deprecated, use `GET /1/summary` instead.
|
||||
- Added `--api-no-ipv6` and similar config option to disable IPv6 support for HTTP API.
|
||||
- Added `--api-no-restricted` to enable full access to api, this option has no effect if `--api-access-token` not specified.
|
||||
|
||||
# v2.5.3
|
||||
- Fixed critical bug, in some cases miner was can't recovery connection and switch to failover pool, version 2.5.2 affected. If you use v2.6.0-beta3 this issue doesn't concern you.
|
||||
- [#499](https://github.com/xmrig/xmrig/issues/499) IPv6 support disabled for internal HTTP API.
|
||||
- Added workaround for nicehash.com if you use `cryptonightv7.<region>.nicehash.com` option `variant=1` will be set automatically.
|
||||
|
||||
# v2.5.2
|
||||
- [#448](https://github.com/xmrig/xmrig/issues/478) Fixed broken reconnect.
|
||||
|
||||
# v2.5.1
|
||||
- [#454](https://github.com/xmrig/xmrig/issues/454) Fixed build with libmicrohttpd version below v0.9.35.
|
||||
- [#456](https://github.com/xmrig/xmrig/issues/459) Verbose errors related to donation pool was not fully silenced.
|
||||
- [#459](https://github.com/xmrig/xmrig/issues/459) Fixed regression (version 2.5.0 affected) with connection to **xmr.f2pool.com**.
|
||||
|
||||
# v2.5.0
|
||||
- [#434](https://github.com/xmrig/xmrig/issues/434) **Added support for Monero v7 PoW, scheduled on April 6.**
|
||||
- Added full IPv6 support.
|
||||
- Added protocol extension, when use the miner with xmrig-proxy 2.5+ no more need manually specify `nicehash` option.
|
||||
- [#123](https://github.com/xmrig/xmrig-proxy/issues/123) Fixed regression (all versions since 2.4 affected) fragmented responses from pool/proxy was parsed incorrectly.
|
||||
- [#428](https://github.com/xmrig/xmrig/issues/428) Fixed regression (version 2.4.5 affected) with CPU cache size detection.
|
||||
|
||||
# v2.4.5
|
||||
- [#324](https://github.com/xmrig/xmrig/pull/324) Fixed build without libmicrohttpd (CMake cache issue).
|
||||
- [#341](https://github.com/xmrig/xmrig/issues/341) Fixed wrong exit code and added command line option `--dry-run`.
|
||||
- [#385](https://github.com/xmrig/xmrig/pull/385) Up to 20% performance increase for non-AES CPU and fixed Intel Core 2 cache detection.
|
||||
|
||||
# v2.4.4
|
||||
- Added libmicrohttpd version to --version output.
|
||||
- Fixed bug in singal handler, in some cases miner wasn't shutdown properly.
|
||||
- Fixed recent MSVC 2017 version detection.
|
||||
- [#279](https://github.com/xmrig/xmrig/pull/279) Fixed build on some macOS versions.
|
||||
|
||||
# v2.4.3
|
||||
- [#94](https://github.com/xmrig/xmrig/issues/94#issuecomment-342019257) [#216](https://github.com/xmrig/xmrig/issues/216) Added **ARMv8** and **ARMv7** support. Hardware AES supported, thanks [Imran Yusuff](https://github.com/imranyusuff).
|
||||
- [#157](https://github.com/xmrig/xmrig/issues/157) [#196](https://github.com/xmrig/xmrig/issues/196) Fixed Linux compile issues.
|
||||
- [#184](https://github.com/xmrig/xmrig/issues/184) Fixed cache size detection for CPUs with disabled Hyper-Threading.
|
||||
- [#200](https://github.com/xmrig/xmrig/issues/200) In some cases miner was doesn't write log to stdout.
|
||||
|
||||
# v2.4.2
|
||||
- [#60](https://github.com/xmrig/xmrig/issues/60) Added FreeBSD support, thanks [vcambur](https://github.com/vcambur).
|
||||
- [#153](https://github.com/xmrig/xmrig/issues/153) Fixed issues with dwarfpool.com.
|
||||
|
||||
# v2.4.1
|
||||
- [#147](https://github.com/xmrig/xmrig/issues/147) Fixed comparability with monero-stratum.
|
||||
|
||||
# v2.4.0
|
||||
- Added [HTTP API](https://github.com/xmrig/xmrig/wiki/API).
|
||||
- Added comments support in config file.
|
||||
- libjansson replaced to rapidjson.
|
||||
- [#98](https://github.com/xmrig/xmrig/issues/98) Ignore `keepalive` option with minergate.com and nicehash.com.
|
||||
- [#101](https://github.com/xmrig/xmrig/issues/101) Fixed MSVC 2017 (15.3) compile time version detection.
|
||||
- [#108](https://github.com/xmrig/xmrig/issues/108) Silently ignore invalid values for `donate-level` option.
|
||||
- [#111](https://github.com/xmrig/xmrig/issues/111) Fixed build without AEON support.
|
||||
|
||||
# v2.3.1
|
||||
- [#68](https://github.com/xmrig/xmrig/issues/68) Fixed compatibility with Docker containers, was nothing print on console.
|
||||
|
||||
# v2.3.0
|
||||
- Added `--cpu-priority` option (0 idle, 2 normal to 5 highest).
|
||||
- Added `--user-agent` option, to set custom user-agent string for pool. For example `cpuminer-multi/0.1`.
|
||||
- Added `--no-huge-pages` option, to disable huge pages support.
|
||||
- [#62](https://github.com/xmrig/xmrig/issues/62) Don't send the login to the dev pool.
|
||||
- Force reconnect if pool block miner IP address. helps switch to backup pool.
|
||||
- Fixed: failed open default config file if path contains non English characters.
|
||||
- Fixed: error occurred if try use unavailable stdin or stdout, regression since version 2.2.0.
|
||||
- Fixed: message about huge pages support successfully enabled on Windows was not shown in release builds.
|
||||
|
||||
# v2.2.1
|
||||
- Fixed [terminal issues](https://github.com/xmrig/xmrig-proxy/issues/2#issuecomment-319914085) after exit on Linux and OS X.
|
||||
|
||||
# v2.2.0
|
||||
- [#46](https://github.com/xmrig/xmrig/issues/46) Restored config file support. Now possible use multiple config files and combine with command line options also added support for default config.
|
||||
- Improved colors support on Windows, now used uv_tty, legacy code removed.
|
||||
- QuickEdit Mode now disabled on Windows.
|
||||
- Added interactive commands in console window:: **h**ashrate, **p**ause, **r**esume.
|
||||
- Fixed autoconf mode for AMD FX CPUs.
|
||||
|
||||
# v2.1.0
|
||||
- [#40](https://github.com/xmrig/xmrig/issues/40)
|
||||
Improved miner shutdown, fixed crash on exit for Linux and OS X.
|
||||
- Fixed, login request was contain malformed JSON if username or password has some special characters for example `\`.
|
||||
- [#220](https://github.com/fireice-uk/xmr-stak-cpu/pull/220) Better support for Round Robin DNS, IP address now always chosen randomly instead of stuck on first one.
|
||||
- Changed donation address, new [xmrig-proxy](https://github.com/xmrig/xmrig-proxy) is coming soon.
|
||||
|
||||
# v2.0.2
|
||||
- Better deal with possible duplicate jobs from pool, show warning and ignore duplicates.
|
||||
- For Windows builds libuv updated to version 1.13.1 and gcc to 7.1.0.
|
||||
|
||||
# v2.0.1
|
||||
- [#27](https://github.com/xmrig/xmrig/issues/27) Fixed possibility crash on 32bit systems.
|
||||
|
||||
# v2.0.0
|
||||
- Option `--backup-url` removed, instead now possibility specify multiple pools for example: `-o example1.com:3333 -u user1 -p password1 -k -o example2.com:5555 -u user2 -o example3.com:4444 -u user3`
|
||||
- [#15](https://github.com/xmrig/xmrig/issues/15) Added option `-l, --log-file=FILE` to write log to file.
|
||||
|
258
CMakeLists.txt
258
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
133
README.md
133
README.md
@ -1,8 +1,19 @@
|
||||
# XMRig
|
||||
XMRig is high performance Monero (XMR) CPU miner, with the official full Windows support.
|
||||
Based on cpuminer-multi with heavy optimizations/rewrites and removing a lot of legacy code.
|
||||
|
||||
<img src="http://i.imgur.com/GdRDnAu.png" width="596" >
|
||||
[![Github All Releases](https://img.shields.io/github/downloads/xmrig/xmrig/total.svg)](https://github.com/xmrig/xmrig/releases)
|
||||
[![GitHub release](https://img.shields.io/github/release/xmrig/xmrig/all.svg)](https://github.com/xmrig/xmrig/releases)
|
||||
[![GitHub Release Date](https://img.shields.io/github/release-date-pre/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/releases)
|
||||
[![GitHub license](https://img.shields.io/github/license/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/blob/master/LICENSE)
|
||||
[![GitHub stars](https://img.shields.io/github/stars/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/stargazers)
|
||||
[![GitHub forks](https://img.shields.io/github/forks/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/network)
|
||||
|
||||
XMRig is a high performance Monero (XMR) CPU miner, with official support for Windows.
|
||||
Originally based on cpuminer-multi with heavy optimizations/rewrites and removing a lot of legacy code, since version 1.0.0 completely rewritten from scratch on C++.
|
||||
|
||||
* This is the **CPU-mining** version, there is also a [NVIDIA GPU version](https://github.com/xmrig/xmrig-nvidia) and [AMD GPU version]( https://github.com/xmrig/xmrig-amd).
|
||||
* [Roadmap](https://github.com/xmrig/xmrig/issues/106) for next releases.
|
||||
|
||||
<img src="http://i.imgur.com/OKZRVDh.png" width="619" >
|
||||
|
||||
#### Table of contents
|
||||
* [Features](#features)
|
||||
@ -13,12 +24,14 @@ Based on cpuminer-multi with heavy optimizations/rewrites and removing a lot of
|
||||
* [Common Issues](#common-issues)
|
||||
* [Other information](#other-information)
|
||||
* [Donations](#donations)
|
||||
* [Release checksums](#release-checksums)
|
||||
* [Contacts](#contacts)
|
||||
|
||||
## Features
|
||||
* High performance (290+ H/s on i7 6700).
|
||||
* High performance.
|
||||
* Official Windows support.
|
||||
* Small Windows executable, only 535 KB without dependencies.
|
||||
* Small Windows executable, without dependencies.
|
||||
* x86/x64 support.
|
||||
* Support for backup (failover) mining server.
|
||||
* keepalived support.
|
||||
* Command line options compatible with cpuminer.
|
||||
@ -30,73 +43,96 @@ Based on cpuminer-multi with heavy optimizations/rewrites and removing a lot of
|
||||
## Download
|
||||
* Binary releases: https://github.com/xmrig/xmrig/releases
|
||||
* Git tree: https://github.com/xmrig/xmrig.git
|
||||
* Clone with `git clone https://github.com/xmrig/xmrig.git`
|
||||
* Clone with `git clone https://github.com/xmrig/xmrig.git` :hammer: [Build instructions](https://github.com/xmrig/xmrig/wiki/Build).
|
||||
|
||||
## Usage
|
||||
### Basic example
|
||||
```
|
||||
xmrig.exe -o xmr-eu.dwarfpool.com:8005 -u YOUR_WALLET -p x -k
|
||||
```
|
||||
|
||||
### Failover
|
||||
```
|
||||
xmrig.exe -o pool.supportxmr.com:5555 -u YOUR_WALLET1 -k -o xmr-eu.dwarfpool.com:8005 -u YOUR_WALLET2 -p x -k
|
||||
```
|
||||
For failover you can add multiple pools, maximum count not limited.
|
||||
Use [config.xmrig.com](https://config.xmrig.com/xmrig) to generate, edit or share configurations.
|
||||
|
||||
### Options
|
||||
```
|
||||
-a, --algo=ALGO cryptonight (default) or cryptonight-lite
|
||||
-o, --url=URL URL of mining server
|
||||
-O, --userpass=U:P username:password pair for mining server
|
||||
-u, --user=USERNAME username for mining server
|
||||
-p, --pass=PASSWORD password for mining server
|
||||
-t, --threads=N number of miner threads
|
||||
-v, --av=N algorithm variation, 0 auto select
|
||||
-k, --keepalive send keepalived for prevent timeout (need pool support)
|
||||
-r, --retries=N number of times to retry before switch to backup server (default: 5)
|
||||
-R, --retry-pause=N time to pause between retries (default: 5)
|
||||
--cpu-affinity set process affinity to cpu core(s), mask 0x3 for cores 0 and 1
|
||||
--no-color disable colored output
|
||||
--donate-level=N donate level, default 5% (5 minutes in 100 minutes)
|
||||
-B, --background run the miner in the background
|
||||
-c, --config=FILE load a JSON-format configuration file
|
||||
--max-cpu-usage=N maximum cpu usage for automatic threads mode (default 75)
|
||||
--safe safe adjust threads and av settings for current cpu
|
||||
--nicehash enable nicehash support
|
||||
--print-time=N print hashrate report every N seconds
|
||||
-h, --help display this help and exit
|
||||
-V, --version output version information and exit
|
||||
-a, --algo=ALGO specify the algorithm to use
|
||||
cryptonight
|
||||
cryptonight-lite
|
||||
cryptonight-heavy
|
||||
-o, --url=URL URL of mining server
|
||||
-O, --userpass=U:P username:password pair for mining server
|
||||
-u, --user=USERNAME username for mining server
|
||||
-p, --pass=PASSWORD password for mining server
|
||||
--rig-id=ID rig identifier for pool-side statistics (needs pool support)
|
||||
-t, --threads=N number of miner threads
|
||||
-v, --av=N algorithm variation, 0 auto select
|
||||
-k, --keepalive send keepalived packet for prevent timeout (needs pool support)
|
||||
--nicehash enable nicehash.com support
|
||||
--tls enable SSL/TLS support (needs pool support)
|
||||
--tls-fingerprint=F pool TLS certificate fingerprint, if set enable strict certificate pinning
|
||||
-r, --retries=N number of times to retry before switch to backup server (default: 5)
|
||||
-R, --retry-pause=N time to pause between retries (default: 5)
|
||||
--cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1
|
||||
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)
|
||||
--no-huge-pages disable huge pages support
|
||||
--no-color disable colored output
|
||||
--variant algorithm PoW variant
|
||||
--donate-level=N donate level, default 5% (5 minutes in 100 minutes)
|
||||
--user-agent set custom user-agent string for pool
|
||||
-B, --background run the miner in the background
|
||||
-c, --config=FILE load a JSON-format configuration file
|
||||
-l, --log-file=FILE log all output to a file
|
||||
-S, --syslog use system log for output messages
|
||||
--max-cpu-usage=N maximum CPU usage for automatic threads mode (default 75)
|
||||
--safe safe adjust threads and av settings for current CPU
|
||||
--asm=ASM ASM code for cn/2, possible values: auto, none, intel, ryzen.
|
||||
--print-time=N print hashrate report every N seconds
|
||||
--api-port=N port for the miner API
|
||||
--api-access-token=T access token for API
|
||||
--api-worker-id=ID custom worker-id for API
|
||||
--api-id=ID custom instance ID for API
|
||||
--api-ipv6 enable IPv6 support for API
|
||||
--api-no-restricted enable full remote access (only if API token set)
|
||||
--dry-run test configuration and exit
|
||||
-h, --help display this help and exit
|
||||
-V, --version output version information and exit
|
||||
```
|
||||
|
||||
Also you can use configuration via config file, default name **config.json**. Some options available only via config file: [`autosave`](https://github.com/xmrig/xmrig/issues/767), [`hw-aes`](https://github.com/xmrig/xmrig/issues/563). `watch` option currently not implemented in miners only in proxy.
|
||||
|
||||
## Algorithm variations
|
||||
Since version 0.8.0.
|
||||
* `--av=1` For CPUs with hardware AES.
|
||||
* `--av=2` Lower power mode (double hash) of `1`.
|
||||
* `--av=3` Software AES implementation.
|
||||
* `--av=4` Lower power mode (double hash) of `3`.
|
||||
|
||||
- `av` option used for automatic and simple threads mode (when you specify only threads count).
|
||||
- For [advanced threads mode](https://github.com/xmrig/xmrig/issues/563) each thread configured individually and `av` option not used.
|
||||
|
||||
| av | Hashes per round | Hardware AES |
|
||||
|----|------------------|--------------|
|
||||
| 1 | 1 (Single) | yes |
|
||||
| 2 | 2 (Double) | yes |
|
||||
| 3 | 1 (Single) | no |
|
||||
| 4 | 2 (Double) | no |
|
||||
| 5 | 3 (Triple) | yes |
|
||||
| 6 | 4 (Quard) | yes |
|
||||
| 7 | 5 (Penta) | yes |
|
||||
| 8 | 3 (Triple) | no |
|
||||
| 9 | 4 (Quard) | no |
|
||||
| 10 | 5 (Penta) | no |
|
||||
|
||||
## Common Issues
|
||||
### HUGE PAGES unavailable
|
||||
* Run XMRig as Administrator.
|
||||
* Since version 0.8.0 XMRig automatically enable SeLockMemoryPrivilege for current user, but reboot or sign out still required. [Manual instruction](https://msdn.microsoft.com/en-gb/library/ms190730.aspx).
|
||||
* Since version 0.8.0 XMRig automatically enables SeLockMemoryPrivilege for current user, but reboot or sign out still required. [Manual instruction](https://msdn.microsoft.com/en-gb/library/ms190730.aspx).
|
||||
|
||||
## Other information
|
||||
* No HTTP support, only stratum protocol support.
|
||||
* No TLS support.
|
||||
* Default donation 5% (5 minutes in 100 minutes) can be reduced to 1% via command line option `--donate-level`.
|
||||
* Default donation 5% (5 minutes in 100 minutes) can be reduced to 1% via option `donate-level`.
|
||||
|
||||
|
||||
### CPU mining performance
|
||||
* **i7-6700** - 290+ H/s (4 threads, cpu affinity 0xAA)
|
||||
* **Dual E5620** - 377 H/s (12 threads, cpu affinity 0xEEEE)
|
||||
* **Intel i7-7700** - 307 H/s (4 threads)
|
||||
* **AMD Ryzen 7 1700X** - 560 H/s (8 threads)
|
||||
|
||||
Please note performance is highly dependent on system load. The numbers above are obtained on an idle system. Tasks heavily using a processor cache, such as video playback, can greatly degrade hashrate. Optimal number of threads depends on the size of the L3 cache of a processor, 1 thread requires 2 MB of cache.
|
||||
|
||||
### Maximum performance checklist
|
||||
* Idle operating system.
|
||||
* Do not exceed optimal thread count.
|
||||
* Use modern CPUs with AES-NI instructuon set.
|
||||
* Use modern CPUs with AES-NI instruction set.
|
||||
* Try setup optimal cpu affinity.
|
||||
* Enable fast memory (Large/Huge pages).
|
||||
|
||||
@ -107,3 +143,4 @@ Please note performance is highly dependent on system load. The numbers above ar
|
||||
## Contacts
|
||||
* support@xmrig.com
|
||||
* [reddit](https://www.reddit.com/user/XMRig/)
|
||||
* [twitter](https://twitter.com/xmrig_dev)
|
||||
|
49
cmake/FindMHD.cmake
Normal file
49
cmake/FindMHD.cmake
Normal file
@ -0,0 +1,49 @@
|
||||
# - Try to find MHD
|
||||
# Once done this will define
|
||||
#
|
||||
# MHD_FOUND - system has MHD
|
||||
# MHD_INCLUDE_DIRS - the MHD include directory
|
||||
# MHD_LIBRARY - Link these to use MHD
|
||||
|
||||
find_path(
|
||||
MHD_INCLUDE_DIR
|
||||
NAMES microhttpd.h
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "include"
|
||||
DOC "microhttpd include dir"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(MHD_INCLUDE_DIR NAMES microhttpd.h)
|
||||
|
||||
find_library(
|
||||
MHD_LIBRARY
|
||||
NAMES libmicrohttpd.a microhttpd libmicrohttpd
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "lib"
|
||||
DOC "microhttpd library"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(MHD_LIBRARY NAMES microhttpd libmicrohttpd)
|
||||
|
||||
set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
|
||||
set(MHD_LIBRARIES ${MHD_LIBRARY})
|
||||
|
||||
# debug library on windows
|
||||
# same naming convention as in qt (appending debug library with d)
|
||||
# boost is using the same "hack" as us with "optimized" and "debug"
|
||||
# official MHD project actually uses _d suffix
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||||
find_library(
|
||||
MHD_LIBRARY_DEBUG
|
||||
NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
|
||||
DOC "mhd debug library"
|
||||
)
|
||||
set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MHD DEFAULT_MSG MHD_LIBRARY MHD_INCLUDE_DIR)
|
||||
mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)
|
||||
|
@ -1,5 +1,22 @@
|
||||
find_path(
|
||||
UV_INCLUDE_DIR
|
||||
NAMES uv.h
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "include"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(UV_INCLUDE_DIR NAMES uv.h)
|
||||
find_library(UV_LIBRARY NAMES uv libuv)
|
||||
|
||||
find_library(
|
||||
UV_LIBRARY
|
||||
NAMES libuv.a uv libuv
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "lib"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(UV_LIBRARY NAMES libuv.a uv libuv)
|
||||
|
||||
set(UV_LIBRARIES ${UV_LIBRARY})
|
||||
set(UV_INCLUDE_DIRS ${UV_INCLUDE_DIR})
|
||||
|
25
cmake/OpenSSL.cmake
Normal file
25
cmake/OpenSSL.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
if (WITH_TLS)
|
||||
set(OPENSSL_ROOT_DIR ${XMRIG_DEPS})
|
||||
|
||||
if (WIN32)
|
||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||
set(OPENSSL_MSVC_STATIC_RT TRUE)
|
||||
|
||||
set(EXTRA_LIBS ${EXTRA_LIBS} Crypt32)
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
set(TLS_SOURCES src/common/net/Tls.h src/common/net/Tls.cpp)
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
else()
|
||||
message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support")
|
||||
endif()
|
||||
else()
|
||||
set(TLS_SOURCES "")
|
||||
set(OPENSSL_LIBRARIES "")
|
||||
add_definitions(/DXMRIG_NO_TLS)
|
||||
|
||||
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
|
||||
endif()
|
33
cmake/asm.cmake
Normal file
33
cmake/asm.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(XMRIG_ASM_LIBRARY "xmrig-asm")
|
||||
|
||||
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
enable_language(ASM_MASM)
|
||||
|
||||
if (MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/cn_main_loop.asm")
|
||||
else()
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/win64/cn_main_loop.asm")
|
||||
endif()
|
||||
|
||||
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY ASM_MASM)
|
||||
else()
|
||||
enable_language(ASM)
|
||||
|
||||
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/win64/cn_main_loop.S")
|
||||
else()
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/cn_main_loop.S")
|
||||
endif()
|
||||
|
||||
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY C)
|
||||
endif()
|
||||
|
||||
add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILE})
|
||||
set(XMRIG_ASM_SOURCES src/crypto/Asm.h src/crypto/Asm.cpp)
|
||||
set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C)
|
||||
else()
|
||||
set(XMRIG_ASM_SOURCES "")
|
||||
set(XMRIG_ASM_LIBRARY "")
|
||||
add_definitions(/DXMRIG_NO_ASM)
|
||||
endif()
|
25
cmake/cpu.cmake
Normal file
25
cmake/cpu.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
if (NOT CMAKE_SYSTEM_PROCESSOR)
|
||||
message(WARNING "CMAKE_SYSTEM_PROCESSOR not defined")
|
||||
endif()
|
||||
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
|
||||
add_definitions(/DRAPIDJSON_SSE2)
|
||||
endif()
|
||||
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64)$")
|
||||
set(XMRIG_ARM ON)
|
||||
set(XMRIG_ARMv8 ON)
|
||||
set(WITH_LIBCPUID OFF)
|
||||
|
||||
add_definitions(/DXMRIG_ARM)
|
||||
add_definitions(/DXMRIG_ARMv8)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7|armv7f|armv7s|armv7k|armv7-a|armv7l)$")
|
||||
set(XMRIG_ARM ON)
|
||||
set(XMRIG_ARMv7 ON)
|
||||
set(WITH_LIBCPUID OFF)
|
||||
|
||||
add_definitions(/DXMRIG_ARM)
|
||||
add_definitions(/DXMRIG_ARMv7)
|
||||
endif()
|
73
cmake/flags.cmake
Normal file
73
cmake/flags.cmake
Normal file
@ -0,0 +1,73 @@
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_definitions(/DNDEBUG)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-strict-aliasing")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -Wno-class-memaccess")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -s")
|
||||
|
||||
if (XMRIG_ARMv8)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a+crypto")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crypto -flax-vector-conversions")
|
||||
elseif (XMRIG_ARMv7)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -flax-vector-conversions")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
else()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
||||
endif()
|
||||
|
||||
add_definitions(/D_GNU_SOURCE)
|
||||
|
||||
if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif()
|
||||
|
||||
#set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -gdwarf-2")
|
||||
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Ox /Ot /Oi /MT /GL")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /Ot /Oi /MT /GL")
|
||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
|
||||
add_definitions(/DNOMINMAX)
|
||||
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -Wno-missing-braces")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants")
|
||||
|
||||
if (XMRIG_ARMv8)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a+crypto")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crypto")
|
||||
elseif (XMRIG_ARMv7)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -march=${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=${CMAKE_SYSTEM_PROCESSOR}")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
|
||||
endif()
|
||||
|
||||
endif()
|
31
doc/ALGORITHMS.md
Normal file
31
doc/ALGORITHMS.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Algorithms
|
||||
|
||||
XMRig uses a different way to specify algorithms, compared to other miners.
|
||||
|
||||
Algorithm selection splitted to 2 parts:
|
||||
|
||||
* Global base algorithm per miner or proxy instance, `algo` option. Possible values: `cryptonight`, `cryptonight-lite`, `cryptonight-heavy`.
|
||||
* Algorithm variant specified separately for each pool, `variant` option.
|
||||
* [Full table for supported algorithm and variants.](https://github.com/xmrig/xmrig-proxy/blob/master/doc/STRATUM_EXT.md#14-algorithm-names-and-variants)
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"algo": "cryptonight",
|
||||
...
|
||||
"pools": [
|
||||
{
|
||||
"url": "...",
|
||||
"variant": 1,
|
||||
...
|
||||
}
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
## Mining algorithm negotiation
|
||||
If your pool support [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/issues/168) miner will choice proper variant automaticaly and if you choice wrong base algorithm you will see error message.
|
||||
|
||||
Pools with mining algorithm negotiation support.
|
||||
* [www.hashvault.pro](https://www.hashvault.pro/)
|
53
doc/API.md
Normal file
53
doc/API.md
Normal file
@ -0,0 +1,53 @@
|
||||
# HTTP API
|
||||
|
||||
If you want use API you need choice a port where is internal HTTP server will listen for incoming connections. API will not available if miner built without `libmicrohttpd`.
|
||||
|
||||
Example configuration:
|
||||
|
||||
```json
|
||||
"api": {
|
||||
"port": 44444,
|
||||
"access-token": "TOKEN",
|
||||
"worker-id": null,
|
||||
"ipv6": false,
|
||||
"restricted": false
|
||||
},
|
||||
```
|
||||
|
||||
* **port** Port for incoming connections `http://<miner ip>:<port>`.
|
||||
* **access-token** [Bearer](https://gist.github.com/xmrig/c75fdd1f8e0f3bac05500be2ab718f8e#file-api-html-L54) access token to secure access to API.
|
||||
* **worker-id** Optional worker name, if not set will be detected automatically.
|
||||
* **ipv6** Enable (`true`) or disable (`false`) IPv6 for API.
|
||||
* **restricted** Use `false` to allow remote configuration.
|
||||
|
||||
If you prefer use command line options instead of config file, you can use options: `--api-port`, `--api-access-token`, `--api-worker-id`, `--api-ipv6` and `api-no-restricted`.
|
||||
|
||||
## Endpoints
|
||||
|
||||
### GET /1/summary
|
||||
|
||||
Get miner summary information. [Example](api/1/summary.json).
|
||||
|
||||
### GET /1/threads
|
||||
|
||||
Get detailed information about miner threads. [Example](api/1/threads.json).
|
||||
|
||||
|
||||
## Restricted endpoints
|
||||
|
||||
All API endpoints below allow access to sensitive information and remote configure miner. You should set `access-token` and allow unrestricted access (`"restricted": false`).
|
||||
|
||||
### GET /1/config
|
||||
|
||||
Get current miner configuration. [Example](api/1/config.json).
|
||||
|
||||
|
||||
### PUT /1/config
|
||||
|
||||
Update current miner configuration. Common use case, get current configuration, make changes, and upload it to miner.
|
||||
|
||||
Curl example:
|
||||
|
||||
```
|
||||
curl -v --data-binary @config.json -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer SECRET" http://127.0.0.1:44444/1/config
|
||||
```
|
63
doc/api/1/config.json
Normal file
63
doc/api/1/config.json
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"algo": "cryptonight",
|
||||
"api": {
|
||||
"port": 44444,
|
||||
"access-token": "TOKEN",
|
||||
"worker-id": null,
|
||||
"ipv6": false,
|
||||
"restricted": false
|
||||
},
|
||||
"av": 1,
|
||||
"background": false,
|
||||
"colors": true,
|
||||
"cpu-affinity": null,
|
||||
"cpu-priority": null,
|
||||
"donate-level": 5,
|
||||
"huge-pages": true,
|
||||
"hw-aes": null,
|
||||
"log-file": null,
|
||||
"max-cpu-usage": 75,
|
||||
"pools": [
|
||||
{
|
||||
"url": "pool.monero.hashvault.pro:3333",
|
||||
"user": "48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD",
|
||||
"pass": "x",
|
||||
"keepalive": false,
|
||||
"nicehash": false,
|
||||
"variant": -1
|
||||
},
|
||||
{
|
||||
"url": "pool.supportxmr.com:3333",
|
||||
"user": "48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD",
|
||||
"pass": "x",
|
||||
"keepalive": false,
|
||||
"nicehash": false,
|
||||
"variant": -1
|
||||
}
|
||||
],
|
||||
"print-time": 60,
|
||||
"retries": 5,
|
||||
"retry-pause": 5,
|
||||
"safe": false,
|
||||
"threads": [
|
||||
{
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 0
|
||||
},
|
||||
{
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 1
|
||||
},
|
||||
{
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 2
|
||||
},
|
||||
{
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 3
|
||||
}
|
||||
],
|
||||
"user-agent": null,
|
||||
"syslog": false,
|
||||
"watch": false
|
||||
}
|
73
doc/api/1/summary.json
Normal file
73
doc/api/1/summary.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"id": "92f3104f9a2ee78c",
|
||||
"worker_id": "Ubuntu-1604-xenial-64-minimal",
|
||||
"version": "2.6.0-beta3",
|
||||
"kind": "cpu",
|
||||
"ua": "XMRig/2.6.0-beta3 (Linux x86_64) libuv/1.8.0 gcc/5.4.0",
|
||||
"cpu": {
|
||||
"brand": "Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz",
|
||||
"aes": true,
|
||||
"x64": true,
|
||||
"sockets": 1
|
||||
},
|
||||
"algo": "cryptonight",
|
||||
"hugepages": true,
|
||||
"donate_level": 5,
|
||||
"hashrate": {
|
||||
"total": [
|
||||
296.24,
|
||||
296.23,
|
||||
295.97
|
||||
],
|
||||
"highest": 296.5,
|
||||
"threads": [
|
||||
[
|
||||
73.39,
|
||||
73.39,
|
||||
73.28
|
||||
],
|
||||
[
|
||||
74.72,
|
||||
74.72,
|
||||
74.71
|
||||
],
|
||||
[
|
||||
74.72,
|
||||
74.72,
|
||||
74.71
|
||||
],
|
||||
[
|
||||
73.39,
|
||||
73.39,
|
||||
73.27
|
||||
]
|
||||
]
|
||||
},
|
||||
"results": {
|
||||
"diff_current": 9990,
|
||||
"shares_good": 30,
|
||||
"shares_total": 30,
|
||||
"avg_time": 31,
|
||||
"hashes_total": 311833,
|
||||
"best": [
|
||||
278199,
|
||||
181923,
|
||||
103717,
|
||||
96632,
|
||||
56154,
|
||||
51580,
|
||||
45667,
|
||||
33159,
|
||||
29581,
|
||||
29514
|
||||
],
|
||||
"error_log": []
|
||||
},
|
||||
"connection": {
|
||||
"pool": "pool.monero.hashvault.pro:3333",
|
||||
"uptime": 953,
|
||||
"ping": 35,
|
||||
"failures": 0,
|
||||
"error_log": []
|
||||
}
|
||||
}
|
65
doc/api/1/threads.json
Normal file
65
doc/api/1/threads.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"hugepages": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"memory": 8388608,
|
||||
"threads": [
|
||||
{
|
||||
"type": "cpu",
|
||||
"algo": "cryptonight",
|
||||
"av": 1,
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 0,
|
||||
"priority": -1,
|
||||
"soft_aes": false,
|
||||
"hashrate": [
|
||||
73.39,
|
||||
73.4,
|
||||
73.28
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"algo": "cryptonight",
|
||||
"av": 1,
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 1,
|
||||
"priority": -1,
|
||||
"soft_aes": false,
|
||||
"hashrate": [
|
||||
74.72,
|
||||
74.72,
|
||||
74.7
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"algo": "cryptonight",
|
||||
"av": 1,
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 2,
|
||||
"priority": -1,
|
||||
"soft_aes": false,
|
||||
"hashrate": [
|
||||
74.71,
|
||||
74.72,
|
||||
74.7
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"algo": "cryptonight",
|
||||
"av": 1,
|
||||
"low_power_mode": 1,
|
||||
"affine_to_cpu": 3,
|
||||
"priority": -1,
|
||||
"soft_aes": false,
|
||||
"hashrate": [
|
||||
73.39,
|
||||
73.4,
|
||||
73.28
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
BIN
res/app.ico
BIN
res/app.ico
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 21 KiB |
@ -4,8 +4,8 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "app.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_BUILD,APP_VER_REV
|
||||
PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_BUILD,APP_VER_REV
|
||||
FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_PATCH,0
|
||||
PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_PATCH,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
|
65
src/3rdparty/aligned_malloc.h
vendored
Normal file
65
src/3rdparty/aligned_malloc.h
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2016-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __ALIGNED_MALLOC_H__
|
||||
#define __ALIGNED_MALLOC_H__
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size);
|
||||
#else
|
||||
// Some systems (e.g. those with GNU libc) declare posix_memalign with an
|
||||
// exception specifier. Via an "egregious workaround" in
|
||||
// Sema::CheckEquivalentExceptionSpec, Clang accepts the following as a valid
|
||||
// redeclaration of glibc's declaration.
|
||||
extern "C" int posix_memalign(void **__memptr, size_t __alignment, size_t __size);
|
||||
#endif
|
||||
|
||||
|
||||
static __inline__ void *__attribute__((__always_inline__, __malloc__)) _mm_malloc(size_t __size, size_t __align)
|
||||
{
|
||||
if (__align == 1) {
|
||||
return malloc(__size);
|
||||
}
|
||||
|
||||
if (!(__align & (__align - 1)) && __align < sizeof(void *))
|
||||
__align = sizeof(void *);
|
||||
|
||||
void *__mallocedMemory;
|
||||
if (posix_memalign(&__mallocedMemory, __align, __size)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return __mallocedMemory;
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__)) _mm_free(void *__p)
|
||||
{
|
||||
free(__p);
|
||||
}
|
||||
|
||||
#endif /* __ALIGNED_MALLOC_H__ */
|
2
src/3rdparty/getopt/getopt.h
vendored
2
src/3rdparty/getopt/getopt.h
vendored
@ -56,7 +56,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma warning(disable:4996);
|
||||
#pragma warning(disable:4996)
|
||||
|
||||
#define __GETOPT_H__
|
||||
|
||||
|
25
src/3rdparty/jansson/CMakeLists.txt
vendored
25
src/3rdparty/jansson/CMakeLists.txt
vendored
@ -1,25 +0,0 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
project (jansson C)
|
||||
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
|
||||
# Add the lib sources.
|
||||
file(GLOB JANSSON_SRC *.c)
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os")
|
||||
|
||||
set(JANSSON_HDR_PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hashtable.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jansson_private.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/strbuffer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/utf.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jansson_private_config.h)
|
||||
|
||||
set(JANSSON_HDR_PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jansson_config.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jansson.h)
|
||||
|
||||
add_library(jansson STATIC
|
||||
${JANSSON_SRC}
|
||||
${JANSSON_HDR_PRIVATE}
|
||||
${JANSSON_HDR_PUBLIC})
|
19
src/3rdparty/jansson/LICENSE
vendored
19
src/3rdparty/jansson/LICENSE
vendored
@ -1,19 +0,0 @@
|
||||
Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
496
src/3rdparty/jansson/dump.c
vendored
496
src/3rdparty/jansson/dump.c
vendored
File diff suppressed because it is too large
Load Diff
63
src/3rdparty/jansson/error.c
vendored
63
src/3rdparty/jansson/error.c
vendored
@ -1,63 +0,0 @@
|
||||
#include <string.h>
|
||||
#include "jansson_private.h"
|
||||
|
||||
void jsonp_error_init(json_error_t *error, const char *source)
|
||||
{
|
||||
if(error)
|
||||
{
|
||||
error->text[0] = '\0';
|
||||
error->line = -1;
|
||||
error->column = -1;
|
||||
error->position = 0;
|
||||
if(source)
|
||||
jsonp_error_set_source(error, source);
|
||||
else
|
||||
error->source[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void jsonp_error_set_source(json_error_t *error, const char *source)
|
||||
{
|
||||
size_t length;
|
||||
|
||||
if(!error || !source)
|
||||
return;
|
||||
|
||||
length = strlen(source);
|
||||
if(length < JSON_ERROR_SOURCE_LENGTH)
|
||||
strncpy(error->source, source, length + 1);
|
||||
else {
|
||||
size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4;
|
||||
strncpy(error->source, "...", 3);
|
||||
strncpy(error->source + 3, source + extra, length - extra + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void jsonp_error_set(json_error_t *error, int line, int column,
|
||||
size_t position, const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, msg);
|
||||
jsonp_error_vset(error, line, column, position, msg, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void jsonp_error_vset(json_error_t *error, int line, int column,
|
||||
size_t position, const char *msg, va_list ap)
|
||||
{
|
||||
if(!error)
|
||||
return;
|
||||
|
||||
if(error->text[0] != '\0') {
|
||||
/* error already set */
|
||||
return;
|
||||
}
|
||||
|
||||
error->line = line;
|
||||
error->column = column;
|
||||
error->position = (int)position;
|
||||
|
||||
vsnprintf(error->text, JSON_ERROR_TEXT_LENGTH, msg, ap);
|
||||
error->text[JSON_ERROR_TEXT_LENGTH - 1] = '\0';
|
||||
}
|
356
src/3rdparty/jansson/hashtable.c
vendored
356
src/3rdparty/jansson/hashtable.c
vendored
File diff suppressed because it is too large
Load Diff
176
src/3rdparty/jansson/hashtable.h
vendored
176
src/3rdparty/jansson/hashtable.h
vendored
@ -1,176 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*/
|
||||
|
||||
#ifndef HASHTABLE_H
|
||||
#define HASHTABLE_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "jansson.h"
|
||||
|
||||
struct hashtable_list {
|
||||
struct hashtable_list *prev;
|
||||
struct hashtable_list *next;
|
||||
};
|
||||
|
||||
/* "pair" may be a bit confusing a name, but think of it as a
|
||||
key-value pair. In this case, it just encodes some extra data,
|
||||
too */
|
||||
struct hashtable_pair {
|
||||
struct hashtable_list list;
|
||||
struct hashtable_list ordered_list;
|
||||
size_t hash;
|
||||
json_t *value;
|
||||
char key[1];
|
||||
};
|
||||
|
||||
struct hashtable_bucket {
|
||||
struct hashtable_list *first;
|
||||
struct hashtable_list *last;
|
||||
};
|
||||
|
||||
typedef struct hashtable {
|
||||
size_t size;
|
||||
struct hashtable_bucket *buckets;
|
||||
size_t order; /* hashtable has pow(2, order) buckets */
|
||||
struct hashtable_list list;
|
||||
struct hashtable_list ordered_list;
|
||||
} hashtable_t;
|
||||
|
||||
|
||||
#define hashtable_key_to_iter(key_) \
|
||||
(&(container_of(key_, struct hashtable_pair, key)->ordered_list))
|
||||
|
||||
|
||||
/**
|
||||
* hashtable_init - Initialize a hashtable object
|
||||
*
|
||||
* @hashtable: The (statically allocated) hashtable object
|
||||
*
|
||||
* Initializes a statically allocated hashtable object. The object
|
||||
* should be cleared with hashtable_close when it's no longer used.
|
||||
*
|
||||
* Returns 0 on success, -1 on error (out of memory).
|
||||
*/
|
||||
int hashtable_init(hashtable_t *hashtable);
|
||||
|
||||
/**
|
||||
* hashtable_close - Release all resources used by a hashtable object
|
||||
*
|
||||
* @hashtable: The hashtable
|
||||
*
|
||||
* Destroys a statically allocated hashtable object.
|
||||
*/
|
||||
void hashtable_close(hashtable_t *hashtable);
|
||||
|
||||
/**
|
||||
* hashtable_set - Add/modify value in hashtable
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
* @key: The key
|
||||
* @serial: For addition order of keys
|
||||
* @value: The value
|
||||
*
|
||||
* If a value with the given key already exists, its value is replaced
|
||||
* with the new value. Value is "stealed" in the sense that hashtable
|
||||
* doesn't increment its refcount but decreases the refcount when the
|
||||
* value is no longer needed.
|
||||
*
|
||||
* Returns 0 on success, -1 on failure (out of memory).
|
||||
*/
|
||||
int hashtable_set(hashtable_t *hashtable, const char *key, json_t *value);
|
||||
|
||||
/**
|
||||
* hashtable_get - Get a value associated with a key
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
* @key: The key
|
||||
*
|
||||
* Returns value if it is found, or NULL otherwise.
|
||||
*/
|
||||
void *hashtable_get(hashtable_t *hashtable, const char *key);
|
||||
|
||||
/**
|
||||
* hashtable_del - Remove a value from the hashtable
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
* @key: The key
|
||||
*
|
||||
* Returns 0 on success, or -1 if the key was not found.
|
||||
*/
|
||||
int hashtable_del(hashtable_t *hashtable, const char *key);
|
||||
|
||||
/**
|
||||
* hashtable_clear - Clear hashtable
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
*
|
||||
* Removes all items from the hashtable.
|
||||
*/
|
||||
void hashtable_clear(hashtable_t *hashtable);
|
||||
|
||||
/**
|
||||
* hashtable_iter - Iterate over hashtable
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
*
|
||||
* Returns an opaque iterator to the first element in the hashtable.
|
||||
* The iterator should be passed to hashtable_iter_* functions.
|
||||
* The hashtable items are not iterated over in any particular order.
|
||||
*
|
||||
* There's no need to free the iterator in any way. The iterator is
|
||||
* valid as long as the item that is referenced by the iterator is not
|
||||
* deleted. Other values may be added or deleted. In particular,
|
||||
* hashtable_iter_next() may be called on an iterator, and after that
|
||||
* the key/value pair pointed by the old iterator may be deleted.
|
||||
*/
|
||||
void *hashtable_iter(hashtable_t *hashtable);
|
||||
|
||||
/**
|
||||
* hashtable_iter_at - Return an iterator at a specific key
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
* @key: The key that the iterator should point to
|
||||
*
|
||||
* Like hashtable_iter() but returns an iterator pointing to a
|
||||
* specific key.
|
||||
*/
|
||||
void *hashtable_iter_at(hashtable_t *hashtable, const char *key);
|
||||
|
||||
/**
|
||||
* hashtable_iter_next - Advance an iterator
|
||||
*
|
||||
* @hashtable: The hashtable object
|
||||
* @iter: The iterator
|
||||
*
|
||||
* Returns a new iterator pointing to the next element in the
|
||||
* hashtable or NULL if the whole hastable has been iterated over.
|
||||
*/
|
||||
void *hashtable_iter_next(hashtable_t *hashtable, void *iter);
|
||||
|
||||
/**
|
||||
* hashtable_iter_key - Retrieve the key pointed by an iterator
|
||||
*
|
||||
* @iter: The iterator
|
||||
*/
|
||||
void *hashtable_iter_key(void *iter);
|
||||
|
||||
/**
|
||||
* hashtable_iter_value - Retrieve the value pointed by an iterator
|
||||
*
|
||||
* @iter: The iterator
|
||||
*/
|
||||
void *hashtable_iter_value(void *iter);
|
||||
|
||||
/**
|
||||
* hashtable_iter_set - Set the value pointed by an iterator
|
||||
*
|
||||
* @iter: The iterator
|
||||
* @value: The value to set
|
||||
*/
|
||||
void hashtable_iter_set(void *iter, json_t *value);
|
||||
|
||||
#endif
|
277
src/3rdparty/jansson/hashtable_seed.c
vendored
277
src/3rdparty/jansson/hashtable_seed.c
vendored
@ -1,277 +0,0 @@
|
||||
/* Generate sizeof(uint32_t) bytes of as random data as possible to seed
|
||||
the hash function.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SCHED_H
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
/* For GetModuleHandle(), GetProcAddress() and GetCurrentProcessId() */
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "jansson.h"
|
||||
|
||||
|
||||
static uint32_t buf_to_uint32(char *data) {
|
||||
size_t i;
|
||||
uint32_t result = 0;
|
||||
|
||||
for (i = 0; i < sizeof(uint32_t); i++)
|
||||
result = (result << 8) | (unsigned char)data[i];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* /dev/urandom */
|
||||
#if !defined(_WIN32) && defined(USE_URANDOM)
|
||||
static int seed_from_urandom(uint32_t *seed) {
|
||||
/* Use unbuffered I/O if we have open(), close() and read(). Otherwise
|
||||
fall back to fopen() */
|
||||
|
||||
char data[sizeof(uint32_t)];
|
||||
int ok;
|
||||
|
||||
#if defined(HAVE_OPEN) && defined(HAVE_CLOSE) && defined(HAVE_READ)
|
||||
int urandom;
|
||||
urandom = open("/dev/urandom", O_RDONLY);
|
||||
if (urandom == -1)
|
||||
return 1;
|
||||
|
||||
ok = read(urandom, data, sizeof(uint32_t)) == sizeof(uint32_t);
|
||||
close(urandom);
|
||||
#else
|
||||
FILE *urandom;
|
||||
|
||||
urandom = fopen("/dev/urandom", "rb");
|
||||
if (!urandom)
|
||||
return 1;
|
||||
|
||||
ok = fread(data, 1, sizeof(uint32_t), urandom) == sizeof(uint32_t);
|
||||
fclose(urandom);
|
||||
#endif
|
||||
|
||||
if (!ok)
|
||||
return 1;
|
||||
|
||||
*seed = buf_to_uint32(data);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Windows Crypto API */
|
||||
#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI)
|
||||
#include <wincrypt.h>
|
||||
|
||||
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv, LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags);
|
||||
typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer);
|
||||
typedef BOOL (WINAPI *CRYPTRELEASECONTEXT)(HCRYPTPROV hProv, DWORD dwFlags);
|
||||
|
||||
static int seed_from_windows_cryptoapi(uint32_t *seed)
|
||||
{
|
||||
HINSTANCE hAdvAPI32 = NULL;
|
||||
CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL;
|
||||
CRYPTGENRANDOM pCryptGenRandom = NULL;
|
||||
CRYPTRELEASECONTEXT pCryptReleaseContext = NULL;
|
||||
HCRYPTPROV hCryptProv = 0;
|
||||
BYTE data[sizeof(uint32_t)];
|
||||
int ok;
|
||||
|
||||
hAdvAPI32 = GetModuleHandle(TEXT("advapi32.dll"));
|
||||
if(hAdvAPI32 == NULL)
|
||||
return 1;
|
||||
|
||||
pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(hAdvAPI32, "CryptAcquireContextA");
|
||||
if (!pCryptAcquireContext)
|
||||
return 1;
|
||||
|
||||
pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32, "CryptGenRandom");
|
||||
if (!pCryptGenRandom)
|
||||
return 1;
|
||||
|
||||
pCryptReleaseContext = (CRYPTRELEASECONTEXT)GetProcAddress(hAdvAPI32, "CryptReleaseContext");
|
||||
if (!pCryptReleaseContext)
|
||||
return 1;
|
||||
|
||||
if (!pCryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
|
||||
return 1;
|
||||
|
||||
ok = pCryptGenRandom(hCryptProv, sizeof(uint32_t), data);
|
||||
pCryptReleaseContext(hCryptProv, 0);
|
||||
|
||||
if (!ok)
|
||||
return 1;
|
||||
|
||||
*seed = buf_to_uint32((char *)data);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* gettimeofday() and getpid() */
|
||||
static int seed_from_timestamp_and_pid(uint32_t *seed) {
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
/* XOR of seconds and microseconds */
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
*seed = (uint32_t)tv.tv_sec ^ (uint32_t)tv.tv_usec;
|
||||
#else
|
||||
/* Seconds only */
|
||||
*seed = (uint32_t)time(NULL);
|
||||
#endif
|
||||
|
||||
/* XOR with PID for more randomness */
|
||||
#if defined(_WIN32)
|
||||
*seed ^= (uint32_t)GetCurrentProcessId();
|
||||
#elif defined(HAVE_GETPID)
|
||||
*seed ^= (uint32_t)getpid();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint32_t generate_seed() {
|
||||
uint32_t seed;
|
||||
int done = 0;
|
||||
|
||||
#if !defined(_WIN32) && defined(USE_URANDOM)
|
||||
if (seed_from_urandom(&seed) == 0)
|
||||
done = 1;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI)
|
||||
if (seed_from_windows_cryptoapi(&seed) == 0)
|
||||
done = 1;
|
||||
#endif
|
||||
|
||||
if (!done) {
|
||||
/* Fall back to timestamp and PID if no better randomness is
|
||||
available */
|
||||
seed_from_timestamp_and_pid(&seed);
|
||||
}
|
||||
|
||||
/* Make sure the seed is never zero */
|
||||
if (seed == 0)
|
||||
seed = 1;
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
|
||||
volatile uint32_t hashtable_seed = 0;
|
||||
|
||||
#if defined(HAVE_ATOMIC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32))
|
||||
static volatile char seed_initialized = 0;
|
||||
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (__atomic_test_and_set(&seed_initialized, __ATOMIC_RELAXED) == 0) {
|
||||
/* Do the seeding ourselves */
|
||||
if (new_seed == 0)
|
||||
new_seed = generate_seed();
|
||||
|
||||
__atomic_store_n(&hashtable_seed, new_seed, __ATOMIC_RELEASE);
|
||||
} else {
|
||||
/* Wait for another thread to do the seeding */
|
||||
do {
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
sched_yield();
|
||||
#endif
|
||||
} while(__atomic_load_n(&hashtable_seed, __ATOMIC_ACQUIRE) == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif defined(HAVE_SYNC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32))
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (new_seed == 0) {
|
||||
/* Explicit synchronization fences are not supported by the
|
||||
__sync builtins, so every thread getting here has to
|
||||
generate the seed value.
|
||||
*/
|
||||
new_seed = generate_seed();
|
||||
}
|
||||
|
||||
do {
|
||||
if (__sync_bool_compare_and_swap(&hashtable_seed, 0, new_seed)) {
|
||||
/* We were the first to seed */
|
||||
break;
|
||||
} else {
|
||||
/* Wait for another thread to do the seeding */
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
} while(hashtable_seed == 0);
|
||||
}
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
static long seed_initialized = 0;
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (InterlockedIncrement(&seed_initialized) == 1) {
|
||||
/* Do the seeding ourselves */
|
||||
if (new_seed == 0)
|
||||
new_seed = generate_seed();
|
||||
|
||||
hashtable_seed = new_seed;
|
||||
} else {
|
||||
/* Wait for another thread to do the seeding */
|
||||
do {
|
||||
SwitchToThread();
|
||||
} while (hashtable_seed == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Fall back to a thread-unsafe version */
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (new_seed == 0)
|
||||
new_seed = generate_seed();
|
||||
|
||||
hashtable_seed = new_seed;
|
||||
}
|
||||
}
|
||||
#endif
|
315
src/3rdparty/jansson/jansson.h
vendored
315
src/3rdparty/jansson/jansson.h
vendored
File diff suppressed because it is too large
Load Diff
43
src/3rdparty/jansson/jansson_config.h
vendored
43
src/3rdparty/jansson/jansson_config.h
vendored
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2016 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*
|
||||
*
|
||||
* This file specifies a part of the site-specific configuration for
|
||||
* Jansson, namely those things that affect the public API in
|
||||
* jansson.h.
|
||||
*
|
||||
* The configure script copies this file to jansson_config.h and
|
||||
* replaces @var@ substitutions by values that fit your system. If you
|
||||
* cannot run the configure script, you can do the value substitution
|
||||
* by hand.
|
||||
*/
|
||||
|
||||
#ifndef JANSSON_CONFIG_H
|
||||
#define JANSSON_CONFIG_H
|
||||
|
||||
/* If your compiler supports the inline keyword in C, JSON_INLINE is
|
||||
defined to `inline', otherwise empty. In C++, the inline is always
|
||||
supported. */
|
||||
#ifdef __cplusplus
|
||||
#define JSON_INLINE inline
|
||||
#else
|
||||
#define JSON_INLINE inline
|
||||
#endif
|
||||
|
||||
/* If your compiler supports the `long long` type and the strtoll()
|
||||
library function, JSON_INTEGER_IS_LONG_LONG is defined to 1,
|
||||
otherwise to 0. */
|
||||
#define JSON_INTEGER_IS_LONG_LONG 1
|
||||
|
||||
/* If locale.h and localeconv() are available, define to 1,
|
||||
otherwise to 0. */
|
||||
#define JSON_HAVE_LOCALECONV 1
|
||||
|
||||
/* Maximum recursion depth for parsing JSON input.
|
||||
This limits the depth of e.g. array-within-array constructions. */
|
||||
#define JSON_PARSER_MAX_DEPTH 2048
|
||||
|
||||
#endif
|
109
src/3rdparty/jansson/jansson_private.h
vendored
109
src/3rdparty/jansson/jansson_private.h
vendored
@ -1,109 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*/
|
||||
|
||||
#ifndef JANSSON_PRIVATE_H
|
||||
#define JANSSON_PRIVATE_H
|
||||
|
||||
#include "jansson_private_config.h"
|
||||
#include <stddef.h>
|
||||
#include "jansson.h"
|
||||
#include "hashtable.h"
|
||||
#include "strbuffer.h"
|
||||
|
||||
#define container_of(ptr_, type_, member_) \
|
||||
((type_ *)((char *)ptr_ - offsetof(type_, member_)))
|
||||
|
||||
/* On some platforms, max() may already be defined */
|
||||
#ifndef max
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/* va_copy is a C99 feature. In C89 implementations, it's sometimes
|
||||
available as __va_copy. If not, memcpy() should do the trick. */
|
||||
#ifndef va_copy
|
||||
#ifdef __va_copy
|
||||
#define va_copy __va_copy
|
||||
#else
|
||||
#define va_copy(a, b) memcpy(&(a), &(b), sizeof(va_list))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
json_t json;
|
||||
hashtable_t hashtable;
|
||||
int visited;
|
||||
} json_object_t;
|
||||
|
||||
typedef struct {
|
||||
json_t json;
|
||||
size_t size;
|
||||
size_t entries;
|
||||
json_t **table;
|
||||
int visited;
|
||||
} json_array_t;
|
||||
|
||||
typedef struct {
|
||||
json_t json;
|
||||
char *value;
|
||||
size_t length;
|
||||
} json_string_t;
|
||||
|
||||
typedef struct {
|
||||
json_t json;
|
||||
double value;
|
||||
} json_real_t;
|
||||
|
||||
typedef struct {
|
||||
json_t json;
|
||||
json_int_t value;
|
||||
} json_integer_t;
|
||||
|
||||
#define json_to_object(json_) container_of(json_, json_object_t, json)
|
||||
#define json_to_array(json_) container_of(json_, json_array_t, json)
|
||||
#define json_to_string(json_) container_of(json_, json_string_t, json)
|
||||
#define json_to_real(json_) container_of(json_, json_real_t, json)
|
||||
#define json_to_integer(json_) container_of(json_, json_integer_t, json)
|
||||
|
||||
/* Create a string by taking ownership of an existing buffer */
|
||||
json_t *jsonp_stringn_nocheck_own(const char *value, size_t len);
|
||||
|
||||
/* Error message formatting */
|
||||
void jsonp_error_init(json_error_t *error, const char *source);
|
||||
void jsonp_error_set_source(json_error_t *error, const char *source);
|
||||
void jsonp_error_set(json_error_t *error, int line, int column,
|
||||
size_t position, const char *msg, ...);
|
||||
void jsonp_error_vset(json_error_t *error, int line, int column,
|
||||
size_t position, const char *msg, va_list ap);
|
||||
|
||||
/* Locale independent string<->double conversions */
|
||||
int jsonp_strtod(strbuffer_t *strbuffer, double *out);
|
||||
int jsonp_dtostr(char *buffer, size_t size, double value, int prec);
|
||||
|
||||
/* Wrappers for custom memory functions */
|
||||
void* jsonp_malloc(size_t size);
|
||||
void jsonp_free(void *ptr);
|
||||
char *jsonp_strndup(const char *str, size_t length);
|
||||
char *jsonp_strdup(const char *str);
|
||||
char *jsonp_strndup(const char *str, size_t len);
|
||||
|
||||
|
||||
/* Windows compatibility */
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
# if defined(_MSC_VER) /* MS compiller */
|
||||
# if (_MSC_VER < 1900) && !defined(snprintf) /* snprintf not defined yet & not introduced */
|
||||
# define snprintf _snprintf
|
||||
# endif
|
||||
# if (_MSC_VER < 1500) && !defined(vsnprintf) /* vsnprintf not defined yet & not introduced */
|
||||
# define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
||||
# endif
|
||||
# else /* Other Windows compiller, old definition */
|
||||
# define snprintf _snprintf
|
||||
# define vsnprintf _vsnprintf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
173
src/3rdparty/jansson/jansson_private_config.h
vendored
173
src/3rdparty/jansson/jansson_private_config.h
vendored
@ -1,173 +0,0 @@
|
||||
/* jansson_private_config.h. Generated from jansson_private_config.h.in by configure. */
|
||||
/* jansson_private_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if gcc's __atomic builtins are available */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_ATOMIC_BUILTINS 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the `close' function. */
|
||||
#define HAVE_CLOSE 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
/* #undef HAVE_DLFCN_H */
|
||||
|
||||
/* Define to 1 if you have the <endian.h> header file. */
|
||||
/* #undef HAVE_ENDIAN_H */
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `getpid' function. */
|
||||
#define HAVE_GETPID 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_GETTIMEOFDAY 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `localeconv' function. */
|
||||
#define HAVE_LOCALECONV 1
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if the system has the type 'long long int'. */
|
||||
#define HAVE_LONG_LONG_INT 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `open' function. */
|
||||
#define HAVE_OPEN 1
|
||||
|
||||
/* Define to 1 if you have the `read' function. */
|
||||
#define HAVE_READ 1
|
||||
|
||||
/* Define to 1 if you have the <sched.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_SCHED_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the `sched_yield' function. */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_SCHED_YIELD 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Define to 1 if gcc's __sync builtins are available */
|
||||
#define HAVE_SYNC_BUILTINS 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_SYS_PARAM_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_SYS_TIME_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if the system has the type 'unsigned long long int'. */
|
||||
#define HAVE_UNSIGNED_LONG_LONG_INT 1
|
||||
|
||||
/* Number of buckets new object hashtables contain is 2 raised to this power.
|
||||
E.g. 3 -> 2^3 = 8. */
|
||||
#define INITIAL_HASHTABLE_ORDER 3
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "jansson"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "petri@digip.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "jansson"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "jansson 2.9"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "jansson"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.9"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if /dev/urandom should be used for seeding the hash function */
|
||||
#define USE_URANDOM 1
|
||||
|
||||
/* Define to 1 if CryptGenRandom should be used for seeding the hash function
|
||||
*/
|
||||
#define USE_WINDOWS_CRYPTOAPI 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "2.9"
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
/* #undef _UINT32_T */
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
/* #undef _UINT8_T */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define to the type of a signed integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef int32_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 16 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint16_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint32_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 8 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint8_t */
|
1153
src/3rdparty/jansson/load.c
vendored
1153
src/3rdparty/jansson/load.c
vendored
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user