-
selsta
tevador: can’t get the asm code to compile for iOS
-
selsta
always syntax issues
-
selsta
-
selsta
though I might be doing something wrong
-
tevador
selsta: it looks like you are compiling for ARMv7, but your cmake is configured for x86_64
-
selsta
-
selsta
can’t figure it out, I will just set the ifdef to macOS only
-
tevador
try to add -DCMAKE_SYSTEM_PROCESSOR=aarch64
-
selsta
-
tevador
yeah, __clear_cache doesn't work on Apple, you should add something like #ifndef APPLE
-
selsta
it compiled now at least
-
tevador
although if Macbooks also start using ARM, they will need some function to flush the cache or JIT won't work
-
selsta
problem is I can’t install it on my phone without xcode
-
selsta
and xcode has issues with the asm syntax again
-
selsta
lol I give up
-
selsta
best chance to test the arm stuff is once someone has an arm mac
-
hyc
why can't you just compile the asm code separately and then link the .o files into the xcode build?
-
tevador
I bet xcode will fail to link it
-
tevador
because it won't have Apple (c) (tm) in the header or something
-
hyc
there's gotta be a binutil that can construct the necessary header, sheesh
-
hyc
still would be interesting to see why xcode fails in the first place. is it trying to build fat binaries, and assemble to some other platform than the asm file was meant for?
-
selsta
I’m sure it is possible, there are monero ios wallets
-
hyc
though frankly, I don't think it's much loss if we drop support for Apple
-
selsta
-
hyc
even M$ is more open-source friendly these days
-
selsta
same error inside xcode
-
hyc
no....
-
hyc
I meant, copy the .o files from the asm code built by gcc into the xcode build tree so that it doesn't try to compile/assemble them again
-
hyc
the other possibility is that xcode clang needs a different suffix than ".S" to recognize a file as asm source
-
hyc
or the actual invocation of clang is forcing it to treat that source file as C instead of asm
-
hyc
where did RandomX.xcodeproj come from?
-
hyc
cmake generated it itself?
-
selsta
yes, cmake can generate xcode projects
-
hyc
well, I would invoke that last failed command manually
-
hyc
and drop most of the C-related flags
-
hyc
in particular, "-x c"
-
selsta
hyc: yep, removing -x c seems to work
-
selsta
-
selsta
this talks about explicitly setting the file type, maybe this has to be set to ASM
-
hyc
yes, but as I recall that broke something else
-
hyc
teavdor would know more about it
-
hyc
tevador
-
selsta
ok, nice
-
selsta
I can explicitly set it to assembly inside xcode
-
selsta
now I should be able to run it on my phone
-
hyc
see the git history for CMakeLists.txt and the comment "cheat because cmake and ccache hate each other"
-
hyc
note that there's already a special case for the asm on MSVC, you can probably do something similar for xcode
-
selsta
will look into this later
-
selsta
I also had to manually remove -latomic form the linker flags
-
selsta
for it to compile
-
selsta
> Performance: 1323.39 ms per hash
-
selsta
lol
-
selsta
anything I should test? seems like I can’t use --jit else it will crash
-
selsta
and for --mine mode I don’t have enough RAM
-
hyc
this is on your phone?
-
selsta
yes
-
hyc
I thought we set the proper mmap flags to let it use JIT
-
selsta
afaik JIT is not allowed on iOS
-
hyc
at all? what are they doing with webasm?
-
tevador
iOS forbids JIT by design
-
selsta
unless your phone is jailbroken
-
selsta
you need private entitlements to run JIT and only Apple can use those
-
tevador
selsta: have you figured out how to detect iOS?
-
hyc
sounds like ios is all more trouble than it's worth
-
tevador
we could disable JIT there
-
hyc
what's going to happen when the ARM macbooks are out, and they tell you you can run all your apple software on phone or laptop directly
-
selsta
when only using `--verify`, adding MAP_JIT to mmap does not make a difference
-
selsta
when using with --jit, adding MAP_JIT results in cache allocation failed, without MAP_JIT is crashes with bad access
-
tevador
is this macos or ios?
-
selsta
iOS
-
hyc
what does it do on macos?
-
selsta
adding MAP_JIT?
-
hyc
yes
-
selsta
it allows you to enable hardened runtime with the `com.apple.security.cs.allow-jit` entitlement
-
selsta
without it you have to use `com.apple.security.cs.disable-executable-page-protection` entitlement which is "less secure"
-
tevador
W^X is useless anyways unless you also have some protection against ROP
-
tevador
i.e. injected return addresses on the stack
-
hyc
don't they also do ASLR?
-
hyc
difficult to do anything useful with ROP unless you can find a useful call in the running binary itself
-
selsta
-
sech1
not having __clear_cache() on iOS is probably why it'll crash with JIT anyway
-
selsta
ah right I disabled that
-
tevador
well, there must be a way to clear the cache because safari uses JIT
-
sech1
-
sech1
but I'm not sure if it works on iOS at all
-
hyc
pointless to pursue it
-
hyc
iOS processes only have 2GB address space, so can never be effective miners
-
selsta
Thread 1: EXC_BAD_ACCESS (code=2, address=0x10607c000)
-
hyc
largest mmap'able region is less than 1GB
-
selsta
that is with sys_icache_invalidate
-
selsta
but yea agree kinda pointless, we will have to wait for arm macs
-
hyc
iOS address space is a recurring problem for LMDB users
-
hyc
funny that the latest iphones still only have 4GB RAM
-
selsta
my phone is 4 or 5 years old lol
-
selsta
don’t even know if it has more than 1 gb ram
-
selsta
ok it has 2gb ram
-
hyc
iPad pro 11 has 6GB woohoo
-
hyc
anybody doing ipad benchmarks?
-
selsta
well at least I was able to run randomx-benchmark on my phone :D just super slow
-
hyc
only in light mode hh
-
selsta
I wonder how iOS wallets do randomx verification
-
selsta
they certainly are faster than 1 hash/s
-
hyc
wallets don't do verification
-
hyc
?
-
selsta
ah right :D
-
selsta
not sure why I thought that they do block verification
-
sech1
wow, nanopool is #1 now
-
selsta
more cloudnets?
-
sech1
-
sech1
new one
-
sech1
the other two are still there
-
selsta
I wonder who is paying for all this
-
selsta
if it’s someone abusing free credits then they would have fixed it by now
-
gethh
0.325GH total, 20% of the network