fcorbelli / zpaqfranz

Deduplicating archiver with encryption and paranoid-level tests. Swiss army knife for the serious backup and disaster recovery manager. Ransomware neutralizer. Win/Linux/Unix
MIT License
260 stars 22 forks source link

fix build with -DNOJIT #22

Closed omar-polo closed 2 years ago

omar-polo commented 2 years ago

mmap(2) is called also in places not guarded by -DNOJIT. I'm not familiar with the codebase, but this allows to build it with -DNOJIT and from some brief testing it seems to be still working :)

fcorbelli commented 2 years ago

The -DNOJIT is here for backward compatibility (aka: history) mmap is used (on every platform) to memory-map calc file hashes, wyhash in particular (https://github.com/wangyi-fudan/wyhash) and for testing purpose (how slow/fast are memory mapped multithread reads?)
by the -mm switch, for instance.

Short version: ignore NOJIT, do NOT define it
There are 3 "switches" (aka: define) for compiling

-Dunix (compile NOT on Windows, but on "something like *nix")
-DSOLARIS (on Solaris and "cousins")
-DHWBLAKE3 (use HW-accelerated Blake 3 assembly code (only Win64))

omar-polo commented 2 years ago

thanks for the explanation! I was looking into -DNOJIT since the jit seems to support only amd64 and i386, so what about other arches? There's a pending port for OpenBSD and I'd like to know whether it has to be only for amd64 or if it's ok to build on other arches with -DNOJIT. (on amd64 it seems to work with -DNOJIT, but my testing was limited.)

Thanks!

fcorbelli commented 2 years ago

I really do not know
I do not have anything different from "standard" Intel-AMD
Old SPARCs, but I haven't turned them on for years

omar-polo commented 2 years ago

Same here :D

well, if you (and the person who did the port) don't mind, i guess that we can build it on all the supported arches (which are quite a few by the way). All the jit code seems to be hidden under #ifndef NOJIT, and at least on amd64 it works with it defined.

Ciao! ;)

dertuxmalwieder commented 2 years ago

the person who did the port

That would be me. :-) (I saw your patch for my patch, I'll take care of it in a few hours. Thank you.)

dertuxmalwieder commented 2 years ago

It looks like this has disappeared from the latest sources...?

fcorbelli commented 2 years ago

55_6g.zip A preview of the next release :)

dertuxmalwieder commented 2 years ago

And it's gone again ;-)

fcorbelli commented 2 years ago

Can you please explain better? I really do not use NOJIT

dertuxmalwieder commented 2 years ago

It looks like the PR which was merged 15 days ago is gone from your current sources again..

fcorbelli commented 2 years ago

I like github, just as I like Microsoft
Send me, please, I will "hardcode" merge

fcorbelli commented 2 years ago

I am little bit confused https://github.com/fcorbelli/zpaqfranz/pull/22/commits/c55f424a29024bab6c145586ff9691a9e40849c3 I'll work for an "hard-merge"

fcorbelli commented 2 years ago

OK, I think/hope that 55.7 takes the "hardcoded" commit

dertuxmalwieder commented 2 years ago

Looks like it worked this time ... :)