Skip to content

Commit

Permalink
Solaris: disable deprecated SHOPT_PFSH by default
Browse files Browse the repository at this point in the history
Solaris /bin/ksh disables the SHOPT_PFSH compile option ("solaris
exec_attr(4) profile execution") with a patch. Since this option
applies to Solaris and variants only, let's upstream that change.

(Solaris now provides pfksh93 as a wrapper around ksh93, and does
the same for other shells, so profiling functionality is no longer
ksh-specific.)

If you want to re-enable it, add -DSHOPT_PFSH to your $CCFLAGS.

Original patch:
https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/150-CR7168611.patch

src/cmd/ksh93/Makefile:
- Add note that edits in Makefile are ineffective as we do not ship
  nmake.
- Disable SHOPT_PFSH, cosmetically.

src/cmd/ksh93/Mamfile:
- Remove -DSHOPT_PFSH from all compiler commands.
  • Loading branch information
McDutchie committed Jan 18, 2021
1 parent 4cfe49a commit f089d79
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 61 deletions.
6 changes: 5 additions & 1 deletion src/cmd/ksh93/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/*
* ksh makefile
*
* NOTE: since ksh 93u+m does not use/include nmake for various reasons,
* any changes here are ineffective and this is for reference only. Edit
* Mamfile instead (though it might still be good to update this too).
*/

SH := $(PWD:B:/[0-9]*$//:N=ksh*:-ksh) /* name of the shell program */
Expand Down Expand Up @@ -37,7 +41,7 @@ SHOPT_MULTIBYTE == 1 /* multibyte character handling */
SHOPT_NAMESPACE == 1 /* allow namespaces */
SHOPT_OLDTERMIO == /* support both TCGETA and TCGETS */
SHOPT_OPTIMIZE == 1 /* optimize loop invariants */
SHOPT_PFSH == 1 /* solaris exec_attr(4) profile execution */
SHOPT_PFSH == 0 /* solaris exec_attr(4) profile execution */
SHOPT_P_SUID == /* real uid's that require -p for set[ug]id */
SHOPT_RAWONLY == 1 /* make viraw the only vi mode */
SHOPT_REGRESS == /* enable __regress__ builtin and instrumented intercepts for testing */
Expand Down
Loading

0 comments on commit f089d79

Please sign in to comment.