Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4ae6a3

Browse files
committed
Re-install aix files (what happened?)
1 parent 3bedce0 commit b4ae6a3

3 files changed

Lines changed: 568 additions & 0 deletions

File tree

Modules/ld_so_aix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/sh
2+
#
3+
# ========================================================================
4+
# FILE: ld_so_aix
5+
# TYPE: executable, uses makexp_aix
6+
# SYSTEM: AIX
7+
#
8+
# DESCRIPTION: Creates a shareable .o from a pre-compiled (unshared)
9+
# .o file
10+
#
11+
# ARGUMENTS: Same as for "ld". The -bM, -bE, -bI, -H, -T, and -lc
12+
# arguments of "ld" will be supplied by this script.
13+
#
14+
# NOTES: 1. Currently specific to the building of Python
15+
# interpreter shared objects, in that the entry
16+
# point name is hardcoded based on the object file
17+
# name (the "mathmodule.o" file will expect an
18+
# entry point of "initmath"). This could be remedied
19+
# by the support (or simple expectation) of a "-e"
20+
# argument.
21+
# 2. The resulting shared object file is left in the
22+
# current directory with the extension .so
23+
# 3. Uncommenting the "echo" lines gives detailed output
24+
# about the commands executed in the script.
25+
#
26+
# HISTORY: Jul-1-1996 -- Make sure to use /usr/ccs/bin/ld --
27+
# -- Use makexp_aix for the export list. --
28+
# Vladimir Marangozov ([email protected])
29+
#
30+
# Manus Hand ([email protected]) -- Initial code -- 6/24/96
31+
# ========================================================================
32+
#
33+
34+
# Variables
35+
objfile=$1
36+
shift
37+
filename=`echo $objfile | sed -e "s:.*/\([^/]*\)$:\1:" -e "s/\..*$//"`
38+
entry=init`echo $filename | sed "s/module.*//"`
39+
ldopts="-e$entry -bE:$filename.exp -bI:python.exp -bM:SRE -T512 -H512 -lc"
40+
ldargs="$objfile $*"
41+
42+
# Export list generation
43+
makexp_aix $filename.exp "$objfile" $objfile
44+
45+
# Perform the link.
46+
#echo "ld $ldopts $ldargs"
47+
/usr/ccs/bin/ld $ldopts $ldargs
48+
49+
# Delete the module's export list file.
50+
# Comment this line if you need it.
51+
rm -f $filename.exp
52+
53+
# Remove the exec rights on the shared module.
54+
#echo chmod -x `echo $objfile | sed "s/\.o$/.so/"`
55+
chmod -x `echo $objfile | sed "s/\.o$/.so/"`
56+
57+
58+

Modules/makexp_aix

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/sh
2+
#
3+
# ===========================================================================
4+
# FILE: makexp_aix
5+
# TYPE: standalone executable
6+
# SYSTEM: AIX 3.2.5 and AIX 4
7+
#
8+
# DESCRIPTION: This script creates an export list of ALL global symbols
9+
# from a list of object or archive files.
10+
#
11+
# USAGE: makexp_aix <OutputFile> "<FirstLine>" <InputFile> ...
12+
#
13+
# where:
14+
# <OutputFile> is the target export list filename.
15+
# <FirstLine> is the path/file string to be appended
16+
# after the "#!" symbols in the first line of the
17+
# export file. Passing "" means deferred resolution.
18+
# <InputFile> is an object (.o) or an archive file (.a).
19+
#
20+
# HISTORY:
21+
# 1-Jul-1996 -- added header information
22+
# Vladimir Marangozov
23+
#
24+
# 28-Jun-1996 -- initial code
25+
# Vladimir Marangozov ([email protected])
26+
# ==========================================================================
27+
28+
# Variables
29+
expFileName=$1
30+
toAppendStr=$2
31+
shift; shift;
32+
inputFiles=$*
33+
automsg="Generated automatically by makexp_aix"
34+
notemsg="NOTE: lists _all_ global symbols defined in the above file(s)."
35+
curwdir=`pwd`
36+
37+
# Create the export file and setup the header info
38+
echo "#!"$toAppendStr > $expFileName
39+
echo "*" >> $expFileName
40+
echo "* $automsg (`date -u`)" >> $expFileName
41+
echo "*" >> $expFileName
42+
echo "* Base Directory: $curwdir" >> $expFileName
43+
echo "* Input File(s) : $inputFiles" >> $expFileName
44+
echo "*" >> $expFileName
45+
echo "* $notemsg" >> $expFileName
46+
echo "*" >> $expFileName
47+
48+
# Extract the symbol list using 'nm' which produces quite
49+
# different output under AIX 4 than under AIX 3.2.5.
50+
# The following handles both versions by using a common flagset.
51+
# Here are some hidden tricks:
52+
# 1. Use /usr/ccs/bin/nm. Relevant to AIX 3.2.5 which has
53+
# another version under /usr/ucb/bin/nm.
54+
# 2. Use the -B flag to have a standard BSD representation
55+
# of the symbol list on both AIX 3.2.5 and AIX 4. The "-B"
56+
# flag is missing in the AIX 3.2.5 online usage help of 'nm'.
57+
# 3. Use the -x flag to have a hex representation of the symbol
58+
# values. This fills the leading whitespaces on AIX 4,
59+
# thus simplifying the sed statement.
60+
# 4. Eliminate all entries except those with either "B", "D"
61+
# or "T" key letters. We are interested only in the global
62+
# (extern) BSS, DATA and TEXT symbols. With the same statement
63+
# we eliminate object member lines relevant to AIX 4.
64+
# 5. Eliminate entries containing a dot. We can have a dot only
65+
# as a symbol prefix, but such symbols are undefined externs.
66+
# 6. Eliminate everything including the key letter, so that we're
67+
# left with just the symbol name.
68+
#
69+
/usr/ccs/bin/nm -Bex $inputFiles \
70+
| sed -e '/ [^BDT] /d' -e '/\./d' -e 's/.* [BDT] //' \
71+
| sort | uniq >> $expFileName

0 commit comments

Comments
 (0)