I used to following to prefix the ASM file with the options we want: sed -i -e '1i\OPTION FRAMEPRESERVEFLAGS:ON\nOPTION PROLOGUE:NONE\nOPTION EPILOGUE:NONE' Asm/x86/LzFindOpt.asm
When the Asm file is compiled it then produces a file exactly the same as the ASMC output.
Edit: in fact seeing as setting those options for all of the ASM files does not seem to produce any negative effects perhaps it is worthwhile testing if asmc can handle/ignore those options too?
Last edit: Obi-w00t 2021-07-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It might depend on perspective - UASM implemented smart stack alignment and it is enabled by default. I think that is reasonable but in this case we don't want it, perhaps it trips up as we aren't creating an ASM program but rather using a snippet?
I couldn't find a way to disable those options on the command line so for now we have to prepend all the ASM files with those options. Either way ASMC has taken their Linux releases offline so it looks like we can't rely on ASMC and we have to ensure UASM behaves correctly for 7-Zip.
it may all be for nought - Debian has chosen not to use the ASM code at all to ensure portability and that may well be the easiest way to package for Linux.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you briefly explain how you can compile asmc in Linux?
For UASM it is interesting to watch: https://github.com/Navegos/UASM/tree/dev-krad
If it is synchronized with UASM it could be a viable solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For my part, it will not be correct to post instructions for building ASMC for Linux, since I am not an ASMC developer, but I will post a text document in which I described the sequence of my actions to create ASMC for Linux, perhaps you will find a better solution.
Asmc Macro Assembler Version 2.32.55
Copyright (C) The Asmc Contributors. All Rights Reserved.
Portions Copyright (C) 1984-2002 Sybase, Inc. All Rights Reserved.
The only problem is how to build asmc for Linux, it is not very in line with the Linux path.
However, it can be used to compile the beta version for 7-Zip.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't know any similar options for MASM files, so the only way to fix it for x86/amd64 is to add '-Wl,-z,noexecstack' option to link rule in makefile.
Actually use of -Wl,-z,noexecstack is a king of hack. The proper fix is to mark stack as "noexecutable" inside asm files. It can be done for 7-zip arm64 asm files, as they are using GAS syntax, but I not sure that any similar option exists for MASM files.
This is a security problem that can be easily fixed.
Last edit: Karlson2k 2021-07-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
These lines confuse package maintainers. It's unclear whether they indicate some error condition or just normal (I assume that they are just kind of debugging for compile-time).
I would suggest to either completely disable pragma messages without defined _DEBUG macro or make them more readable like Compiling SSE41 version of LzFind().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's not missing.
7-Zip 21.03 just doesn't report that information about aes.
Most processors have aes. So there is no need to report about it in each run.
run
7zb"-mm=*"-mmt1-md20-mtic=30
and look speed numbers for aes lines.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FWIW, I converted the code for LzFindOpt.asm to NASM format. I incorporate it into my lrzip-next lzma-21.03beta branch. Attaching the nasm-converted source in case anyone finds it useful. It's x64 bit only.
when do you decide to publish the current 7z version not only as an exe-file but also as an msi-file? version 21.03 beta has an msi-file (i found it somewhere on the page) but later versions did not have an msi-file like 21.01 alpha.
msi on windows 10 x64 all updates works a bit better than exe. i mean the installation is cleaner (no pseudo empty phantom lines in settings => programs but sadly the icon is missing)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Reported here.
I'd appreciate if you also consider talking to the uasm developer directly in case they reply in the GitHub issue.
Thanks.
Last edit: post-factum 2021-07-21
UASM developers have said there is an option to disable stack alignment, based on this bug report: https://github.com/Terraspace/UASM/issues/118
I also checked the documentation here: http://www.terraspace.co.uk/uasm251_ext.pdf
I used to following to prefix the ASM file with the options we want:
sed -i -e '1i\OPTION FRAMEPRESERVEFLAGS:ON\nOPTION PROLOGUE:NONE\nOPTION EPILOGUE:NONE' Asm/x86/LzFindOpt.asm
When the Asm file is compiled it then produces a file exactly the same as the ASMC output.
Edit: in fact seeing as setting those options for all of the ASM files does not seem to produce any negative effects perhaps it is worthwhile testing if asmc can handle/ignore those options too?
Last edit: Obi-w00t 2021-07-21
Yeah, thanks, I've updated my build with this, and it doesn't segfault any more.
I wonder if this is an uasm issue really.
It might depend on perspective - UASM implemented smart stack alignment and it is enabled by default. I think that is reasonable but in this case we don't want it, perhaps it trips up as we aren't creating an ASM program but rather using a snippet?
I couldn't find a way to disable those options on the command line so for now we have to prepend all the ASM files with those options. Either way ASMC has taken their Linux releases offline so it looks like we can't rely on ASMC and we have to ensure UASM behaves correctly for 7-Zip.
it may all be for nought - Debian has chosen not to use the ASM code at all to ensure portability and that may well be the easiest way to package for Linux.
But development for Linux continues: https://github.com/nidud/asmc/commits/master/source/asmc/linux and anyone can compile an asmc instance for themselves.
Last edit: Paul 2021-07-25
Could you briefly explain how you can compile asmc in Linux?
For UASM it is interesting to watch:
https://github.com/Navegos/UASM/tree/dev-krad
If it is synchronized with UASM it could be a viable solution.
For my part, it will not be correct to post instructions for building ASMC for Linux, since I am not an ASMC developer, but I will post a text document in which I described the sequence of my actions to create ASMC for Linux, perhaps you will find a better solution.
Last edit: Paul 2021-07-25
Indeed, ASMC Linux versions have started to appear again!
https://github.com/nidud/asmc/tree/master/source/asmc/linux/bin
The only problem is how to build asmc for Linux, it is not very in line with the Linux path.
However, it can be used to compile the beta version for 7-Zip.
Hi Igor.
Gentoo built-in QA check detected that all binaries with x86/amd64 assembler code has "stack executable" flags.
I've checked assembler-generated .o files.
There is no ' .note.GNU-stack' section, so stack is marked as read/write/executable, which is security problem.
To fix it for arm64, you need to add to the end of *.S files the following lines:
I don't know any similar options for MASM files, so the only way to fix it for x86/amd64 is to add '-Wl,-z,noexecstack' option to link rule in makefile.
For more info see https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
It is not 21.03-specific. The same is for 21.02.
Last edit: Karlson2k 2021-07-24
What's happen on Gentoo if the package is compiled without
-noexestack
:Actually use of
-Wl,-z,noexecstack
is a king of hack. The proper fix is to mark stack as "noexecutable" inside asm files. It can be done for 7-zip arm64 asm files, as they are using GAS syntax, but I not sure that any similar option exists for MASM files.This is a security problem that can be easily fixed.
Last edit: Karlson2k 2021-07-26
7-Zip (z) 21.03 beta (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-07-20
64-bit locale=en_US.UTF-8 Threads:4, ASM
Last edit: teoberi 2021-07-29
Is it problem?
I can disable these lines in source code.
What exact drawbacks of these pragma messages?
These lines confuse package maintainers. It's unclear whether they indicate some error condition or just normal (I assume that they are just kind of debugging for compile-time).
I would suggest to either completely disable pragma messages without defined
_DEBUG
macro or make them more readable likeCompiling SSE41 version of LzFind()
.My problem is that in 7-Zip (z) 21.02 alpha (x64) I had:
In the 7-Zip (z) version 21.03 beta (x64) AES is missing.
It's not missing.
7-Zip 21.03 just doesn't report that information about aes.
Most processors have aes. So there is no need to report about it in each run.
run
and look speed numbers for aes lines.
OK.
what's for the switch
-mtic=30
?-mtic=30
sets a limit for about2^30
cpu cycles for each benchmark workload. So you can get fast benchmarking with-md=20
There are also another undocumented switches for benchmark:
to test only
26
dictionary:to benchmark for the data from real file
file_name
:Last edit: Igor Pavlov 2021-07-31
Thanks!
Can you add "Open Inside" "Open Inside*" "Open Inside#" to support commands l(List) e(Extract) x(eXtract) ?
Thank you.
FWIW, I converted the code for LzFindOpt.asm to NASM format. I incorporate it into my lrzip-next lzma-21.03beta branch. Attaching the nasm-converted source in case anyone finds it useful. It's x64 bit only.
Dear Mr. Pavlov,
when do you decide to publish the current 7z version not only as an exe-file but also as an msi-file? version 21.03 beta has an msi-file (i found it somewhere on the page) but later versions did not have an msi-file like 21.01 alpha.
msi on windows 10 x64 all updates works a bit better than exe. i mean the installation is cleaner (no pseudo empty phantom lines in settings => programs but sadly the icon is missing)
you have all possible installers here:
https://www.7-zip.org/download.html
also msi for latest beta