RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 841741 - ksh build change request: shared libshell, not static; plus how-to spec attached
Summary: ksh build change request: shared libshell, not static; plus how-to spec attached
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ksh
Version: 6.6
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-20 06:13 UTC by Kenneth Salerno
Modified: 2014-12-10 14:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-10 14:50:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
SPEC file (2.32 KB, application/octet-stream)
2012-07-20 06:13 UTC, Kenneth Salerno
no flags Details
ast-ksh PATCH file (5.25 KB, patch)
2012-07-20 06:15 UTC, Kenneth Salerno
no flags Details | Diff
SPEC file (2.77 KB, text/plain)
2012-07-20 18:51 UTC, Kenneth Salerno
no flags Details

Description Kenneth Salerno 2012-07-20 06:13:26 UTC
Created attachment 599310 [details]
SPEC file

Description of problem:

I am requesting that the "ksh" package maintainer for Fedora considers building using shared libshell/libast libraries to reduce redundant code in memory when we have multiple copies of ksh running.

Currently, the ast-ksh package is compiled using the default static configuration of rolling libshell.a into a very large ksh binary:

   ls -lh:
       -rwxr-xr-x 1 root root 1.6M Apr 14 11:47 /bin/ksh
   ldd:
        linux-vdso64.so.1 =>  (0x00000fff8a6a0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000fff8a660000)
        libm.so.6 => /lib64/libm.so.6 (0x00000fff8a560000)
        libc.so.6 => /lib64/libc.so.6 (0x00000fff8a370000)
        /lib64/ld64.so.1 (0x000000005a2a0000)

That's your big boy: 1.6 MegaBytes for a shell that is not bash.

Linking pmain.o to libshell.so and libast (plus libcmd, libcoshell, and libdll) however produces a very small ksh binary and we can allow the dynamic linker to share one copy of the ast libraries in memory:

   ls -lh:
      -rwxr-xr-x 1 root root 5.3K Jul 20 12:07 /bin/ksh
      -rwxr-xr-x 1 root root 1.2M Jul 20 12:07 /usr/lib64/libast-ast.so
      -rwxr-xr-x 1 root root 300K Jul 20 12:07 /usr/lib64/libast-cmd.so
      -rwxr-xr-x 1 root root  42K Jul 20 12:07 /usr/lib64/libast-coshell.so
      -rwxr-xr-x 1 root root  24K Jul 20 12:07 /usr/lib64/libast-dll.so
      -rwxr-xr-x 1 root root 866K Jul 20 12:07 /usr/lib64/libast-shell.so
   ldd:
        linux-vdso64.so.1 =>  (0x00000fff8da40000)
        libm.so.6 => /lib64/libm.so.6 (0x00000fff8d930000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000fff8d900000)
        libast-shell.so => /usr/lib64/libast-shell.so (0x00000fff8d820000)
        libast-ast.so => /usr/lib64/libast-ast.so (0x00000fff8d6e0000)
        libc.so.6 => /lib64/libc.so.6 (0x00000fff8d4f0000)
        /lib64/ld64.so.1 (0x000000004e7d0000)
        libast-dll.so => /usr/lib64/libast-dll.so (0x00000fff8d4d0000)
        libast-coshell.so => /usr/lib64/libast-coshell.so (0x00000fff8d4b0000)
        libast-cmd.so => /usr/lib64/libast-cmd.so (0x00000fff8d450000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00000fff8d410000) 

5.3 kiloBytes, that's more like it.


Version-Release number of selected component (if applicable):

20120229-2


Additional info:

Please refer to the rpm spec file attached for one of the ways (please pardon my personal spec file, it obviously is not up to the level of professional spec files for the Fedora project) to go about building ksh with shared ast libraries. The linking steps were taken directly from the makefile in the ast-ksh source tree.

There is also a small patch attached as well, used by the spec file, for what appears to be an accidental omission of the -fPIC flag on three source file compilation rules in the file ksh93/Mamfile that would otherwise prevent you from creating the shared object file libshell.so successfully as it would complain these three object files cannot have relocatable code.

Another note: only Debian seems to build the AT&T ksh in this manner of shared objects for libast these days, both Fedora and OpenSUSE build ksh using the default Mamfiles resulting in the huge ksh binary. Also wish AT&T research team would switch to using autoconf/automake/make rather than their build system...

Comment 1 Kenneth Salerno 2012-07-20 06:15:11 UTC
Created attachment 599311 [details]
ast-ksh PATCH file

This patch is to be used by the previously attached spec file

Comment 2 Kenneth Salerno 2012-07-20 18:51:38 UTC
Created attachment 599438 [details]
SPEC file

Comment 3 Fedora End Of Life 2013-07-04 00:59:15 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2013-12-21 08:39:52 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Michal Hlavinka 2014-12-10 14:50:35 UTC
We've considered this change and decided not to change the packaging of ksh for now. It would mean to keep non-upstreamable patches and differ from upstream, which we do not wan to do right now. Also we do not wan to do this change in released product. We may reconsider this in the future, but for now I'm going to close this request.


Note You need to log in before you can comment on or make changes to this bug.