-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove SHOPT_REGRESS (re: 506bd2b); tweak build system
SHOPT_REGRESS is the ksh compile-time option that enables instrumented intercepts of system calls and the like. It was an experiment that was quietly added in 93t+ 2009-04-15 and then apparently forgotten about, as no change was ever made after that. By 93u+ 2012-08-01 (which we forked), enabling it was crashing the shell, which was fixed in commit 506bd2b, but it still doesn't really work consistently: in my experiments with the associated ksh-regress.rt regression tests, I noticed that the output varies based on (a) the operating system, and (b) the presence of profile scripts such as /etc/ksh.kshrc on the system. No one has time to look into this further, so this commit removes that dead weight. ____ This commit also makes related tweaks to the build system: The statically linked shell was crashing after removing regress.c, because regress.o with its intercepts was still present in libshell.a. To avoid similar in future, the code to link a static library (currently repeated in five Mamfiles) is consolidated into a new MAM include file, src/cmd/INIT/include/link_ar.mam, and extended with code to remove object files whose sources are no longer part of the code base. In addition, the 'ar' command usage is updated to conform with the POSIX standard (options start with a '-'), and the obsolete `ranlib` invocation is removed. In mamake, the 'incl' command (added in 2757793) no longer saves/clears and restores the automatic variables, as we need them to work normally for link_ar.mam. They are now once again saved and restored only when the 'bind' command includes a file.
- Loading branch information
Showing
22 changed files
with
90 additions
and
23,144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
note * Shell action for linking an archive (static library) from previously | ||
note * compiled object files, based on the current MAM automatic variables. | ||
note * | ||
note * - %{@} - name of archive (like libfoo.a) | ||
note * - %{^} - all the *.o files | ||
note * - %{?} - the *.o files that changed in this run | ||
note * | ||
note * This code avoids rebuilding the archive from scratch on each run, | ||
note * updating only the object files that have changed. | ||
|
||
exec - if test -f %{@} | ||
exec - then ar -r -c %{@} %{?} # add changed *.o | ||
exec - else ar -r -c %{@} %{^} # add all *.o | ||
exec - fi || exit | ||
|
||
note * Sometimes, obsolete object files can interfere due to intercepts, so | ||
note * delete any old object files that we no longer build from the archive | ||
|
||
exec - to_delete= | ||
exec - for o in $(ar -t %{@}) | ||
exec - do case $o in | ||
exec - *.o) case ' %{^} ' in | ||
exec - *" $o "*) | ||
exec - ;; | ||
exec - *) to_delete="${to_delete-} $o" | ||
exec - ;; | ||
exec - esac | ||
exec - ;; | ||
exec - esac | ||
exec - done | ||
exec - case ${to_delete:+y} in | ||
exec - y) ar -d %{@} $to_delete | ||
exec - ;; | ||
exec - esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.