mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7757931e8e | ||
|
|
5a55034e93 | ||
|
|
bab18ab6d2 | ||
|
|
4c601b8522 | ||
|
|
36e827b0be | ||
|
|
e137468dc6 | ||
|
|
aa92238b98 | ||
|
|
093a537205 | ||
|
|
fe1653eae0 | ||
|
|
58f029f2d1 | ||
|
|
f16036819a | ||
|
|
784d21f5fd | ||
|
|
c101a18be3 | ||
|
|
f038e86294 | ||
|
|
ef47ac3d22 | ||
|
|
95617646ba | ||
|
|
652ff412d2 | ||
|
|
8ca77a27fa | ||
|
|
3b8eeb54d3 | ||
|
|
6e23108f39 | ||
|
|
052fd53f21 | ||
|
|
164ba0d204 | ||
|
|
8853b1acb3 | ||
|
|
d2bc3285b1 | ||
|
|
019cca88ce | ||
|
|
b2ac405dbb | ||
|
|
24ef405181 | ||
|
|
e2aecacc87 | ||
|
|
d6038fc397 | ||
|
|
0d7b33cbc9 | ||
|
|
f40fc6829d | ||
|
|
eb12be05d9 | ||
|
|
f68a0cd137 | ||
|
|
815ec755b4 | ||
|
|
f751095363 | ||
|
|
30f3260cc1 | ||
|
|
50a2d76b29 | ||
|
|
006d9f248d | ||
|
|
f16e13ead3 | ||
|
|
904b7563aa | ||
|
|
05378ccef9 | ||
|
|
911929eed1 | ||
|
|
ae557e488d | ||
|
|
d88e223dd4 | ||
|
|
1867fd1486 | ||
|
|
1f42b9026c | ||
|
|
4b649e0805 | ||
|
|
2ce8ebda5f | ||
|
|
3b7c1f8741 | ||
|
|
faa1dd5646 | ||
|
|
21b9ee9deb | ||
|
|
db99cebd57 | ||
|
|
a8c3708337 | ||
|
|
b40cb0cc14 | ||
|
|
5640b0a889 | ||
|
|
693cbe7207 | ||
|
|
93d6cc3bf9 | ||
|
|
0474947f86 | ||
|
|
0013378bfa | ||
|
|
0e5aff05c4 | ||
|
|
38a79cb7b8 | ||
|
|
fc767570a8 |
No files matched your search
@@ -6,7 +6,6 @@ configure.in crlf=input
|
||||
*.h crlf
|
||||
*.cs crlf
|
||||
*.sh crlf
|
||||
*.il crlf
|
||||
|
||||
.gitattributes crlf
|
||||
ChangeLog crlf
|
||||
@@ -17,7 +16,6 @@ ChangeLog crlf
|
||||
*.bat -crlf
|
||||
*.sln -crlf
|
||||
*.*proj* -crlf
|
||||
*.xml -crlf
|
||||
|
||||
# CRLF Handling
|
||||
# -------------
|
||||
|
||||
@@ -35,4 +35,3 @@
|
||||
/ltsugar.m4
|
||||
/lt~obsolete.m4
|
||||
/ltversion.m4
|
||||
*~
|
||||
+3093
File diff suppressed because it is too large.
Load diff
+1
-7
@@ -11,13 +11,7 @@ The Boehm licensing information is in the libgc directory
|
||||
The SGen Garbage Collector is under the terms of the MIT X11
|
||||
license
|
||||
|
||||
The class libraries under mono/mcs are unless otherwise stated
|
||||
under the MIT X11 license.
|
||||
|
||||
Open source Microsoft code is licensed under the original terms
|
||||
which is either MS-PL for older components, or dual licensed
|
||||
MS-PL/Apache2 licensed.
|
||||
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
||||
@@ -98,13 +98,6 @@ For comments, corrections and updates, please contact [email protected]
|
||||
ICSharpCode.SharpZipLib, GPL with exceptions.
|
||||
See: mcs/class/ICSharpCode.SharpZipLib/README
|
||||
|
||||
** mcs/class/System.Core/System/TimeZoneInfo.Android.cs
|
||||
|
||||
This is a port of Apache 2.0-licensed Android code, and thus is
|
||||
licensed under the Apache 2.0 license:
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
|
||||
** mcs/tools
|
||||
|
||||
|
||||
+13
-32
@@ -1,34 +1,25 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
ACLOCAL_AMFLAGS = -I .
|
||||
|
||||
MOONLIGHT_SUBDIRS = $(libgc_dir) eglib/src mono
|
||||
MOONLIGHT_SUBDIRS = $(libgc_dir) eglib mono $(ikvm_native_dir) data
|
||||
|
||||
if CROSS_COMPILING
|
||||
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) data runtime scripts man samples msvc $(docs_dir)
|
||||
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) data runtime scripts man samples web msvc $(docs_dir)
|
||||
# Keep in sync with SUBDIRS
|
||||
## 'tools' is not normally built
|
||||
DIST_SUBDIRS = po libgc eglib mono ikvm-native data runtime scripts man samples tools msvc docs
|
||||
DIST_SUBDIRS = po libgc eglib mono ikvm-native data runtime scripts man samples web tools msvc docs
|
||||
else
|
||||
if ONLY_MOONLIGHT
|
||||
SUBDIRS = $(MOONLIGHT_SUBDIRS) runtime
|
||||
else
|
||||
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
|
||||
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples web msvc $(docs_dir)
|
||||
# Keep in sync with SUBDIRS
|
||||
## 'tools' is not normally built
|
||||
DIST_SUBDIRS = po libgc eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
|
||||
DIST_SUBDIRS = po libgc eglib mono ikvm-native support data runtime scripts man samples web tools msvc docs
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST= \
|
||||
LICENSE \
|
||||
autogen.sh \
|
||||
build-mingw32.sh \
|
||||
mkinstalldirs \
|
||||
mono-uninstalled.pc.in \
|
||||
nls.m4 \
|
||||
po.m4 \
|
||||
progtest.m4 \
|
||||
winconfig.h
|
||||
EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs autogen.sh
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
|
||||
|
||||
@@ -46,8 +37,7 @@ DISTCLEANFILES= mono-uninstalled.pc
|
||||
# building with monolite
|
||||
mcslib = $(mcs_topdir)/class/lib
|
||||
monolite = $(mcslib)/monolite
|
||||
mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
|
||||
monolite_url = http://mono.ximian.com/daily/monolite-$(mono_corlib_version)-latest.tar.gz
|
||||
monolite_url = http://mono.ximian.com/daily/monolite-latest.tar.gz
|
||||
.PHONY: get-monolite-latest
|
||||
get-monolite-latest:
|
||||
-rm -fr $(mcslib)/monolite-*
|
||||
@@ -82,26 +72,17 @@ bootstrap-world: compiler-tests
|
||||
if MOONLIGHT
|
||||
moon-do-build: config.h
|
||||
@list='$(MOONLIGHT_SUBDIRS)'; for subdir in $$list; do \
|
||||
case "x$$subdir" in \
|
||||
xmono ) target="moon-do-build";; \
|
||||
* ) target="all";; \
|
||||
esac; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
|
||||
echo "Making all in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all); \
|
||||
done;
|
||||
(cd runtime && $(MAKE) $(AM_MAKEFLAGS) moon-do-build)
|
||||
cd $(mcs_topdir) && NO_DIR_CHECK=1 $(MAKE) PROFILE=moonlight_raw all
|
||||
|
||||
moon-do-clean:
|
||||
@list='$(MOONLIGHT_SUBDIRS)'; for subdir in $$list; do \
|
||||
case "x$$subdir" in \
|
||||
xmono ) target="moon-do-clean";; \
|
||||
* ) target="clean";; \
|
||||
esac; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
|
||||
echo "Making clean in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean); \
|
||||
done;
|
||||
(cd runtime && $(MAKE) $(AM_MAKEFLAGS) moon-do-clean)
|
||||
|
||||
cd $(mcs_topdir) && NO_DIR_CHECK=1 $(MAKE) PROFILE=moonlight_raw clean
|
||||
endif
|
||||
|
||||
win32getdeps:
|
||||
|
||||
@@ -11,6 +11,16 @@ This is Mono.
|
||||
a. Build Requirements
|
||||
---------------------
|
||||
|
||||
To build Mono, you will need the following components:
|
||||
|
||||
* pkg-config
|
||||
|
||||
Available from: http://www.freedesktop.org/Software/pkgconfig
|
||||
|
||||
* glib 2.4
|
||||
|
||||
Available from: http://www.gtk.org/
|
||||
|
||||
On Itanium, you must obtain libunwind:
|
||||
|
||||
http://www.hpl.hp.com/research/linux/libunwind/download.php4
|
||||
@@ -25,15 +35,7 @@ This is Mono.
|
||||
* libgdiplus
|
||||
|
||||
If you want to get support for System.Drawing, you will need to get
|
||||
Libgdiplus. This library in turn requires glib and pkg-config:
|
||||
|
||||
* pkg-config
|
||||
|
||||
Available from: http://www.freedesktop.org/Software/pkgconfig
|
||||
|
||||
* glib 2.4
|
||||
|
||||
Available from: http://www.gtk.org/
|
||||
Libgdiplus.
|
||||
|
||||
* libzlib
|
||||
|
||||
@@ -72,18 +74,15 @@ This is Mono.
|
||||
make V=1
|
||||
|
||||
|
||||
c. Building the software from GIT
|
||||
|
||||
c. Building the software from SVN
|
||||
---------------------------------
|
||||
|
||||
If you are building the software from GIT, make sure that you
|
||||
If you are building the software from SVN, make sure that you
|
||||
have up-to-date mcs and mono sources:
|
||||
|
||||
If you are an anonymous user:
|
||||
git clone git://github.com/mono/mono.git
|
||||
|
||||
If you are a Mono contributors with read/write privileges:
|
||||
git clone [email protected]:mono/mono.git
|
||||
|
||||
svn co svn+ssh://[email protected]/source/trunk/mono
|
||||
svn co svn+ssh://[email protected]/source/trunk/mcs
|
||||
|
||||
Then, go into the mono directory, and configure:
|
||||
|
||||
@@ -130,16 +129,16 @@ This is Mono.
|
||||
distribution, which contains just enough to run the 'mcs'
|
||||
compiler. You do this with:
|
||||
|
||||
# Run the following line after ./autogen.sh
|
||||
make get-monolite-latest
|
||||
|
||||
This will download and automatically gunzip and untar the
|
||||
tarball, and place the files appropriately so that you can then
|
||||
just run:
|
||||
|
||||
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
|
||||
make
|
||||
|
||||
And that will use the files downloaded by 'make get-monolite-latest.
|
||||
To ensure that you're using the 'monolite' distribution, you can
|
||||
also try passing EXTERNAL_MCS=false on the make command-line.
|
||||
|
||||
Testing and Installation
|
||||
------------------------
|
||||
@@ -165,13 +164,10 @@ This is Mono.
|
||||
|
||||
make install
|
||||
|
||||
You can verify your installation by using the mono-test-install
|
||||
script, it can diagnose some common problems with Mono's install.
|
||||
|
||||
Failure to follow these steps may result in a broken installation.
|
||||
|
||||
d. Configuration Options
|
||||
------------------------
|
||||
d. Common Configuration Options
|
||||
-------------------------------
|
||||
|
||||
The following are the configuration options that someone
|
||||
building Mono might want to use:
|
||||
@@ -305,21 +301,6 @@ This is Mono.
|
||||
System.dll, System.Code.dll and System.Xml.Core.dll) and turn
|
||||
on the LINQ extensions for the compiler.
|
||||
|
||||
--with-moon-gc=boehm,sgen
|
||||
|
||||
Select the GC to use for Moonlight.
|
||||
|
||||
boehm:
|
||||
Selects the Boehm Garbage Collector, with the same flags
|
||||
as the regular Mono build. This is the default.
|
||||
|
||||
sgen:
|
||||
Selects the new SGen Garbage Collector, which provides
|
||||
Generational GC support, using the same flags as the
|
||||
mono-sgen build.
|
||||
|
||||
This defaults to `boehm'.
|
||||
|
||||
--with-libgdiplus=installed,sibling,<path>
|
||||
|
||||
This is used to configure where should Mono look for
|
||||
@@ -586,3 +567,4 @@ This is Mono.
|
||||
same prefix than this module gets.
|
||||
|
||||
|
||||
|
||||
+41
-104
@@ -2,7 +2,7 @@
|
||||
CURDIR="`pwd`"
|
||||
MINGW=i386-mingw32msvc
|
||||
CROSS_DIR=/opt/cross/$MINGW
|
||||
EXTRA_CROSS_DIR=
|
||||
COPY_DLLS="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll"
|
||||
INSTALL_DESTDIR="$CURDIR/mono-win32"
|
||||
PROFILES="default net_2_0 net_3_5 net_4_0 moonlight"
|
||||
TEMPORARY_PKG_CONFIG_DIR=/tmp/$RANDOM-pkg-config-$RANDOM
|
||||
@@ -17,119 +17,62 @@ function cleanup ()
|
||||
fi
|
||||
}
|
||||
|
||||
function check_pkg_config_dir ()
|
||||
{
|
||||
local DIR="$1"
|
||||
local DIR_PREFIX="$2"
|
||||
|
||||
if [ ! -d "$DIR" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
|
||||
for pc in "$DIR"/*.pc; do
|
||||
if [ -f $pc ]; then
|
||||
pcname="`basename $pc`"
|
||||
sed -e "s;^prefix=.*;prefix=$DIR_PREFIX;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
|
||||
fi;
|
||||
done
|
||||
|
||||
if [ -z "$CROSS_PKG_CONFIG_DIR" ]; then
|
||||
CROSS_PKG_CONFIG_DIR="$TEMPORARY_PKG_CONFIG_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
function show_build_info ()
|
||||
{
|
||||
cat <<EOF
|
||||
Installation prefix: $MONO_PREFIX
|
||||
CPPFLAGS: ${CPPFLAGS:=not set}
|
||||
LDFLAGS: ${LDFLAGS:=not set}
|
||||
MONO_PATH: ${MONO_PATH:=not set}
|
||||
EOF
|
||||
}
|
||||
|
||||
function setup ()
|
||||
{
|
||||
local pcname
|
||||
|
||||
CROSS_BIN_DIR="$CROSS_DIR/bin"
|
||||
CROSS_DLL_DIR="$CROSS_DIR/bin"
|
||||
CROSS_PKG_CONFIG_DIR=$CROSS_DIR/lib/pkgconfig
|
||||
PATH=$CROSS_BIN_DIR:$PATH
|
||||
|
||||
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
|
||||
|
||||
if [ -d ./.git ]; then
|
||||
MONO_GIT_COMMIT="`git log -1 --format=format:%t`"
|
||||
MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2`"
|
||||
MONO_RELEASE="$MONO_VERSION-$MONO_GIT_BRANCH-$MONO_GIT_COMMIT"
|
||||
export PATH
|
||||
if [ -d ./.git/svn ]; then
|
||||
SVN_INFO='git svn info'
|
||||
elif [ -d ./.svn ]; then
|
||||
SVN_INFO='svn info'
|
||||
else
|
||||
MONO_RELEASE="$MONO_VERSION"
|
||||
SVN_INFO=""
|
||||
fi
|
||||
|
||||
MONO_PREFIX="$MONO_PREFIX/mono-$MONO_RELEASE"
|
||||
if [ -n "$SVN_INFO" ]; then
|
||||
MONO_SVN_REVISION=`$SVN_INFO | grep Revision | sed 's/.*: //'`
|
||||
MONO_BRANCH=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'`
|
||||
else
|
||||
MONO_SVN_REVISION="rUNKNOWN"
|
||||
MONO_BRANCH="tarball"
|
||||
fi
|
||||
|
||||
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
|
||||
MONO_RELEASE="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION"
|
||||
MONO_PREFIX="/mono-$MONO_RELEASE"
|
||||
|
||||
NOCONFIGURE=yes
|
||||
export NOCONFIGURE
|
||||
|
||||
check_pkg_config_dir "$CROSS_DIR/lib/pkgconfig" "$CROSS_DIR"
|
||||
|
||||
if [ -n "$EXTRA_CROSS_DIR" -a -d "$EXTRA_CROSS_DIR" ]; then
|
||||
if [ -d "$EXTRA_CROSS_DIR/bin" ]; then
|
||||
PATH="$EXTRA_CROSS_DIR/bin":$PATH
|
||||
fi
|
||||
|
||||
check_pkg_config_dir "$EXTRA_CROSS_DIR/lib/pkgconfig" "$EXTRA_CROSS_DIR"
|
||||
|
||||
if [ -d "$EXTRA_CROSS_DIR/include" ]; then
|
||||
if [ -z "$CPPFLAGS" ]; then
|
||||
CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\""
|
||||
else
|
||||
CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\" $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$EXTRA_CROSS_DIR/lib" ]; then
|
||||
if [ -z "$LDFLAGS" ]; then
|
||||
LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\""
|
||||
else
|
||||
LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\" $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$EXTRA_CROSS_DIR/share/aclocal" ]; then
|
||||
if [ -z "$MONO_PATH" ]; then
|
||||
MONO_PATH="\"$EXTRA_CROSS_DIR\""
|
||||
else
|
||||
MONO_PATH="\"$EXTRA_CROSS_DIR\":$MONO_PATH"
|
||||
fi
|
||||
fi
|
||||
if [ -d "$CROSS_PKG_CONFIG_DIR" ]; then
|
||||
install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
|
||||
for pc in "$CROSS_PKG_CONFIG_DIR"/*.pc; do
|
||||
pcname="`basename $pc`"
|
||||
sed -e "s;^prefix=.*;prefix=$CROSS_DIR;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
|
||||
done
|
||||
CROSS_PKG_CONFIG_DIR="$TEMPORARY_PKG_CONFIG_DIR"
|
||||
fi
|
||||
|
||||
export PATH MONO_PATH CPPFLAGS
|
||||
show_build_info
|
||||
|
||||
echo Mono Win32 installation prefix: $MONO_PREFIX
|
||||
}
|
||||
|
||||
function build ()
|
||||
{
|
||||
if [ -f ./Makefile ]; then
|
||||
make distclean
|
||||
fi
|
||||
|
||||
if [ -d ./autom4te.cache ]; then
|
||||
rm -rf ./autom4te.cache
|
||||
fi
|
||||
|
||||
if [ -f ./config.status ]; then
|
||||
for f in `find -name config.status -type f`; do
|
||||
rm $f
|
||||
done
|
||||
fi
|
||||
|
||||
./autogen.sh
|
||||
|
||||
BUILD="`./config.guess`"
|
||||
|
||||
if [ -f ./Makefile ]; then
|
||||
make distclean
|
||||
rm -rf autom4te.cache
|
||||
fi
|
||||
|
||||
if [ ! -d "$CURDIR/build-cross-windows" ]; then
|
||||
mkdir "$CURDIR/build-cross-windows"
|
||||
fi
|
||||
@@ -162,28 +105,27 @@ function doinstall ()
|
||||
cd "$CURDIR/build-cross-windows"
|
||||
make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
|
||||
|
||||
if test -d $CURDIR/mcs; then
|
||||
mcsdir=$CURDIR/mcs
|
||||
else
|
||||
mcsdir=$CURDIR/../mcs
|
||||
fi
|
||||
cd "$CURDIR/../mcs/mcs"
|
||||
|
||||
cd "$mcsdir/mcs"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$mcsdir/class"
|
||||
cd "$CURDIR/../mcs/class"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$mcsdir/tools"
|
||||
cd "$CURDIR/../mcs/tools"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/mono-win32"
|
||||
for dll in $COPY_DLLS; do
|
||||
cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin"
|
||||
done
|
||||
|
||||
rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
|
||||
zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
|
||||
|
||||
@@ -197,9 +139,7 @@ Usage: build-mingw32.sh [OPTIONS]
|
||||
where OPTIONS are:
|
||||
|
||||
-d DIR Sets the location of directory where MINGW is installed [$CROSS_DIR]
|
||||
-e DIR Sets the location of directory where additional cross develoment packages are installed [${EXTRA_CROSS_DIR:=none}]
|
||||
-m MINGW Sets the MINGW target name to be passed to configure [$MINGW]
|
||||
-p PREFIX Prefix at which Mono is to be installed. Build will append the 'mono-X.Y' string to that path
|
||||
EOF
|
||||
|
||||
exit 1
|
||||
@@ -209,12 +149,10 @@ trap cleanup 0
|
||||
|
||||
pushd . > /dev/null
|
||||
|
||||
while getopts "d:m:e:p:" opt; do
|
||||
while getopts "d:m:h" opt; do
|
||||
case "$opt" in
|
||||
d) CROSS_DIR="$OPTARG" ;;
|
||||
m) MINGW="$OPTARG" ;;
|
||||
e) EXTRA_CROSS_DIR="$OPTARG" ;;
|
||||
p) MONO_PREFIX="$OPTARG" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
@@ -222,6 +160,5 @@ done
|
||||
setup
|
||||
build
|
||||
doinstall
|
||||
show_build_info
|
||||
|
||||
popd > /dev/null
|
||||
+48
-117
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,2.10)
|
||||
AM_INIT_AUTOMAKE(mono,2.8)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=2.0
|
||||
@@ -86,7 +86,7 @@ case "$host" in
|
||||
host_win32=yes
|
||||
if test "x$cross_compiling" = "xno"; then
|
||||
target_win32=yes
|
||||
if test "x$host" == "x$build"; then
|
||||
if test "x$host" == "x$target"; then
|
||||
AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
|
||||
fi
|
||||
CC="gcc -mno-cygwin -g"
|
||||
@@ -94,7 +94,6 @@ case "$host" in
|
||||
# So libgc configure gets -mno-cygwin
|
||||
export CC
|
||||
export CXX
|
||||
CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB -mno-cygwin"
|
||||
else
|
||||
target_win32=yes
|
||||
AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW])
|
||||
@@ -181,6 +180,7 @@ case "$host" in
|
||||
libmono_cflags="-D_REENTRANT"
|
||||
libdl="-ldl"
|
||||
libgc_threads=pthreads
|
||||
AOT_SUPPORTED="yes"
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-nacl*)
|
||||
@@ -192,11 +192,11 @@ case "$host" in
|
||||
libmono_cflags="-D_REENTRANT"
|
||||
libdl=
|
||||
libgc_threads=pthreads
|
||||
AOT_SUPPORTED="yes"
|
||||
gc_default=boehm
|
||||
use_sigposix=yes
|
||||
ikvm_native=no
|
||||
AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
|
||||
AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
|
||||
;;
|
||||
*-*-hpux*)
|
||||
host_win32=no
|
||||
@@ -379,15 +379,15 @@ AC_CHECK_HEADERS(sys/user.h, [], [],
|
||||
AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
|
||||
if test x$have_zlib = xyes; then
|
||||
AC_TRY_COMPILE([#include <zlib.h>], [
|
||||
void main () {
|
||||
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#error No good zlib found
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT(Using system zlib)
|
||||
zlib_msg="system zlib"
|
||||
AC_DEFINE(HAVE_SYS_ZLIB,1,[Have system zlib])
|
||||
],[
|
||||
AC_MSG_RESULT(Using embedded zlib)
|
||||
have_zlib=no
|
||||
@@ -591,6 +591,27 @@ AC_SUBST(GMODULE_LIBS)
|
||||
AC_SUBST(BUILD_GLIB_CFLAGS)
|
||||
AC_SUBST(BUILD_GLIB_LIBS)
|
||||
|
||||
if test x$cross_compiling$host_win32 = xnoyes; then
|
||||
AC_MSG_CHECKING(for cygwin glib2-dev package)
|
||||
if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
|
||||
AC_MSG_RESULT(found)
|
||||
AC_MSG_ERROR([Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure.])
|
||||
else
|
||||
AC_MSG_RESULT(not found, ok)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for broken gwin32.h)
|
||||
glib_include=`$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`
|
||||
if test -f $glib_include/glib/gwin32.h; then
|
||||
if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
|
||||
AC_MSG_RESULT(failed)
|
||||
hashmark='#'
|
||||
AC_MSG_ERROR([Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(ok)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(gc, [ --with-gc=boehm,included,none Controls the Boehm GC config, default=included],[gc=$with_gc],[gc=$gc_default])
|
||||
|
||||
# Enable support for fast thread-local storage
|
||||
@@ -602,27 +623,17 @@ AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage i
|
||||
AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack (defaults to yes)],[],[with_sigaltstack=yes])
|
||||
|
||||
AC_ARG_WITH(static_mono, [ --with-static_mono=yes,no link mono statically to libmono (faster) (defaults to yes)],[],[with_static_mono=yes])
|
||||
AC_ARG_WITH(shared_mono, [ --with-shared_mono=yes,no build a shared libmono library (defaults to yes)],[],[with_shared_mono=yes])
|
||||
|
||||
if test "x$enable_static" = "xno"; then
|
||||
with_static_mono=no
|
||||
fi
|
||||
|
||||
if test "x$enable_shared" = "xno"; then
|
||||
with_shared_mono=no
|
||||
fi
|
||||
|
||||
case $host in
|
||||
*nacl* ) with_shared_mono=yes;;
|
||||
esac
|
||||
|
||||
if test "x$host_win32" = "xyes"; then
|
||||
# Boehm GC requires the runtime to be in its own dll
|
||||
with_static_mono=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
|
||||
AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
|
||||
AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
|
||||
|
||||
AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
|
||||
@@ -651,19 +662,23 @@ if test x$enable_small_config = xyes; then
|
||||
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DSMALL_CONFIG"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compilation of system assemblies during the build (on by default on some platforms)], enable_system_aot=$enableval, enable_system_aot=default)
|
||||
if test x$AOT_SUPPORTED != xyes; then
|
||||
AOT_SUPPORTED=no
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compilation of system assemblies during the build (on by default on some platforms)], enable_system_aot=$enableval, enable_system_aot=$AOT_SUPPORTED)
|
||||
|
||||
DISABLED_FEATURES=none
|
||||
|
||||
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
|
||||
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
|
||||
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization, assembly_remapping.],
|
||||
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization.],
|
||||
[
|
||||
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
|
||||
eval "mono_feature_disable_$feature='yes'"
|
||||
done
|
||||
DISABLED_FEATURES=$enable_minimal
|
||||
disabled="Disabled: $enable_minimal"
|
||||
disabled="Disabled: $enable_minimal"
|
||||
],[])
|
||||
|
||||
AC_DEFINE_UNQUOTED(DISABLED_FEATURES, "$DISABLED_FEATURES", [String of disabled features])
|
||||
@@ -777,11 +792,6 @@ if test "x$mono_feature_disable_normalization" = "xyes"; then
|
||||
AC_MSG_NOTICE([Disabled String normalization support.])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_assembly_remapping" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_ASSEMBLY_REMAPPING, 1, [Disable assembly remapping.])
|
||||
AC_MSG_NOTICE([Disabled Assembly remapping.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for visibility __attribute__)
|
||||
AC_TRY_COMPILE([], [
|
||||
void __attribute__ ((visibility ("hidden"))) doit (void) {}
|
||||
@@ -851,14 +861,6 @@ case "x$gc" in
|
||||
if test "x$found_gc_enable" = "xyes"; then
|
||||
BOEHM_DEFINES="-DHAVE_GC_ENABLE $BOEHM_DEFINES"
|
||||
fi
|
||||
|
||||
# check whether we need to explicitly allow
|
||||
# thread registering
|
||||
AC_CHECK_LIB(gc, GC_allow_register_threads, found_allow_register_threads="yes",,$libdl)
|
||||
if test "x$found_allow_register_threads" = "xyes"; then
|
||||
AC_DEFINE(HAVE_GC_ALLOW_REGISTER_THREADS, 1, [GC requires thread registration])
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
xincluded)
|
||||
@@ -997,11 +999,9 @@ if test x$target_win32 = xno; then
|
||||
AC_CHECK_FUNCS(getpriority)
|
||||
AC_CHECK_FUNCS(setpriority)
|
||||
AC_CHECK_FUNCS(dl_iterate_phdr)
|
||||
AC_CHECK_FUNCS(dladdr)
|
||||
AC_CHECK_FUNCS(sysconf)
|
||||
|
||||
AC_CHECK_FUNCS(sched_setaffinity)
|
||||
AC_CHECK_FUNCS(sched_getcpu)
|
||||
|
||||
dnl ****************************************************************
|
||||
dnl *** Check for sched_setaffinity from glibc versions before ***
|
||||
@@ -1754,11 +1754,6 @@ if test x$target_win32 = xno; then
|
||||
dnl * on xp+
|
||||
AC_DEFINE(HAVE_GETPROCESSID, 1, [Define if GetProcessId is available])
|
||||
else
|
||||
dnl *********************************
|
||||
dnl *** Checks for Windows compilation ***
|
||||
dnl *********************************
|
||||
AC_CHECK_HEADERS(winternl.h)
|
||||
|
||||
jdk_headers_found=no
|
||||
AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
|
||||
AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
|
||||
@@ -1842,7 +1837,6 @@ fi
|
||||
|
||||
AC_CHECK_FUNCS(round)
|
||||
AC_CHECK_FUNCS(rint)
|
||||
AC_CHECK_FUNCS(execvp)
|
||||
|
||||
dnl ****************************
|
||||
dnl *** Look for /dev/random ***
|
||||
@@ -1855,7 +1849,7 @@ try_dev_random=$enableval, try_dev_random=yes)
|
||||
|
||||
AC_MSG_RESULT($try_dev_random)
|
||||
|
||||
case "{$build}" in
|
||||
case "{$target}" in
|
||||
*-openbsd*)
|
||||
NAME_DEV_RANDOM="/dev/srandom"
|
||||
;;
|
||||
@@ -1998,7 +1992,6 @@ dnl *** NaCl ***
|
||||
dnl **************
|
||||
|
||||
AC_ARG_ENABLE(nacl_codegen, [ --enable-nacl-codegen Enable Native Client code generation], enable_nacl_codegen=$enableval, enable_nacl_codegen=no)
|
||||
AC_ARG_ENABLE(nacl_gc, [ --enable-nacl-gc Enable Native Client garbage collection], enable_nacl_gc=$enableval, enable_nacl_gc=no)
|
||||
|
||||
AM_CONDITIONAL(NACL_CODEGEN, test x$enable_nacl_codegen != xno)
|
||||
if test "x$enable_nacl_codegen" = "xyes"; then
|
||||
@@ -2007,10 +2000,6 @@ if test "x$enable_nacl_codegen" = "xyes"; then
|
||||
AC_DEFINE(TARGET_NACL, 1, [...])
|
||||
else
|
||||
MONO_NACL_ALIGN_MASK_OFF=0
|
||||
CPPFLAGS="$CPPFLAGS -D__default_codegen__"
|
||||
fi
|
||||
if test "x$enable_nacl_gc" = "xyes"; then
|
||||
CPPFLAGS="$CPPFLAGS -finstrument-for-thread-suspension -D__native_client_gc__"
|
||||
fi
|
||||
AC_SUBST(MONO_NACL_ALIGN_MASK_OFF)
|
||||
|
||||
@@ -2018,7 +2007,7 @@ dnl **************
|
||||
dnl *** LLVM ***
|
||||
dnl **************
|
||||
|
||||
AC_ARG_ENABLE(llvm,[ --enable-llvm Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=no)
|
||||
AC_ARG_ENABLE(llvm,[ --enable-llvm Enable the experimental LLVM back-end], enable_llvm=$enableval, enable_llvm=no)
|
||||
AC_ARG_ENABLE(loadedllvm,[ --enable-loadedllvm Load the LLVM back-end dynamically], enable_llvm=$enableval && enable_loadedllvm=$enableval, enable_loadedllvm=no)
|
||||
|
||||
if test "x$enable_llvm" = "xyes"; then
|
||||
@@ -2140,11 +2129,7 @@ case "$host" in
|
||||
haiku*)
|
||||
LIBC=libroot.so
|
||||
;;
|
||||
linux*)
|
||||
sgen_supported=true
|
||||
AOT_SUPPORTED="yes"
|
||||
;;
|
||||
darwin*|openbsd*|freebsd*)
|
||||
linux*|darwin*|openbsd*)
|
||||
sgen_supported=true
|
||||
;;
|
||||
esac
|
||||
@@ -2155,20 +2140,10 @@ case "$host" in
|
||||
JIT_SUPPORTED=yes
|
||||
jit_wanted=true
|
||||
case $host_os in
|
||||
linux*)
|
||||
sgen_supported=true
|
||||
AOT_SUPPORTED="yes"
|
||||
;;
|
||||
darwin*|openbsd*|freebsd*)
|
||||
linux*|darwin*|openbsd*)
|
||||
sgen_supported=true
|
||||
;;
|
||||
esac
|
||||
case "$host" in
|
||||
x86_64-*-nacl*)
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ia64-*-*)
|
||||
TARGET=IA64
|
||||
@@ -2320,14 +2295,6 @@ if test "x$host" != "x$target"; then
|
||||
sizeof_register=8
|
||||
target_byte_order=G_BIG_ENDIAN
|
||||
;;
|
||||
x86_64-*-nacl)
|
||||
TARGET=AMD64
|
||||
arch_target=amd64
|
||||
AC_DEFINE(TARGET_AMD64, 1, [...])
|
||||
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([Cross compiling is only supported for targets matching 'powerpc64-{ps3,xbox360}-linux-gnu'])
|
||||
esac
|
||||
@@ -2380,13 +2347,8 @@ fi
|
||||
dnl
|
||||
dnl Simple Generational checks (sgen)
|
||||
dnl
|
||||
if $sgen_supported; then
|
||||
build_sgen_default=yes
|
||||
else
|
||||
build_sgen_default=no
|
||||
fi
|
||||
SGEN_DEFINES=
|
||||
AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=$build_sgen_default])
|
||||
AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
|
||||
if test x$buildsgen = xyes; then
|
||||
if $sgen_supported; then
|
||||
SGEN_DEFINES="-DHAVE_SGEN_GC -DHAVE_MOVING_COLLECTOR -DHAVE_WRITE_BARRIERS"
|
||||
@@ -2521,11 +2483,6 @@ if test "x$try_mono_debugger" = "xyes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# disable the debugger entirely when building with moonlight
|
||||
if test "x$with_moonlight" != "xno"; then
|
||||
mono_debugger_supported=no
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(if the Mono Debugger is supported on this platform)
|
||||
if test "x$mono_debugger_supported" = "xyes"; then
|
||||
BOEHM_DEFINES="$BOEHM_DEFINES -DMONO_DEBUGGER_SUPPORTED"
|
||||
@@ -2585,10 +2542,6 @@ case "x$gc" in
|
||||
if test x$TARGET = xSPARC -o x$TARGET = xSPARC64; then
|
||||
LIBGC_CPPFLAGS=`echo $LIBGC_CPPFLAGS | sed -e 's/-D_FILE_OFFSET_BITS=64//g'`
|
||||
fi
|
||||
# Don't pass -finstrument-for-thread-suspension in,
|
||||
# if these are instrumented it will be very bad news
|
||||
# (infinite recursion, undefined parking behavior, etc)
|
||||
LIBGC_CPPFLAGS=`echo $LIBGC_CPPFLAGS | sed -e 's/-finstrument-for-thread-suspension//g'`
|
||||
ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads $libgc_configure_args \"CPPFLAGS_FOR_LIBGC=$LIBGC_CPPFLAGS\" \"CFLAGS_FOR_LIBGC=$CFLAGS_FOR_LIBGC\""
|
||||
AC_CONFIG_SUBDIRS(libgc)
|
||||
;;
|
||||
@@ -2596,8 +2549,7 @@ esac
|
||||
|
||||
#AC_ARG_WITH(profile2, [ --with-profile2=yes,no If you want to install the 2.0 FX (defaults to yes)], [], [with_profile2=yes])
|
||||
AC_ARG_WITH(profile4, [ --with-profile4=yes,no If you want to install the 4.0 FX (defaults to yes)], [], [with_profile4=yes])
|
||||
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid 2.1 assemblies (defaults to no)], [], [with_monodroid=no])
|
||||
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the MonoTouch 2.1 assemblies (defaults to no)], [], [with_monotouch=no])
|
||||
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the raw MonoTouch 2.1 assemblies (defaults to no)], [], [with_monotouch=no])
|
||||
|
||||
OPROFILE=no
|
||||
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<oprofile install dir> Enable oprofile support (defaults to no)],[
|
||||
@@ -2628,23 +2580,16 @@ AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the
|
||||
DISABLE_MCS_DOCS=yes
|
||||
fi
|
||||
])
|
||||
if test x$with_profile4 != xyes; then
|
||||
DISABLE_MCS_DOCS=yes
|
||||
fi
|
||||
|
||||
MOONLIGHT_DEFINES=
|
||||
AC_ARG_WITH(moonlight, [ --with-moonlight=yes|no|only If you want to build Mono for Moonlight (defaults to no)],[
|
||||
if test x$with_moonlight != xno; then
|
||||
MOONLIGHT_DEFINES="-DMOONLIGHT -DDISABLE_ASSEMBLY_REMAPPING "
|
||||
if test "x$with_moonlight" = "xyes"; then
|
||||
AC_DEFINE(MOONLIGHT,1,[Building for Moonlight])
|
||||
elif test "x$with_moonlight" = "xonly"; then
|
||||
AC_DEFINE(MOONLIGHT,1,[Building for Moonlight])
|
||||
fi
|
||||
], [with_moonlight=no])
|
||||
AC_SUBST(MOONLIGHT_DEFINES)
|
||||
|
||||
AC_ARG_WITH(moon_gc, [ --with-moon-gc=boehm,sgen Select the gc to use with Moonlight (defaults to boehm)],[
|
||||
if test "x$with_moon_gc" != "xsgen"; then
|
||||
with_moon_gc=boehm
|
||||
fi
|
||||
], [with_moon_gc=boehm])
|
||||
|
||||
|
||||
AC_CHECK_HEADER([malloc.h],
|
||||
[AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
|
||||
@@ -2672,11 +2617,7 @@ libmono_ldflags="$libmono_ldflags $LIBS"
|
||||
|
||||
AM_CONDITIONAL(MOONLIGHT, [test "x$with_moonlight" != "xno"])
|
||||
AM_CONDITIONAL(ONLY_MOONLIGHT, [test "x$with_moonlight" = "xonly"])
|
||||
AM_CONDITIONAL(MOONLIGHT_BOEHM, [test "x$with_moon_gc" = "xboehm"])
|
||||
AM_CONDITIONAL(MOONLIGHT_SGEN, [test "x$with_moon_gc" = "xsgen"])
|
||||
|
||||
AM_CONDITIONAL(INSTALL_4_0, [test "x$with_profile4" = xyes])
|
||||
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" = xyes])
|
||||
AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" = xyes])
|
||||
|
||||
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
|
||||
@@ -2882,6 +2823,7 @@ mono/profiler/Makefile
|
||||
ikvm-native/Makefile
|
||||
scripts/Makefile
|
||||
man/Makefile
|
||||
web/Makefile
|
||||
docs/Makefile
|
||||
data/Makefile
|
||||
data/net_2_0/Makefile
|
||||
@@ -2889,7 +2831,6 @@ data/net_4_0/Makefile
|
||||
data/net_2_0/Browsers/Makefile
|
||||
data/mint.pc
|
||||
data/mono-2.pc
|
||||
data/monosgen-2.pc
|
||||
data/mono.pc
|
||||
data/mono-cairo.pc
|
||||
data/mono-nunit.pc
|
||||
@@ -2973,16 +2914,7 @@ fi
|
||||
echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
|
||||
fi
|
||||
|
||||
if test x$AOT_SUPPORTED = xyes -a x$enable_system_aot = xdefault; then
|
||||
enable_system_aot=yes
|
||||
fi
|
||||
|
||||
if test "x$enable_loadedllvm" = "xyes"; then
|
||||
# This seems to fail on the x86 buildbots
|
||||
enable_system_aot=no
|
||||
fi
|
||||
|
||||
if test x$host_win32 = xno -a x$platform_darwin != xyes -a x$enable_system_aot = xyes; then
|
||||
if test x$host_win32 = xno -a x$platform_darwin != xyes -a "x$AOT_SUPPORTED" = "xyes" -a x$enable_system_aot = xyes; then
|
||||
echo "ENABLE_AOT = 1" >> $mcs_topdir/build/config.make
|
||||
fi
|
||||
|
||||
@@ -3033,8 +2965,7 @@ echo "
|
||||
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
|
||||
|
||||
Libraries:
|
||||
Moon Profile: $with_moonlight ($with_moon_gc)
|
||||
MonoDroid: $with_monodroid
|
||||
Moon Profile: $with_moonlight
|
||||
MonoTouch: $with_monotouch
|
||||
JNI support: $jdk_headers_found
|
||||
libgdiplus: $libgdiplus_msg
|
||||
|
||||
+4
-10
@@ -9,7 +9,7 @@ monodir = $(sysconfdir)/mono
|
||||
EXTRA_DIST = \
|
||||
config.in \
|
||||
browscap.ini mono.supp mono.d README ChangeLog \
|
||||
mono.pc.in mono-2.pc.in monosgen-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
|
||||
mono.pc.in mono-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
|
||||
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
|
||||
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
|
||||
dtrace-prelink.sh mono.web.pc.in system.web.mvc.pc.in system.web.mvc2.pc.in \
|
||||
@@ -19,26 +19,20 @@ EXTRA_DIST = \
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
if SUPPORT_SGEN
|
||||
SGENPCFILE=monosgen-2.pc
|
||||
else
|
||||
SGENPCFILE=
|
||||
endif
|
||||
|
||||
if JIT_SUPPORTED
|
||||
if INTERP_SUPPORTED
|
||||
pkgconfig_DATA= mono.pc mono-2.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc $(SGENPCFILE)
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc
|
||||
else
|
||||
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc $(SGENPCFILE)
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc
|
||||
endif
|
||||
else
|
||||
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc
|
||||
endif
|
||||
|
||||
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc $(SGENPCFILE)
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc
|
||||
|
||||
mono_DATA = config \
|
||||
browscap.ini
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
assemblies_dir=@prefix@/lib/mono
|
||||
Libraries=${assemblies_dir}/gac/Mono.Cecil/0.9.4.0__0738eb9f132ed756/Mono.Cecil.dll
|
||||
Libraries=${assemblies_dir}/gac/Mono.Cecil/0.6.9.0__0738eb9f132ed756/Mono.Cecil.dll
|
||||
|
||||
Name: Mono Internal -- Do not use.
|
||||
Description: Mono Internal Libraries -- Do not use
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
<dllmap dll="libX11" target="@X11@" os="!windows" />
|
||||
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
|
||||
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
|
||||
<dllmap dll="libcups" target="libcups.dylib" os="osx"/>
|
||||
<dllmap dll="i:kernel32.dll">
|
||||
<dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
|
||||
<dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
|
||||
|
||||
@@ -288,8 +288,6 @@ def lookup_pretty_printer(val):
|
||||
return ObjectPrinter (val)
|
||||
if t == "string":
|
||||
return StringPrinter (val)
|
||||
if t == "MonoString *":
|
||||
return StringPrinter (val)
|
||||
if t == "MonoMethod *":
|
||||
return MonoMethodPrinter (val)
|
||||
if t == "MonoClass *":
|
||||
|
||||
@@ -4,4 +4,4 @@ Sources=${assemblies_dir}/Options.cs
|
||||
|
||||
Name: Mono.Options
|
||||
Description: Command Line Parsing Library
|
||||
Version: 0.2.2
|
||||
Version: 0.2.1
|
||||
@@ -1,11 +0,0 @@
|
||||
prefix=${pcfiledir}/../..
|
||||
exec_prefix=${pcfiledir}/../..
|
||||
libdir=${prefix}/@reloc_libdir@
|
||||
includedir=${prefix}/include/mono-@API_VER@
|
||||
sysconfdir=@sysconfdir@
|
||||
|
||||
Name: Mono
|
||||
Description: Mono Runtime
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} @export_ldflags@ -lmonosgen-@API_VER@ @libmono_ldflags@
|
||||
Cflags: -I${includedir} @libmono_cflags@
|
||||
@@ -474,15 +474,10 @@ private CodeDomProvider GetProvider(string langId)
|
||||
//
|
||||
// Document generation
|
||||
//
|
||||
class UTF8StringWriter : StringWriter {
|
||||
public override Encoding Encoding {
|
||||
get { return Encoding.UTF8; }
|
||||
}
|
||||
}
|
||||
|
||||
string GenerateDocument ()
|
||||
{
|
||||
UTF8StringWriter sw = new UTF8StringWriter ();
|
||||
StringWriter sw = new StringWriter ();
|
||||
|
||||
if (CurrentDocType == "wsdl")
|
||||
descriptions [CurrentDocInd].Write (sw);
|
||||
|
||||
@@ -84,10 +84,6 @@
|
||||
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.transactions" type="System.Transactions.Configuration.TransactionsSectionGroup, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
|
||||
<section name="defaultSettings" type="System.Transactions.Configuration.DefaultSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null"/>
|
||||
<section name="machineSettings" type="System.Transactions.Configuration.MachineSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/>
|
||||
</sectionGroup>
|
||||
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</configSections>
|
||||
|
||||
@@ -474,15 +474,10 @@ private CodeDomProvider GetProvider(string langId)
|
||||
//
|
||||
// Document generation
|
||||
//
|
||||
class UTF8StringWriter : StringWriter {
|
||||
public override Encoding Encoding {
|
||||
get { return Encoding.UTF8; }
|
||||
}
|
||||
}
|
||||
|
||||
string GenerateDocument ()
|
||||
{
|
||||
UTF8StringWriter sw = new UTF8StringWriter ();
|
||||
StringWriter sw = new StringWriter ();
|
||||
|
||||
if (CurrentDocType == "wsdl")
|
||||
descriptions [CurrentDocInd].Write (sw);
|
||||
|
||||
@@ -62,17 +62,6 @@
|
||||
</sectionGroup>
|
||||
<section name="monoSettings" type="System.Web.Configuration.MonoSettingsSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
|
||||
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
</sectionGroup>
|
||||
</sectionGroup>
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="connectionManagement" type="System.Net.Configuration.ConnectionManagementSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
@@ -94,13 +83,6 @@
|
||||
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="standardEndpoints" type="System.ServiceModel.Configuration.StandardEndpointsSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<section name="routing" type="System.ServiceModel.Routing.Configuration.RoutingSection, System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<section name="protocolMapping" type="System.ServiceModel.Configuration.ProtocolMappingSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.transactions" type="System.Transactions.Configuration.TransactionsSectionGroup, System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
|
||||
<section name="defaultSettings" type="System.Transactions.Configuration.DefaultSettingsSection, System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null"/>
|
||||
<section name="machineSettings" type="System.Transactions.Configuration.MachineSettingsSection, System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/>
|
||||
</sectionGroup>
|
||||
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
@@ -290,15 +272,6 @@
|
||||
<bindingExtensions>
|
||||
<add name="webHttpBinding" type="System.ServiceModel.Configuration.WebHttpBindingCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
</bindingExtensions>
|
||||
<endpointExtensions>
|
||||
<add name="dynamicEndpoint" type="System.ServiceModel.Discovery.Configuration.DynamicEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add name="discoveryEndpoint" type="System.ServiceModel.Discovery.Configuration.DiscoveryEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add name="udpDiscoveryEndpoint" type="System.ServiceModel.Discovery.Configuration.UdpDiscoveryEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add name="announcementEndpoint" type="System.ServiceModel.Discovery.Configuration.AnnouncementEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add name="udpAnnouncementEndpoint" type="System.ServiceModel.Discovery.Configuration.UdpAnnouncementEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add name="webHttpEndpoint" type="System.ServiceModel.Configuration.WebHttpEndpointCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add name="webScriptEndpoint" type="System.ServiceModel.Configuration.WebScriptEndpointCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
</endpointExtensions>
|
||||
</extensions>
|
||||
</system.serviceModel>
|
||||
</configuration>
|
||||
|
||||
@@ -19,4 +19,3 @@
|
||||
/config.h
|
||||
/config.status
|
||||
/INSTALL
|
||||
dolt*
|
||||
@@ -0,0 +1,8 @@
|
||||
set(SUBDIRS src test)
|
||||
|
||||
autoheader("config.h" null)
|
||||
|
||||
foreach(subdir ${SUBDIRS})
|
||||
add_subdirectory(${subdir})
|
||||
endforeach()
|
||||
|
||||
+1
-5
@@ -1,16 +1,12 @@
|
||||
if HOST_WIN32
|
||||
SUBDIRS = src
|
||||
else
|
||||
if PLATFORM_DARWIN
|
||||
SUBDIRS = src
|
||||
else
|
||||
if CROSS_COMPILING
|
||||
SUBDIRS = src
|
||||
else
|
||||
SUBDIRS = src test
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST = autogen.sh README NEWS AUTHORS ChangeLog winconfig.h
|
||||
EXTRA_DIST = autogen.sh README NEWS AUTHORS ChangeLog
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
dnl dolt, a replacement for libtool
|
||||
dnl Copyright © 2007-2008 Josh Triplett <[email protected]>
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
dnl
|
||||
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
|
||||
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
|
||||
dnl installed when running autoconf on your project.
|
||||
|
||||
AC_DEFUN([DOLT], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
# dolt, a replacement for libtool
|
||||
# Josh Triplett <[email protected]>
|
||||
AC_PATH_PROG(DOLT_BASH, bash)
|
||||
AC_MSG_CHECKING([if dolt supports this host])
|
||||
dolt_supported=yes
|
||||
if test x$DOLT_BASH = x; then
|
||||
dolt_supported=no
|
||||
fi
|
||||
if test x$GCC != xyes; then
|
||||
dolt_supported=no
|
||||
fi
|
||||
case $host in
|
||||
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
|
||||
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*)
|
||||
pic_options='-fPIC'
|
||||
;;
|
||||
?86-pc-cygwin*|i?86-pc-cygwin*)
|
||||
pic_options='-DDLL_EXPORT'
|
||||
;;
|
||||
i?86-apple-darwin*)
|
||||
pic_options='-fno-common'
|
||||
;;
|
||||
*)
|
||||
dolt_supported=no
|
||||
;;
|
||||
esac
|
||||
if test x$dolt_supported = xno ; then
|
||||
AC_MSG_RESULT([no, falling back to libtool])
|
||||
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
|
||||
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
|
||||
else
|
||||
AC_MSG_RESULT([yes, replacing libtool])
|
||||
|
||||
dnl Start writing out doltcompile.
|
||||
cat <<__DOLTCOMPILE__EOF__ >doltcompile
|
||||
#!$DOLT_BASH
|
||||
__DOLTCOMPILE__EOF__
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
args=("$[]@")
|
||||
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
|
||||
if test x"${args@<:@$arg@:>@}" = x-o ; then
|
||||
objarg=$((arg+1))
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$objarg = x ; then
|
||||
echo 'Error: no -o on compiler command line' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
lo="${args@<:@$objarg@:>@}"
|
||||
obj="${lo%.lo}"
|
||||
if test x"$lo" = x"$obj" ; then
|
||||
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
objbase="${obj##*/}"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
dnl Write out shared compilation code.
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
libobjdir="${obj%$objbase}.libs"
|
||||
if test ! -d "$libobjdir" ; then
|
||||
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
|
||||
mkdir_ret=$?
|
||||
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
|
||||
echo "$mkdir_out" 1>&2
|
||||
exit $mkdir_ret
|
||||
fi
|
||||
fi
|
||||
pic_object="$libobjdir/$objbase.o"
|
||||
args@<:@$objarg@:>@="$pic_object"
|
||||
__DOLTCOMPILE__EOF__
|
||||
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
|
||||
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
dnl Write out static compilation code.
|
||||
dnl Avoid duplicate compiler output if also building shared objects.
|
||||
if test x$enable_static = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
non_pic_object="$obj.o"
|
||||
args@<:@$objarg@:>@="$non_pic_object"
|
||||
__DOLTCOMPILE__EOF__
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
"${args@<:@@@:>@}" || exit $?
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Write out the code to write the .lo file.
|
||||
dnl The second line of the .lo file must match "^# Generated by .*libtool"
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
{
|
||||
echo "# $lo - a libtool object file"
|
||||
echo "# Generated by doltcompile, not libtool"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo "pic_object='.libs/${objbase}.o'"
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo pic_object=none
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
if test x$enable_static = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo "non_pic_object='${objbase}.o'"
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo non_pic_object=none
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
} > "$lo"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
dnl Done writing out doltcompile; substitute it for libtool compilation.
|
||||
chmod +x doltcompile
|
||||
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
|
||||
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
|
||||
|
||||
dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
|
||||
dnl a target, so write out a libtool wrapper to handle that case.
|
||||
dnl Note that doltlibtool does not handle inferred tags or option arguments
|
||||
dnl without '=', because automake does not use them.
|
||||
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
|
||||
#!$DOLT_BASH
|
||||
__DOLTLIBTOOL__EOF__
|
||||
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
|
||||
top_builddir_slash="${0%%doltlibtool}"
|
||||
: ${top_builddir_slash:=./}
|
||||
args=()
|
||||
modeok=false
|
||||
tagok=false
|
||||
for arg in "$[]@"; do
|
||||
case "$arg" in
|
||||
--mode=compile) modeok=true ;;
|
||||
--tag=CC|--tag=CXX) tagok=true ;;
|
||||
--quiet) ;;
|
||||
*) args@<:@${#args[@]}@:>@="$arg" ;;
|
||||
esac
|
||||
done
|
||||
if $modeok && $tagok ; then
|
||||
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
|
||||
else
|
||||
exec ${top_builddir_slash}libtool "$[]@"
|
||||
fi
|
||||
__DOLTLIBTOOL__EOF__
|
||||
|
||||
dnl Done writing out doltlibtool; substitute it for libtool.
|
||||
chmod +x doltlibtool
|
||||
LIBTOOL='$(top_builddir)/doltlibtool'
|
||||
fi
|
||||
AC_SUBST(LTCOMPILE)
|
||||
AC_SUBST(LTCXXCOMPILE)
|
||||
# end dolt
|
||||
])
|
||||
+5
-23
@@ -7,17 +7,16 @@ AM_MAINTAINER_MODE
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_LIBTOOL
|
||||
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
|
||||
DOLT
|
||||
CFLAGS="$CFLAGS -O0"
|
||||
CFLAGS="$CFLAGS -g -O0 -D_GNU_SOURCE"
|
||||
GNUC_PRETTY=
|
||||
GNUC_UNUSED=
|
||||
BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
|
||||
if test x$GCC = xyes; then
|
||||
GNUC_UNUSED='__attribute__((__unused__))'
|
||||
GNUC_NORETURN='__attribute__((__noreturn__))'
|
||||
case $host_cpu in
|
||||
i*86|x86_64) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
|
||||
echo target_cpu=$target_cpu
|
||||
case $target_cpu in
|
||||
i*86) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
|
||||
esac
|
||||
fi
|
||||
AC_SUBST(GNUC_PRETTY)
|
||||
@@ -34,25 +33,15 @@ if test "x$CFLAGS_FOR_EGLIB" != "x"; then
|
||||
CFLAGS=$CFLAGS_FOR_EGLIB
|
||||
fi
|
||||
|
||||
CFLAGS="$CFLAGS -g -D_GNU_SOURCE"
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
|
||||
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
|
||||
|
||||
platform_darwin=no
|
||||
|
||||
case $host in
|
||||
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
||||
PATHSEP='\\'
|
||||
SEARCHSEP=';'
|
||||
OS="WIN32"
|
||||
;;
|
||||
*-*darwin*)
|
||||
platform_darwin=yes
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
;;
|
||||
*)
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
@@ -86,7 +75,6 @@ AC_SUBST(SEARCHSEP)
|
||||
AC_SUBST(OS)
|
||||
AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
|
||||
AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
|
||||
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
@@ -94,10 +82,6 @@ AC_CHECK_FUNCS(strndup strlcpy getpwuid_r strtok_r rewinddir vasprintf)
|
||||
AM_CONDITIONAL(NEED_VASPRINTF, test x$have_vasprintf = x )
|
||||
AC_CHECK_LIB(iconv, iconv_open, LIBS="$LIBS -liconv")
|
||||
AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
|
||||
AC_CHECK_LIB(iconv, iconv_open, ICONV_LIBS="-liconv")
|
||||
AC_CHECK_LIB(iconv, libiconv_open, ICONV_LIBS="-liconv")
|
||||
AC_SUBST(ICONV_LIBS)
|
||||
LIBS="$LIBS $ICONV_LIBS"
|
||||
AC_SEARCH_LIBS(sqrtf, m)
|
||||
|
||||
# nanosleep may not be part of libc, also search it in other libraries
|
||||
@@ -126,9 +110,7 @@ if test "x$have_iso_varargs" = "xyes"; then
|
||||
fi
|
||||
AC_SUBST(G_HAVE_ISO_VARARGS)
|
||||
|
||||
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h)
|
||||
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
|
||||
AC_SUBST(HAVE_ALLOCA_H)
|
||||
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h)
|
||||
|
||||
if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
|
||||
GPOINTER_TO_INT="((gint)(long) (ptr))"
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
set(win_files
|
||||
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c
|
||||
gmodule-win32.c gtimer-win32.c)
|
||||
|
||||
set(unix_files
|
||||
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c
|
||||
gmodule-unix.c gtimer-unix.c)
|
||||
|
||||
if (MSVC)
|
||||
set(os_files ${win_files})
|
||||
else(MSVC)
|
||||
set(os_files ${unix_files})
|
||||
endif(MSVC)
|
||||
|
||||
set(libeglib_la_SOURCES
|
||||
${os_files}
|
||||
eglib-config.h
|
||||
sort.frag.h
|
||||
glib.h
|
||||
garray.c
|
||||
gerror.c
|
||||
ghashtable.c
|
||||
gmem.c
|
||||
gmodule.h
|
||||
goutput.c
|
||||
gstr.c
|
||||
gslist.c
|
||||
gstring.c
|
||||
gptrarray.c
|
||||
glist.c
|
||||
gqueue.c
|
||||
gpath.c
|
||||
gshell.c
|
||||
gspawn.c
|
||||
gfile.c
|
||||
gfile-posix.c
|
||||
gpattern.c
|
||||
gmarkup.c
|
||||
gutf8.c
|
||||
gunicode.c
|
||||
unicode-data.h)
|
||||
|
||||
set(EXTRA_DIST eglib-config.h.in eglib-config.hw ${win_files} ${unix_files})
|
||||
|
||||
INCLUDE_DIRECTORIES(../ ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
ADD_DEFINITIONS(${CFLAGS} -D_FORTIFY_SOURCE=2)
|
||||
ADD_LIBRARY(eglib-static STATIC ${libeglib_la_SOURCES})
|
||||
ADD_LIBRARY(eglib SHARED ${libeglib_la_SOURCES})
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
noinst_LTLIBRARIES = libeglib.la libeglib-static.la
|
||||
|
||||
win_files = \
|
||||
eglib-config.hw \
|
||||
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
|
||||
gmodule-win32.c gtimer-win32.c
|
||||
|
||||
@@ -24,11 +23,11 @@ os_files = $(unix_files)
|
||||
endif
|
||||
|
||||
libeglib_la_SOURCES = \
|
||||
eglib-config.h \
|
||||
eglib-remap.h \
|
||||
sort.frag.h \
|
||||
glib.h \
|
||||
garray.c \
|
||||
gbytearray.c \
|
||||
gerror.c \
|
||||
ghashtable.c \
|
||||
gmem.c \
|
||||
@@ -53,14 +52,14 @@ libeglib_la_SOURCES = \
|
||||
$(os_files) \
|
||||
$(vasprintf_files)
|
||||
|
||||
libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2
|
||||
libeglib_la_CFLAGS = -Wall -D_FORTIFY_SOURCE=2
|
||||
libeglib_static_la_SOURCES=$(libeglib_la_SOURCES)
|
||||
libeglib_static_la_CFLAGS = $(libeglib_la_CFLAGS)
|
||||
|
||||
INCLUDES = -I$(srcdir)
|
||||
|
||||
if HOST_WIN32
|
||||
libeglib_la_LIBADD = -lm $(ICONV_LIBS) -lpsapi
|
||||
libeglib_la_LIBADD = -lm -liconv -lpsapi
|
||||
endif
|
||||
|
||||
libeglib_static_la_LIBADD = $(libeglib_la_LIBADD)
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
#define GINT_TO_POINTER(v) @GINT_TO_POINTER@
|
||||
#define GUINT_TO_POINTER(v) @GUINT_TO_POINTER@
|
||||
|
||||
#if @HAVE_ALLOCA_H@ == 1
|
||||
#define G_HAVE_ALLOCA_H
|
||||
#endif
|
||||
|
||||
typedef unsigned @GSIZE@ gsize;
|
||||
typedef signed @GSIZE@ gssize;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#define g_array_append monoeg_g_array_append
|
||||
#define g_array_append_vals monoeg_g_array_append_vals
|
||||
#define g_array_free monoeg_g_array_free
|
||||
#define g_array_insert_vals monoeg_g_array_insert_vals
|
||||
@@ -21,7 +20,6 @@
|
||||
#define g_direct_hash monoeg_g_direct_hash
|
||||
#define g_error_free monoeg_g_error_free
|
||||
#define g_error_new monoeg_g_error_new
|
||||
#define g_error_vnew monoeg_g_error_vnew
|
||||
#define g_file_error_from_errno monoeg_g_file_error_from_errno
|
||||
#define g_file_get_contents monoeg_g_file_get_contents
|
||||
#define g_file_open_tmp monoeg_g_file_open_tmp
|
||||
@@ -53,9 +51,6 @@
|
||||
#define g_hash_table_remove monoeg_g_hash_table_remove
|
||||
#define g_hash_table_size monoeg_g_hash_table_size
|
||||
#define g_hash_table_print_stats monoeg_g_hash_table_print_stats
|
||||
#define g_hash_table_remove_all monoeg_g_hash_table_remove_all
|
||||
#define g_hash_table_iter_init monoeg_g_hash_table_iter_init
|
||||
#define g_hash_table_iter_next monoeg_g_hash_table_iter_next
|
||||
#define g_int_equal monoeg_g_int_equal
|
||||
#define g_int_hash monoeg_g_int_hash
|
||||
#define g_list_alloc monoeg_g_list_alloc
|
||||
@@ -121,7 +116,6 @@
|
||||
#define g_ptr_array_sort_with_data monoeg_g_ptr_array_sort_with_data
|
||||
#define g_queue_free monoeg_g_queue_free
|
||||
#define g_queue_is_empty monoeg_g_queue_is_empty
|
||||
#define g_queue_foreach monoeg_g_queue_foreach
|
||||
#define g_queue_new monoeg_g_queue_new
|
||||
#define g_queue_pop_head monoeg_g_queue_pop_head
|
||||
#define g_queue_push_head monoeg_g_queue_push_head
|
||||
@@ -225,11 +219,7 @@
|
||||
#define g_malloc0 monoeg_malloc0
|
||||
#define g_ptr_array_grow monoeg_ptr_array_grow
|
||||
#define g_realloc monoeg_realloc
|
||||
#define g_try_malloc monoeg_try_malloc
|
||||
#define g_try_realloc monoeg_try_realloc
|
||||
#define g_strdup monoeg_strdup
|
||||
#define g_ucs4_to_utf16_len monoeg_ucs4_to_utf16_len
|
||||
#define g_utf16_to_ucs4_len monoeg_utf16_to_ucs4_len
|
||||
#define g_byte_array_free monoeg_g_byte_array_free
|
||||
#define g_byte_array_new monoeg_g_byte_array_new
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
typedef struct {
|
||||
GArray array;
|
||||
gboolean clear_;
|
||||
guint element_size;
|
||||
gboolean element_size;
|
||||
gboolean zero_terminated;
|
||||
gint capacity;
|
||||
} GArrayPriv;
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Arrays
|
||||
*
|
||||
* Author:
|
||||
* Geoff Norton ([email protected])
|
||||
*
|
||||
* (C) 2010 Novell, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define INITIAL_CAPACITY 16
|
||||
|
||||
static void
|
||||
ensure_capacity (GByteArray *array,
|
||||
int capacity)
|
||||
{
|
||||
int new_capacity = MAX (array->len, INITIAL_CAPACITY);
|
||||
|
||||
if (capacity < array->len)
|
||||
return;
|
||||
|
||||
while (new_capacity < capacity) {
|
||||
new_capacity <<= 1;
|
||||
}
|
||||
capacity = new_capacity;
|
||||
array->data = (guint8*) g_realloc (array->data, capacity);
|
||||
|
||||
memset (array->data + array->len, 0, capacity - array->len);
|
||||
array->len = capacity;
|
||||
}
|
||||
|
||||
GByteArray *
|
||||
g_byte_array_new ()
|
||||
{
|
||||
GByteArray *rv = g_new0 (GByteArray, 1);
|
||||
|
||||
ensure_capacity (rv, INITIAL_CAPACITY);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
guint8*
|
||||
g_byte_array_free (GByteArray *array,
|
||||
gboolean free_segment)
|
||||
{
|
||||
guint8* rv = NULL;
|
||||
|
||||
g_return_val_if_fail (array != NULL, NULL);
|
||||
|
||||
if (free_segment)
|
||||
g_free (array->data);
|
||||
else
|
||||
rv = array->data;
|
||||
|
||||
g_free (array);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
GByteArray *
|
||||
g_array_append (GByteArray *array,
|
||||
guint8 *data,
|
||||
guint len)
|
||||
{
|
||||
g_return_val_if_fail (array != NULL, NULL);
|
||||
|
||||
ensure_capacity (array, array->len + len);
|
||||
|
||||
memmove (array->data + array->len, data, len);
|
||||
|
||||
array->len += len;
|
||||
|
||||
return array;
|
||||
}
|
||||
+17
-11
@@ -51,40 +51,46 @@ g_dir_open (const gchar *path, guint flags, GError **error)
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
dir = g_new0 (GDir, 1);
|
||||
path_utf16 = u8to16 (path);
|
||||
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
|
||||
wcscpy (path_utf16_search, path_utf16);
|
||||
wcscat (path_utf16_search, L"\\*");
|
||||
|
||||
dir->handle = FindFirstFileW (path_utf16_search, &find_data);
|
||||
path_utf16 = u8to16 (path);
|
||||
|
||||
dir->handle = FindFirstFile (path_utf16, &find_data);
|
||||
if (dir->handle == INVALID_HANDLE_VALUE) {
|
||||
if (error) {
|
||||
gint err = errno;
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
}
|
||||
g_free (path_utf16_search);
|
||||
g_free (path_utf16);
|
||||
g_free (dir);
|
||||
g_free (path_utf16);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* now get files */
|
||||
FindClose (dir->handle);
|
||||
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
|
||||
wcscpy (path_utf16_search, path_utf16);
|
||||
wcscat (path_utf16_search, L"\\*");
|
||||
|
||||
dir->handle = FindFirstFile (path_utf16_search, &find_data);
|
||||
g_free (path_utf16_search);
|
||||
g_free (path_utf16);
|
||||
|
||||
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
|
||||
if (!FindNextFileW (dir->handle, &find_data)) {
|
||||
if (!FindNextFile (dir->handle, &find_data)) {
|
||||
if (error) {
|
||||
gint err = errno;
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
}
|
||||
g_free (dir);
|
||||
g_free (path_utf16);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
dir->current = NULL;
|
||||
dir->next = u16to8 (find_data.cFileName);
|
||||
|
||||
g_free (path_utf16);
|
||||
return dir;
|
||||
}
|
||||
|
||||
@@ -107,7 +113,7 @@ g_dir_read_name (GDir *dir)
|
||||
dir->next = NULL;
|
||||
|
||||
do {
|
||||
if (!FindNextFileW (dir->handle, &find_data)) {
|
||||
if (!FindNextFile (dir->handle, &find_data)) {
|
||||
dir->next = NULL;
|
||||
return dir->current;
|
||||
}
|
||||
|
||||
+1
-15
@@ -47,20 +47,6 @@ g_error_new (gpointer domain, gint code, const char *format, ...)
|
||||
return err;
|
||||
}
|
||||
|
||||
static GError *
|
||||
g_error_vnew (gpointer domain, gint code, const char *format, va_list ap)
|
||||
{
|
||||
GError *err = g_new (GError, 1);
|
||||
|
||||
err->domain = domain;
|
||||
err->code = code;
|
||||
|
||||
if (vasprintf (&err->message, format, ap) == -1)
|
||||
err->message = g_strdup_printf ("internal: invalid format string %s", format);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void
|
||||
g_clear_error (GError **error)
|
||||
{
|
||||
@@ -86,7 +72,7 @@ g_set_error (GError **err, gpointer domain, gint code, const gchar *format, ...)
|
||||
|
||||
if (err) {
|
||||
va_start (args, format);
|
||||
*err = g_error_vnew (domain, code, format, args);
|
||||
*err = g_error_new (domain, code, format, args);
|
||||
va_end (args);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-66
@@ -51,12 +51,6 @@ struct _GHashTable {
|
||||
GDestroyNotify value_destroy_func, key_destroy_func;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
GHashTable *ht;
|
||||
int slot_index;
|
||||
Slot *slot;
|
||||
} Iter;
|
||||
|
||||
static const guint prime_tbl[] = {
|
||||
11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
|
||||
1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
|
||||
@@ -340,23 +334,6 @@ g_hash_table_find (GHashTable *hash, GHRFunc predicate, gpointer user_data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
g_hash_table_remove_all (GHashTable *hash)
|
||||
{
|
||||
int i;
|
||||
|
||||
g_return_if_fail (hash != NULL);
|
||||
|
||||
for (i = 0; i < hash->table_size; i++){
|
||||
Slot *s;
|
||||
|
||||
while (hash->table [i]) {
|
||||
s = hash->table [i];
|
||||
g_hash_table_remove (hash, s->key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_hash_table_remove (GHashTable *hash, gconstpointer key)
|
||||
{
|
||||
@@ -523,47 +500,6 @@ g_hash_table_print_stats (GHashTable *table)
|
||||
printf ("Size: %d Table Size: %d Max Chain Length: %d at %d\n", table->in_use, table->table_size, max_chain_size, max_chain_index);
|
||||
}
|
||||
|
||||
void
|
||||
g_hash_table_iter_init (GHashTableIter *it, GHashTable *hash_table)
|
||||
{
|
||||
Iter *iter = (Iter*)it;
|
||||
|
||||
memset (iter, 0, sizeof (Iter));
|
||||
iter->ht = hash_table;
|
||||
iter->slot_index = -1;
|
||||
}
|
||||
|
||||
gboolean g_hash_table_iter_next (GHashTableIter *it, gpointer *key, gpointer *value)
|
||||
{
|
||||
Iter *iter = (Iter*)it;
|
||||
|
||||
GHashTable *hash = iter->ht;
|
||||
|
||||
g_assert (iter->slot_index != -2);
|
||||
g_assert (sizeof (Iter) <= sizeof (GHashTableIter));
|
||||
|
||||
if (!iter->slot) {
|
||||
while (TRUE) {
|
||||
iter->slot_index ++;
|
||||
if (iter->slot_index >= hash->table_size) {
|
||||
iter->slot_index = -2;
|
||||
return FALSE;
|
||||
}
|
||||
if (hash->table [iter->slot_index])
|
||||
break;
|
||||
}
|
||||
iter->slot = hash->table [iter->slot_index];
|
||||
}
|
||||
|
||||
if (key)
|
||||
*key = iter->slot->key;
|
||||
if (value)
|
||||
*value = iter->slot->value;
|
||||
iter->slot = iter->slot->next;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_direct_equal (gconstpointer v1, gconstpointer v2)
|
||||
{
|
||||
@@ -579,13 +515,13 @@ g_direct_hash (gconstpointer v1)
|
||||
gboolean
|
||||
g_int_equal (gconstpointer v1, gconstpointer v2)
|
||||
{
|
||||
return *(gint *)v1 == *(gint *)v2;
|
||||
return GPOINTER_TO_INT (v1) == GPOINTER_TO_INT (v2);
|
||||
}
|
||||
|
||||
guint
|
||||
g_int_hash (gconstpointer v1)
|
||||
{
|
||||
return *(guint *)v1;
|
||||
return GPOINTER_TO_UINT(v1);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
||||
+6
-56
@@ -16,10 +16,6 @@
|
||||
/* For pid_t */
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -28,10 +24,6 @@
|
||||
#include <eglib-remap.h>
|
||||
#endif
|
||||
|
||||
#ifdef G_HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
|
||||
#ifndef offsetof
|
||||
# define offsetof(s_name,n_name) (size_t)(char *)&(((s_name*)0)->m_name)
|
||||
#endif
|
||||
@@ -93,6 +85,7 @@ typedef int32_t gboolean;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macros
|
||||
*/
|
||||
@@ -130,11 +123,11 @@ typedef int32_t gboolean;
|
||||
* Allocation
|
||||
*/
|
||||
void g_free (void *ptr);
|
||||
gpointer g_realloc (gpointer obj, gsize size);
|
||||
gpointer g_malloc (gsize x);
|
||||
gpointer g_malloc0 (gsize x);
|
||||
gpointer g_try_malloc (gsize x);
|
||||
gpointer g_try_realloc (gpointer obj, gsize size);
|
||||
static inline gpointer g_realloc (gpointer obj, gsize size) { if (!size) {g_free (obj); return 0;} return realloc (obj, size);}
|
||||
static inline gpointer g_malloc (gsize x) {if (x) return malloc (x); else return 0;}
|
||||
static inline gpointer g_malloc0 (gsize x) {if (x) return calloc(1,x); else return 0;}
|
||||
#define g_try_malloc(x) g_malloc(x)
|
||||
#define g_try_realloc(obj,size) g_realloc((obj),(size))
|
||||
|
||||
#define g_new(type,size) ((type *) g_malloc (sizeof (type) * (size)))
|
||||
#define g_new0(type,size) ((type *) g_malloc0 (sizeof (type)* (size)))
|
||||
@@ -185,14 +178,6 @@ gchar* g_win32_getlocale(void);
|
||||
* Hashtables
|
||||
*/
|
||||
typedef struct _GHashTable GHashTable;
|
||||
typedef struct _GHashTableIter GHashTableIter;
|
||||
|
||||
/* Private, but needed for stack allocation */
|
||||
struct _GHashTableIter
|
||||
{
|
||||
gpointer dummy [8];
|
||||
};
|
||||
|
||||
typedef void (*GFunc) (gpointer data, gpointer user_data);
|
||||
typedef gint (*GCompareFunc) (gconstpointer a, gconstpointer b);
|
||||
typedef gint (*GCompareDataFunc) (gconstpointer a, gconstpointer b, gpointer user_data);
|
||||
@@ -213,15 +198,11 @@ gboolean g_hash_table_lookup_extended (GHashTable *hash, gconstpointer ke
|
||||
void g_hash_table_foreach (GHashTable *hash, GHFunc func, gpointer user_data);
|
||||
gpointer g_hash_table_find (GHashTable *hash, GHRFunc predicate, gpointer user_data);
|
||||
gboolean g_hash_table_remove (GHashTable *hash, gconstpointer key);
|
||||
void g_hash_table_remove_all (GHashTable *hash);
|
||||
guint g_hash_table_foreach_remove (GHashTable *hash, GHRFunc func, gpointer user_data);
|
||||
guint g_hash_table_foreach_steal (GHashTable *hash, GHRFunc func, gpointer user_data);
|
||||
void g_hash_table_destroy (GHashTable *hash);
|
||||
void g_hash_table_print_stats (GHashTable *table);
|
||||
|
||||
void g_hash_table_iter_init (GHashTableIter *iter, GHashTable *hash_table);
|
||||
gboolean g_hash_table_iter_next (GHashTableIter *iter, gpointer *key, gpointer *value);
|
||||
|
||||
guint g_spaced_primes_closest (guint x);
|
||||
|
||||
#define g_hash_table_insert(h,k,v) g_hash_table_insert_replace ((h),(k),(v),FALSE)
|
||||
@@ -453,20 +434,6 @@ GList *g_list_insert_before (GList *list,
|
||||
GList *g_list_sort (GList *sort,
|
||||
GCompareFunc func);
|
||||
|
||||
/*
|
||||
* ByteArray
|
||||
*/
|
||||
|
||||
typedef struct _GByteArray GByteArray;
|
||||
struct _GByteArray {
|
||||
guint8 *data;
|
||||
gint len;
|
||||
};
|
||||
|
||||
GByteArray *g_byte_array_new (void);
|
||||
GByteArray* g_byte_array_append (GByteArray *array, const guint8 *data, guint len);
|
||||
guint8* g_byte_array_free (GByteArray *array, gboolean free_segment);
|
||||
|
||||
/*
|
||||
* Array
|
||||
*/
|
||||
@@ -529,7 +496,6 @@ void g_queue_push_tail (GQueue *queue,
|
||||
gboolean g_queue_is_empty (GQueue *queue);
|
||||
GQueue *g_queue_new (void);
|
||||
void g_queue_free (GQueue *queue);
|
||||
void g_queue_foreach (GQueue *queue, GFunc func, gpointer user_data);
|
||||
|
||||
/*
|
||||
* Messages
|
||||
@@ -576,8 +542,6 @@ void g_assertion_message (const gchar *format, ...) G_GNUC_NORETURN
|
||||
#endif /* ndef HAVE_C99_SUPPORT */
|
||||
#define g_log_set_handler(a,b,c,d)
|
||||
|
||||
#define G_GNUC_INTERNAL
|
||||
|
||||
/*
|
||||
* Conversions
|
||||
*/
|
||||
@@ -927,30 +891,16 @@ glong g_utf8_strlen (const gchar *str, gssize max);
|
||||
# define GUINT16_TO_LE(x) (x)
|
||||
# define GUINT_TO_LE(x) (x)
|
||||
# define GUINT32_TO_BE(x) GUINT32_SWAP_LE_BE(x)
|
||||
# define GUINT16_FROM_BE(x) GUINT16_SWAP_LE_BE(x)
|
||||
# define GUINT32_FROM_BE(x) GUINT32_SWAP_LE_BE(x)
|
||||
# define GUINT64_FROM_BE(x) GUINT64_SWAP_LE_BE(x)
|
||||
# define GINT16_FROM_BE(x) GUINT16_SWAP_LE_BE(x)
|
||||
# define GINT32_FROM_BE(x) GUINT32_SWAP_LE_BE(x)
|
||||
# define GINT64_FROM_BE(x) GUINT64_SWAP_LE_BE(x)
|
||||
#else
|
||||
# define GUINT32_TO_LE(x) GUINT32_SWAP_LE_BE(x)
|
||||
# define GUINT64_TO_LE(x) GUINT64_SWAP_LE_BE(x)
|
||||
# define GUINT16_TO_LE(x) GUINT16_SWAP_LE_BE(x)
|
||||
# define GUINT_TO_LE(x) GUINT32_SWAP_LE_BE(x)
|
||||
# define GUINT32_TO_BE(x) (x)
|
||||
# define GUINT16_FROM_BE(x) (x)
|
||||
# define GUINT32_FROM_BE(x) (x)
|
||||
# define GUINT64_FROM_BE(x) (x)
|
||||
# define GINT16_FROM_BE(x) (x)
|
||||
# define GINT32_FROM_BE(x) (x)
|
||||
# define GINT64_FROM_BE(x) (x)
|
||||
#endif
|
||||
|
||||
#define GINT64_FROM_LE(x) (GUINT64_TO_LE (x))
|
||||
#define GINT32_FROM_LE(x) (GUINT32_TO_LE (x))
|
||||
#define GINT16_FROM_LE(x) (GUINT16_TO_LE (x))
|
||||
|
||||
#define GUINT32_FROM_LE(x) (GUINT32_TO_LE (x))
|
||||
#define GUINT64_FROM_LE(x) (GUINT64_TO_LE (x))
|
||||
#define GUINT16_FROM_LE(x) (GUINT16_TO_LE (x))
|
||||
|
||||
@@ -51,55 +51,3 @@ g_memdup (gconstpointer mem, guint byte_size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
gpointer g_realloc (gpointer obj, gsize size)
|
||||
{
|
||||
gpointer ptr;
|
||||
if (!size) {
|
||||
g_free (obj);
|
||||
return 0;
|
||||
}
|
||||
ptr = realloc (obj, size);
|
||||
if (ptr)
|
||||
return ptr;
|
||||
g_error ("Could not allocate %i bytes", size);
|
||||
}
|
||||
|
||||
gpointer
|
||||
g_malloc (gsize x)
|
||||
{
|
||||
gpointer ptr;
|
||||
if (!x)
|
||||
return 0;
|
||||
ptr = malloc (x);
|
||||
if (ptr)
|
||||
return ptr;
|
||||
g_error ("Could not allocate %i bytes", x);
|
||||
}
|
||||
|
||||
gpointer g_malloc0 (gsize x)
|
||||
{
|
||||
gpointer ptr;
|
||||
if (!x)
|
||||
return 0;
|
||||
ptr = calloc(1,x);
|
||||
if (ptr)
|
||||
return ptr;
|
||||
g_error ("Could not allocate %i bytes", x);
|
||||
}
|
||||
|
||||
gpointer g_try_malloc (gsize x)
|
||||
{
|
||||
if (x)
|
||||
return malloc (x);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
gpointer g_try_realloc (gpointer obj, gsize size)
|
||||
{
|
||||
if (!size) {
|
||||
g_free (obj);
|
||||
return 0;
|
||||
}
|
||||
return realloc (obj, size);
|
||||
}
|
||||
+21
-39
@@ -72,57 +72,39 @@ g_path_is_absolute (const char *filename)
|
||||
return (*filename == '/');
|
||||
}
|
||||
|
||||
static pthread_mutex_t pw_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t home_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static const gchar *home_dir;
|
||||
static const gchar *user_name;
|
||||
|
||||
static void
|
||||
get_pw_data (void)
|
||||
{
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
struct passwd pw;
|
||||
struct passwd *result;
|
||||
char buf [4096];
|
||||
#endif
|
||||
|
||||
if (user_name != NULL)
|
||||
return;
|
||||
|
||||
pthread_mutex_lock (&pw_lock);
|
||||
if (user_name != NULL) {
|
||||
pthread_mutex_unlock (&pw_lock);
|
||||
return;
|
||||
}
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
|
||||
home_dir = g_strdup (pw.pw_dir);
|
||||
user_name = g_strdup (pw.pw_name);
|
||||
}
|
||||
#endif
|
||||
if (home_dir == NULL)
|
||||
home_dir = g_getenv ("HOME");
|
||||
|
||||
if (user_name == NULL) {
|
||||
user_name = g_getenv ("USER");
|
||||
if (user_name == NULL)
|
||||
user_name = "somebody";
|
||||
}
|
||||
pthread_mutex_unlock (&pw_lock);
|
||||
}
|
||||
|
||||
/* Give preference to /etc/passwd than HOME */
|
||||
const gchar *
|
||||
g_get_home_dir (void)
|
||||
{
|
||||
get_pw_data ();
|
||||
if (home_dir == NULL){
|
||||
pthread_mutex_lock (&home_lock);
|
||||
if (home_dir == NULL){
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
struct passwd pw;
|
||||
struct passwd *result;
|
||||
char buf [4096];
|
||||
|
||||
if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0)
|
||||
home_dir = g_strdup (pw.pw_dir);
|
||||
#endif
|
||||
if (home_dir == NULL)
|
||||
home_dir = g_getenv ("HOME");
|
||||
}
|
||||
pthread_mutex_unlock (&home_lock);
|
||||
}
|
||||
return home_dir;
|
||||
}
|
||||
|
||||
const char *
|
||||
g_get_user_name (void)
|
||||
{
|
||||
get_pw_data ();
|
||||
return user_name;
|
||||
const char *retName = g_getenv ("USER");
|
||||
if (!retName)
|
||||
retName = "somebody";
|
||||
return retName;
|
||||
}
|
||||
|
||||
static const char *tmp_dir;
|
||||
|
||||
+1
-1
@@ -153,6 +153,6 @@ g_assertion_message (const gchar *format, ...)
|
||||
va_start (args, format);
|
||||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
|
||||
va_end (args);
|
||||
abort ();
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -105,9 +105,3 @@ g_queue_free (GQueue *queue)
|
||||
g_list_free (queue->head);
|
||||
g_free (queue);
|
||||
}
|
||||
|
||||
void
|
||||
g_queue_foreach (GQueue *queue, GFunc func, gpointer user_data)
|
||||
{
|
||||
g_list_foreach (queue->head, func, user_data);
|
||||
}
|
||||
+3
-6
@@ -33,7 +33,7 @@ split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
|
||||
{
|
||||
gchar *ptr;
|
||||
gchar c;
|
||||
gboolean escaped = FALSE, fresh = TRUE;
|
||||
gboolean escaped = FALSE;
|
||||
gchar quote_char = '\0';
|
||||
GString *str;
|
||||
|
||||
@@ -57,10 +57,8 @@ split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
|
||||
} else if (quote_char) {
|
||||
if (c == quote_char) {
|
||||
quote_char = '\0';
|
||||
if (fresh && g_ascii_isspace (*ptr)){
|
||||
g_ptr_array_add (array, g_string_free (str, FALSE));
|
||||
str = g_string_new ("");
|
||||
}
|
||||
g_ptr_array_add (array, g_string_free (str, FALSE));
|
||||
str = g_string_new ("");
|
||||
} else if (c == '\\'){
|
||||
escaped = TRUE;
|
||||
} else
|
||||
@@ -73,7 +71,6 @@ split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
|
||||
} else if (c == '\\') {
|
||||
escaped = TRUE;
|
||||
} else if (c == '\'' || c == '"') {
|
||||
fresh = str->len == 0;
|
||||
quote_char = c;
|
||||
} else {
|
||||
g_string_append_c (str, c);
|
||||
|
||||
@@ -69,10 +69,6 @@ g_strdupv (gchar **str_array)
|
||||
guint length;
|
||||
gchar **ret;
|
||||
guint i;
|
||||
|
||||
if (!str_array)
|
||||
return NULL;
|
||||
|
||||
length = g_strv_length(str_array);
|
||||
ret = g_new0(gchar *, length + 1);
|
||||
for (i = 0; str_array[i]; i++) {
|
||||
|
||||
+3
-10
@@ -53,9 +53,6 @@
|
||||
# ifdef HAVE_ICONV_H
|
||||
# include <iconv.h>
|
||||
# endif
|
||||
# ifdef HAVE_LOCALCHARSET_H
|
||||
# include <localcharset.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static char *my_charset;
|
||||
@@ -220,10 +217,8 @@ g_convert (const gchar *str, gssize len,
|
||||
|
||||
convertor = iconv_open (to_codeset, from_codeset);
|
||||
if (convertor == (iconv_t) -1){
|
||||
if (bytes_written)
|
||||
*bytes_written = 0;
|
||||
if (bytes_read)
|
||||
*bytes_read = 0;
|
||||
*bytes_written = 0;
|
||||
*bytes_read = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -308,9 +303,7 @@ g_get_charset (G_CONST_RETURN char **charset)
|
||||
#else
|
||||
if (my_charset == NULL){
|
||||
/* These shouldn't be heap allocated */
|
||||
#if HAVE_LOCALCHARSET_H
|
||||
my_charset = locale_charset ();
|
||||
#elif defined(HAVE_LANGINFO_H)
|
||||
#if HAVE_LANGINFO_H
|
||||
my_charset = nl_langinfo (CODESET);
|
||||
#else
|
||||
my_charset = "UTF-8";
|
||||
|
||||
+3
-10
@@ -65,7 +65,7 @@ utf8_to_utf16_len (const gchar *str, glong len, glong *items_read, GError **erro
|
||||
glong in_pos, ret;
|
||||
|
||||
if (len < 0)
|
||||
len = (glong) strlen (str);
|
||||
len = strlen (str);
|
||||
|
||||
in_pos = 0;
|
||||
ret = 0;
|
||||
@@ -74,11 +74,8 @@ utf8_to_utf16_len (const gchar *str, glong len, glong *items_read, GError **erro
|
||||
for (in_pos = 0; in_pos < len && str [in_pos] < 0x80; in_pos++)
|
||||
ret ++;
|
||||
|
||||
if (in_pos == len) {
|
||||
if (items_read)
|
||||
*items_read = in_pos;
|
||||
if (in_pos == len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
mb_size = 0;
|
||||
mb_remain = 0;
|
||||
@@ -215,10 +212,8 @@ g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_wr
|
||||
*error = NULL;
|
||||
|
||||
if (len < 0)
|
||||
len = (glong) strlen (str);
|
||||
len = strlen (str);
|
||||
|
||||
if (items_read)
|
||||
*items_read = 0;
|
||||
if (items_written)
|
||||
*items_written = 0;
|
||||
utf16_len = utf8_to_utf16_len (str, len, items_read, error);
|
||||
@@ -316,8 +311,6 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
|
||||
out_pos = 0;
|
||||
surrogate = FALSE;
|
||||
|
||||
if (items_read)
|
||||
*items_read = 0;
|
||||
if (items_written)
|
||||
*items_written = 0;
|
||||
utf8_len = utf16_to_utf8_len (str, len, items_read, error);
|
||||
|
||||
@@ -9,7 +9,7 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
|
||||
size_t buflen;
|
||||
va_list ap2;
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
|
||||
#ifdef _MSC_VER
|
||||
ap2 = ap;
|
||||
len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
|
||||
#else
|
||||
|
||||
@@ -29,7 +29,7 @@ SOURCES = \
|
||||
|
||||
test_eglib_SOURCES = $(SOURCES)
|
||||
|
||||
test_eglib_CFLAGS = -Wall -D_FORTIFY_SOURCE=2 -I$(srcdir)/../src -I../src -DDRIVER_NAME=\"EGlib\"
|
||||
test_eglib_CFLAGS = -Wall -Werror -D_FORTIFY_SOURCE=2 -I$(srcdir)/../src -I../src -DDRIVER_NAME=\"EGlib\"
|
||||
test_eglib_LDADD = ../src/libeglib.la
|
||||
|
||||
run-eglib: all
|
||||
|
||||
@@ -131,45 +131,12 @@ RESULT hash_grow (void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RESULT hash_iter (void)
|
||||
{
|
||||
#if !defined(GLIB_MAJOR_VERSION) || GLIB_CHECK_VERSION(2, 16, 0)
|
||||
GHashTable *hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
|
||||
GHashTableIter iter;
|
||||
int i, sum, keys_sum, values_sum;
|
||||
gpointer key, value;
|
||||
|
||||
sum = 0;
|
||||
for (i = 0; i < 1000; i++) {
|
||||
sum += i;
|
||||
g_hash_table_insert (hash, GUINT_TO_POINTER (i), GUINT_TO_POINTER (i));
|
||||
}
|
||||
|
||||
keys_sum = values_sum = 0;
|
||||
g_hash_table_iter_init (&iter, hash);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||
if (key != value)
|
||||
return FAILED ("key != value");
|
||||
keys_sum += GPOINTER_TO_UINT (key);
|
||||
values_sum += GPOINTER_TO_UINT (value);
|
||||
}
|
||||
if (keys_sum != sum || values_sum != sum)
|
||||
return FAILED ("Did not find all key-value pairs");
|
||||
g_hash_table_destroy (hash);
|
||||
return NULL;
|
||||
#else
|
||||
/* GHashTableIter was added in glib 2.16 */
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static Test hashtable_tests [] = {
|
||||
{"t1", hash_t1},
|
||||
{"t2", hash_t2},
|
||||
{"grow", hash_grow},
|
||||
{"default", hash_default},
|
||||
{"null_lookup", hash_null_lookup},
|
||||
{"iter", hash_iter},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
+14
-59
@@ -55,7 +55,7 @@ test_shell_argv1 ()
|
||||
if (!ret)
|
||||
return FAILED ("11. It should return TRUE");
|
||||
if (argc != 2)
|
||||
return FAILED ("12. argc was %d expected 2", argc);
|
||||
return FAILED ("12. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("13. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "bola"))
|
||||
@@ -72,7 +72,7 @@ test_shell_argv1 ()
|
||||
if (!ret)
|
||||
return FAILED ("16. It should return TRUE");
|
||||
if (argc != 3)
|
||||
return FAILED ("17. argc was %d expected 3", argc);
|
||||
return FAILED ("17. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("18. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], ""))
|
||||
@@ -85,19 +85,6 @@ test_shell_argv1 ()
|
||||
g_strfreev (argv);
|
||||
argv = NULL;
|
||||
argc = 0;
|
||||
error = NULL;
|
||||
ret = g_shell_parse_argv ("hola'' bola", &argc, &argv, &error);
|
||||
if (!ret)
|
||||
return FAILED ("21. It should return TRUE");
|
||||
if (argc != 2)
|
||||
return FAILED ("22. argc was %d expected 2", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("23. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "bola"))
|
||||
return FAILED ("24. argv[2] was %s", argv [1]);
|
||||
if (error != NULL)
|
||||
return FAILED ("25. error is not null");
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -116,7 +103,7 @@ test_shell_argv2 ()
|
||||
if (!ret)
|
||||
return FAILED ("1. It should return TRUE");
|
||||
if (argc != 2)
|
||||
return FAILED ("2. argc was %d expected 2", argc);
|
||||
return FAILED ("2. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("3. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "bola"))
|
||||
@@ -132,7 +119,7 @@ test_shell_argv2 ()
|
||||
if (!ret)
|
||||
return FAILED ("6. It should return TRUE");
|
||||
if (argc != 3)
|
||||
return FAILED ("7. argc was %d expected 3", argc);
|
||||
return FAILED ("7. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("8. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], ""))
|
||||
@@ -150,7 +137,7 @@ test_shell_argv2 ()
|
||||
if (!ret)
|
||||
return FAILED ("10. It should return TRUE");
|
||||
if (argc != 3)
|
||||
return FAILED ("11. argc was %d expected 3", argc);
|
||||
return FAILED ("11. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("12. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "\t"))
|
||||
@@ -168,7 +155,7 @@ test_shell_argv2 ()
|
||||
if (!ret)
|
||||
return FAILED ("16. It should return TRUE");
|
||||
if (argc != 3)
|
||||
return FAILED ("17. argc was %d expected 3", argc);
|
||||
return FAILED ("17. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("18. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "\t"))
|
||||
@@ -197,7 +184,7 @@ test_shell_argv3 ()
|
||||
if (ret)
|
||||
return FAILED ("1. It should return FALSE");
|
||||
if (argc != 0)
|
||||
return FAILED ("2. argc was %d expected 0", argc);
|
||||
return FAILED ("2. argc was %d", argc);
|
||||
if (argv != NULL)
|
||||
return FAILED ("3. argv[0] was %s", argv [0]);
|
||||
if (error == NULL)
|
||||
@@ -210,7 +197,7 @@ test_shell_argv3 ()
|
||||
if (!ret)
|
||||
return FAILED ("5. It should return TRUE");
|
||||
if (argc != 2)
|
||||
return FAILED ("6. argc was %d expected 2", argc);
|
||||
return FAILED ("6. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("18. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "\"bola"))
|
||||
@@ -225,7 +212,7 @@ test_shell_argv3 ()
|
||||
if (!ret)
|
||||
return FAILED ("9. It should return TRUE. %s", error->message);
|
||||
if (argc != 2)
|
||||
return FAILED ("10. argc was %d expected 2", argc);
|
||||
return FAILED ("10. argc was %d", argc);
|
||||
if (strcmp (argv [0], "hola"))
|
||||
return FAILED ("11. argv[0] was %s", argv [0]);
|
||||
if (strcmp (argv [1], "\n\\'bola"))
|
||||
@@ -256,7 +243,7 @@ test_shell_argv4 ()
|
||||
if (!ret)
|
||||
return FAILED ("1. It should return TRUE");
|
||||
if (argc != 3)
|
||||
return FAILED ("2. argc was %d expected 3", argc);
|
||||
return FAILED ("2. argc was %d", argc);
|
||||
if (argv == NULL)
|
||||
return FAILED ("3. argv[0] was NULL");
|
||||
if (error != NULL)
|
||||
@@ -272,37 +259,6 @@ test_shell_argv4 ()
|
||||
return OK;
|
||||
}
|
||||
|
||||
// This is https://bugzilla.novell.com/show_bug.cgi?id=655896
|
||||
RESULT
|
||||
test_shell_argv5 ()
|
||||
{
|
||||
GError *error;
|
||||
gint argc;
|
||||
gchar **argv;
|
||||
gboolean ret;
|
||||
char *str = "echo \"foo\",\"bar\"";
|
||||
|
||||
argv = NULL;
|
||||
argc = 0;
|
||||
error = NULL;
|
||||
ret = g_shell_parse_argv (str, &argc, &argv, &error);
|
||||
if (!ret)
|
||||
return FAILED ("1. It should return TRUE");
|
||||
if (argc != 2)
|
||||
return FAILED ("2. argc was %d expected 2", argc);
|
||||
if (argv == NULL)
|
||||
return FAILED ("3. argv[0] was NULL");
|
||||
if (error != NULL)
|
||||
return FAILED ("4. error was set");
|
||||
|
||||
if (strcmp (argv [0], "echo"))
|
||||
return FAILED ("5. Expected echo got %s", argv [0]);
|
||||
if (strcmp (argv [1], "foo,bar"))
|
||||
return FAILED ("6. Expected foo,bar, got: %s", argv [1]);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
RESULT
|
||||
test_quote ()
|
||||
{
|
||||
@@ -318,11 +274,10 @@ test_quote ()
|
||||
}
|
||||
|
||||
static Test shell_tests [] = {
|
||||
{"test_shell_argv1", test_shell_argv1},
|
||||
{"test_shell_argv2", test_shell_argv2},
|
||||
{"test_shell_argv3", test_shell_argv3},
|
||||
{"test_shell_argv4", test_shell_argv4},
|
||||
{"test_shell_argv5", test_shell_argv5},
|
||||
{"g_shell_parse_argv1", test_shell_argv1},
|
||||
{"g_shell_parse_argv2", test_shell_argv2},
|
||||
{"g_shell_parse_argv3", test_shell_argv3},
|
||||
{"g_shell_parse_argv4", test_shell_argv4},
|
||||
{"g_shell_quote", test_quote},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -621,30 +621,6 @@ test_ascii_strdown ()
|
||||
return OK;
|
||||
}
|
||||
|
||||
RESULT
|
||||
test_strdupv ()
|
||||
{
|
||||
gchar **one;
|
||||
gchar **two;
|
||||
gint len;
|
||||
|
||||
one = g_strdupv (NULL);
|
||||
if (one)
|
||||
return FAILED ("Should have been NULL");
|
||||
|
||||
one = g_malloc (sizeof (gchar *));
|
||||
*one = NULL;
|
||||
two = g_strdupv (one);
|
||||
if (!two)
|
||||
FAILED ("Should have been not NULL");
|
||||
len = g_strv_length (two);
|
||||
if (len)
|
||||
FAILED ("Should have been 0");
|
||||
g_strfreev (two);
|
||||
g_strfreev (one);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Test strutil_tests [] = {
|
||||
{"g_strfreev", test_strfreev},
|
||||
{"g_strconcat", test_concat},
|
||||
@@ -663,7 +639,6 @@ static Test strutil_tests [] = {
|
||||
{"g_strescape", test_strescape},
|
||||
{"g_ascii_strncasecmp", test_ascii_strncasecmp },
|
||||
{"g_ascii_strdown", test_ascii_strdown },
|
||||
{"g_strdupv", test_strdupv },
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
ADD_DEFINITIONS(${GMODULE_CFLAGS})
|
||||
ADD_LIBRARY(ikvm_native SHARED jni.c os.c jni.h)
|
||||
TARGET_LINK_LIBRARIES(ikvm_native ${GMODULE_LIBS})
|
||||
@@ -22,4 +22,3 @@
|
||||
/autom4te.cache
|
||||
/libgc-mono.pc
|
||||
/libgc-mono-*.tar.gz
|
||||
dolt*
|
||||
@@ -0,0 +1,196 @@
|
||||
# based on configure.in/Makefile.am, which is:
|
||||
|
||||
# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
|
||||
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
||||
#
|
||||
# Permission is hereby granted to use or copy this program
|
||||
# for any purpose, provided the above notices are retained on all copies.
|
||||
# Permission to modify the code and to distribute modified code is granted,
|
||||
# provided the above notices are retained, and a notice that the code was
|
||||
# modified is included with the above copyright notice.
|
||||
#
|
||||
# Original author: Tom Tromey
|
||||
# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
|
||||
|
||||
# This is in sync with the configure.in/Makefile.am at r135583
|
||||
|
||||
#
|
||||
# This is a cmake build file for libgc
|
||||
# Only the functionality needed by mono is supported
|
||||
#
|
||||
|
||||
# FIXME:
|
||||
add_definitions("-g -O2")
|
||||
|
||||
set(THREADS ${libgc_threads})
|
||||
|
||||
set(THREADDLLIBS "")
|
||||
|
||||
if (THREADS STREQUAL "no" OR THREADS STREQUAL "none" OR THREADS STREQUAL "single")
|
||||
set(THREADS none)
|
||||
endif()
|
||||
|
||||
if (THREADS STREQUAL "posix" OR THREADS STREQUAL "pthreads")
|
||||
set(THREADS posix)
|
||||
set(THREADDLLIBS "-lpthread")
|
||||
if (${host} MATCHES "x86-.*-linux.*|ia64-.*-linux.*|i386-.*-linux.*|i486-.*-linux.*|i586-.*-linux.*|i686-.*-linux.*|x86_64-.*-linux.*|alpha.*-.*-linux.*|s390.*-.*-linux.*|sparc.*-.*-linux.*|powerpc-.*-linux.*")
|
||||
add_definitions(-DGC_LINUX_THREADS -D_REENTRANT)
|
||||
set(parallel_mark_supported yes)
|
||||
add_definitions(-DTHREAD_LOCAL_ALLOC)
|
||||
elseif(${host} MATCHES ".*-linux.*")
|
||||
add_definitions(-DGC_LINUX_THREADS -D_REENTRANT)
|
||||
elseif(${host} MATCHES ".*-aix.*")
|
||||
add_definitions(-DGC_AIX_THREADS -D_REENTRANT)
|
||||
elseif(${host} MATCHES ".*-hpux.*")
|
||||
message("Only HP/UX 11 threads are supported.")
|
||||
add_definitions(-DGC_HPUX_THREADS -D_REENTRANT -D_POSIX_C_SOURCE=199506L)
|
||||
add_definitions(-DTHREAD_LOCAL_ALLOC)
|
||||
set(parallel_mark_supported yes)
|
||||
set(THREADDLLIBS "-lpthread -lrt")
|
||||
elseif(${host} ".*-.*-freebsd.*")
|
||||
add_definitions(-DGC_FREEBSD_THREADS)
|
||||
message(FATAL_ERROR "todo")
|
||||
### if test "x$PTHREAD_CFLAGS" != "x"; then
|
||||
### INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
|
||||
### fi
|
||||
### if test "x$PTHREAD_LIBS" = "x"; then
|
||||
### THREADDLLIBS=-pthread
|
||||
### else
|
||||
### THREADDLLIBS="$PTHREAD_LIBS"
|
||||
### fi
|
||||
elseif(${host} ".*-.*-freebsd.*")
|
||||
add_definitions(-DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS)
|
||||
elseif(${host} ".*-.*-irix.*")
|
||||
add_definitions(-DGC_IRIX_THREADS)
|
||||
elseif(${host} ".*-.*-cygwin.*")
|
||||
add_definitons(-DGC_WIN32_THREADS)
|
||||
elseif(${host} ".*-.*-darwin.*")
|
||||
add_definitons(-DGC_DARWIN_THREADS -DTHREAD_LOCAL_ALLOC)
|
||||
set(parallel_mark_supported yes)
|
||||
elseif(${host} ".*-.*-netbsd.*")
|
||||
add_definitions(-DGC_NETBSD_THREADS -DTHREAD_LOCAL_ALLOC)
|
||||
set(parallel_mark_supported yes)
|
||||
elseif(${host} ".*-.*-osf.*")
|
||||
add_definitions(GC_OSF1_THREADS -DTHREAD_LOCAL_ALLOC)
|
||||
set(parallel_mark_supported yes)
|
||||
add_definitions(-pthread)
|
||||
set(THREADDLLIBS "-lpthread -lrt")
|
||||
else()
|
||||
message(FATAL_ERROR "Pthreads not supported by the GC on this platform.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(THREADS STREQUAL "win32")
|
||||
add_definitions(GC_WIN32_THREADS)
|
||||
# Wine getenv may not return NULL for missing entry
|
||||
add_definitions(NO_GETENV)
|
||||
if (enable_win32_dllmain)
|
||||
add_definitions(gc_inside_dll)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${host} MATCHES "powerpc-.*-darwin.*")
|
||||
set(powerpc_darwin yes)
|
||||
endif()
|
||||
|
||||
if(parallel_mark_supported AND enable_parallel_mark)
|
||||
add_definitions("-DPARALLEL_MARK")
|
||||
endif()
|
||||
|
||||
# Configuration of machine-dependent code
|
||||
|
||||
ac_msg_checking("which machine-dependent code should be used")
|
||||
|
||||
###AC_MSG_CHECKING(
|
||||
###machdep=
|
||||
###case "$host" in
|
||||
### alpha-*-openbsd*)
|
||||
### machdep="alpha_mach_dep.lo"
|
||||
### if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
|
||||
### AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
|
||||
### fi
|
||||
### ;;
|
||||
### alpha*-*-linux*)
|
||||
### machdep="alpha_mach_dep.lo"
|
||||
### ;;
|
||||
### i?86-*-solaris2.[[89]]|i?86-*-solaris2.1?)
|
||||
### AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
|
||||
### ;;
|
||||
### mipstx39-*-elf*)
|
||||
### machdep="mips_ultrix_mach_dep.lo"
|
||||
### AC_DEFINE(STACKBASE, __stackbase)
|
||||
### AC_DEFINE(DATASTART_IS_ETEXT)
|
||||
### ;;
|
||||
### mips-dec-ultrix*)
|
||||
### machdep="mips_ultrix_mach-dep.lo"
|
||||
### ;;
|
||||
### mips-nec-sysv*|mips-unknown-sysv*)
|
||||
### ;;
|
||||
### mips*-*-linux*)
|
||||
### ;;
|
||||
### mips-*-*)
|
||||
### machdep="mips_sgi_mach_dep.lo"
|
||||
### AC_DEFINE(NO_EXECUTE_PERMISSION)
|
||||
### ;;
|
||||
### sparc-*-netbsd*)
|
||||
### machdep="sparc_netbsd_mach_dep.lo"
|
||||
### ;;
|
||||
### sparc-sun-solaris2.3)
|
||||
### machdep="sparc_mach_dep.lo"
|
||||
### AC_DEFINE(SUNOS53_SHARED_LIB)
|
||||
### ;;
|
||||
### sparc*-sun-solaris2.*)
|
||||
### machdep="sparc_mach_dep.lo"
|
||||
### ;;
|
||||
### ia64-*-*)
|
||||
### machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
|
||||
### ;;
|
||||
###esac
|
||||
if(NOT machdep)
|
||||
set(machdep "mach_dep.c")
|
||||
endif()
|
||||
ac_msg_result("${machdep}")
|
||||
|
||||
ac_msg_checking("for threads package to use")
|
||||
ac_msg_result("${THREADS}")
|
||||
|
||||
# Include defines that have become de facto standard.
|
||||
# ALL_INTERIOR_POINTERS can be overridden in startup code.
|
||||
add_definitions(-DSILENT -DNO_SIGNALS -DNO_EXECUTE_PERMISSION)
|
||||
# AC_DEFINE(ALL_INTERIOR_POINTERS)
|
||||
|
||||
# By default, make the library as general as possible.
|
||||
add_definitions(-DJAVA_FINALIZATION -DGC_GCJ_SUPPORT -DATOMIC_UNCOLLECTABLE)
|
||||
|
||||
add_definitions(-D_IN_LIBGC)
|
||||
|
||||
set(SUBDIRS include doc)
|
||||
|
||||
foreach(dir ${SUBDIRS})
|
||||
add_subdirectory(${dir})
|
||||
endforeach()
|
||||
|
||||
set(top_srcdir ../)
|
||||
|
||||
# .. is needed for mono/utils/mono-compiler.h
|
||||
INCLUDE_DIRECTORIES(. .. include)
|
||||
add_definitions(${CPPFLAGS})
|
||||
|
||||
if(powerpc_darwin)
|
||||
set(asm_libgc_sources powerpc_darwin_mach_dep.s)
|
||||
endif()
|
||||
|
||||
set(libmonogc_la_SOURCES
|
||||
allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c
|
||||
dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c
|
||||
malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c
|
||||
obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c
|
||||
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c
|
||||
backgraph.c win32_threads.c
|
||||
pthread_support.c pthread_stop_world.c darwin_stop_world.c
|
||||
${asm_libgc_sources} ${machdep})
|
||||
|
||||
add_library(monogc-static STATIC ${libmonogc_la_SOURCES})
|
||||
target_link_libraries (${THREADDLLIBS} ${UNWINDLIBS})
|
||||
+7
-9
@@ -36,10 +36,8 @@ EXTRA_DIST =
|
||||
|
||||
if POWERPC_DARWIN
|
||||
asm_libgc_sources = powerpc_darwin_mach_dep.s
|
||||
endif
|
||||
|
||||
if TARGET_IA64
|
||||
asm_libgc_sources = ia64_save_regs_in_stack.s
|
||||
else
|
||||
asm_libgc_sources =
|
||||
endif
|
||||
|
||||
libmonogc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
|
||||
@@ -49,12 +47,12 @@ obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
|
||||
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
|
||||
backgraph.c win32_threads.c \
|
||||
pthread_support.c pthread_stop_world.c darwin_stop_world.c \
|
||||
openbsd_stop_world.c mach_dep.c $(asm_libgc_sources)
|
||||
$(asm_libgc_sources)
|
||||
|
||||
# Include THREADDLLIBS here to ensure that the correct versions of
|
||||
# linuxthread semaphore functions get linked:
|
||||
libmonogc_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
|
||||
libmonogc_la_DEPENDENCIES =
|
||||
libmonogc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
|
||||
libmonogc_la_DEPENDENCIES = @addobjs@
|
||||
libmonogc_la_LDFLAGS = -version-info 1:2:0
|
||||
|
||||
EXTRA_libmonogc_la_SOURCES = alpha_mach_dep.S \
|
||||
@@ -95,7 +93,7 @@ endif
|
||||
#TESTS = gctest $(extra_checks)
|
||||
|
||||
## FIXME: relies on internal code generated by automake.
|
||||
all_objs = $(libgc_la_OBJECTS)
|
||||
all_objs = @addobjs@ $(libgc_la_OBJECTS)
|
||||
$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
|
||||
include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h
|
||||
|
||||
@@ -115,7 +113,7 @@ endif
|
||||
|
||||
## We have our own definition of LTCOMPILE because we want to use our
|
||||
## CFLAGS, not those passed in from the top level make.
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(INCLUDES) \
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \
|
||||
-I$(top_srcdir)/include $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS)
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
+43
-177
@@ -1,181 +1,47 @@
|
||||
dnl dolt, a replacement for libtool
|
||||
dnl Copyright © 2007-2008 Josh Triplett <[email protected]>
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
dnl
|
||||
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
|
||||
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
|
||||
dnl installed when running autoconf on your project.
|
||||
#
|
||||
#
|
||||
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
|
||||
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
||||
#
|
||||
# Permission is hereby granted to use or copy this program
|
||||
# for any purpose, provided the above notices are retained on all copies.
|
||||
# Permission to modify the code and to distribute modified code is granted,
|
||||
# provided the above notices are retained, and a notice that the code was
|
||||
# modified is included with the above copyright notice.
|
||||
#
|
||||
# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
|
||||
|
||||
AC_DEFUN([DOLT], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
# dolt, a replacement for libtool
|
||||
# Josh Triplett <[email protected]>
|
||||
AC_PATH_PROG(DOLT_BASH, bash)
|
||||
AC_MSG_CHECKING([if dolt supports this host])
|
||||
dolt_supported=yes
|
||||
if test x$DOLT_BASH = x; then
|
||||
dolt_supported=no
|
||||
fi
|
||||
if test x$GCC != xyes; then
|
||||
dolt_supported=no
|
||||
fi
|
||||
case $host in
|
||||
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
|
||||
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*)
|
||||
pic_options='-fPIC'
|
||||
;;
|
||||
?86-pc-cygwin*|i?86-pc-cygwin*)
|
||||
pic_options='-DDLL_EXPORT'
|
||||
;;
|
||||
i?86-apple-darwin*)
|
||||
pic_options='-fno-common'
|
||||
;;
|
||||
*)
|
||||
dolt_supported=no
|
||||
;;
|
||||
esac
|
||||
if test x$dolt_supported = xno ; then
|
||||
AC_MSG_RESULT([no, falling back to libtool])
|
||||
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
|
||||
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
|
||||
else
|
||||
AC_MSG_RESULT([yes, replacing libtool])
|
||||
# GC_SET_VERSION
|
||||
# sets and AC_DEFINEs GC_VERSION_MAJOR, GC_VERSION_MINOR and GC_ALPHA_VERSION
|
||||
# based on the contents of PACKAGE_VERSION; PACKAGE_VERSION must conform to
|
||||
# [0-9]+[.][0-9]+(alpha[0.9]+)?
|
||||
# in lex syntax; if there is no alpha number, GC_ALPHA_VERSION is empty
|
||||
#
|
||||
AC_DEFUN(GC_SET_VERSION, [
|
||||
AC_MSG_CHECKING(GC version numbers)
|
||||
GC_VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\([[0-9]][[0-9]]*\)[[.]].*$/\1/g'`
|
||||
GC_VERSION_MINOR=`echo $PACKAGE_VERSION | sed 's/^[[^.]]*[[.]]\([[0-9]][[0-9]]*\).*$/\1/g'`
|
||||
GC_ALPHA_VERSION=`echo $PACKAGE_VERSION | sed 's/^[[^.]]*[[.]][[0-9]]*//'`
|
||||
|
||||
dnl Start writing out doltcompile.
|
||||
cat <<__DOLTCOMPILE__EOF__ >doltcompile
|
||||
#!$DOLT_BASH
|
||||
__DOLTCOMPILE__EOF__
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
args=("$[]@")
|
||||
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
|
||||
if test x"${args@<:@$arg@:>@}" = x-o ; then
|
||||
objarg=$((arg+1))
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$objarg = x ; then
|
||||
echo 'Error: no -o on compiler command line' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
lo="${args@<:@$objarg@:>@}"
|
||||
obj="${lo%.lo}"
|
||||
if test x"$lo" = x"$obj" ; then
|
||||
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
objbase="${obj##*/}"
|
||||
__DOLTCOMPILE__EOF__
|
||||
case "$GC_ALPHA_VERSION" in
|
||||
alpha*)
|
||||
GC_ALPHA_VERSION=`echo $GC_ALPHA_VERSION \
|
||||
| sed 's/alpha\([[0-9]][[0-9]]*\)/\1/'` ;;
|
||||
*) GC_ALPHA_MAJOR='' ;;
|
||||
esac
|
||||
|
||||
dnl Write out shared compilation code.
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
libobjdir="${obj%$objbase}.libs"
|
||||
if test ! -d "$libobjdir" ; then
|
||||
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
|
||||
mkdir_ret=$?
|
||||
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
|
||||
echo "$mkdir_out" 1>&2
|
||||
exit $mkdir_ret
|
||||
fi
|
||||
fi
|
||||
pic_object="$libobjdir/$objbase.o"
|
||||
args@<:@$objarg@:>@="$pic_object"
|
||||
__DOLTCOMPILE__EOF__
|
||||
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
|
||||
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
dnl Write out static compilation code.
|
||||
dnl Avoid duplicate compiler output if also building shared objects.
|
||||
if test x$enable_static = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
non_pic_object="$obj.o"
|
||||
args@<:@$objarg@:>@="$non_pic_object"
|
||||
__DOLTCOMPILE__EOF__
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
"${args@<:@@@:>@}" || exit $?
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Write out the code to write the .lo file.
|
||||
dnl The second line of the .lo file must match "^# Generated by .*libtool"
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
{
|
||||
echo "# $lo - a libtool object file"
|
||||
echo "# Generated by doltcompile, not libtool"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo "pic_object='.libs/${objbase}.o'"
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo pic_object=none
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
if test x$enable_static = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo "non_pic_object='${objbase}.o'"
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo non_pic_object=none
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
} > "$lo"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
dnl Done writing out doltcompile; substitute it for libtool compilation.
|
||||
chmod +x doltcompile
|
||||
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
|
||||
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
|
||||
|
||||
dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
|
||||
dnl a target, so write out a libtool wrapper to handle that case.
|
||||
dnl Note that doltlibtool does not handle inferred tags or option arguments
|
||||
dnl without '=', because automake does not use them.
|
||||
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
|
||||
#!$DOLT_BASH
|
||||
__DOLTLIBTOOL__EOF__
|
||||
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
|
||||
top_builddir_slash="${0%%doltlibtool}"
|
||||
: ${top_builddir_slash:=./}
|
||||
args=()
|
||||
modeok=false
|
||||
tagok=false
|
||||
for arg in "$[]@"; do
|
||||
case "$arg" in
|
||||
--mode=compile) modeok=true ;;
|
||||
--tag=CC|--tag=CXX) tagok=true ;;
|
||||
--quiet) ;;
|
||||
*) args@<:@${#args[@]}@:>@="$arg" ;;
|
||||
esac
|
||||
done
|
||||
if $modeok && $tagok ; then
|
||||
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
|
||||
else
|
||||
exec ${top_builddir_slash}libtool "$[]@"
|
||||
fi
|
||||
__DOLTLIBTOOL__EOF__
|
||||
|
||||
dnl Done writing out doltlibtool; substitute it for libtool.
|
||||
chmod +x doltlibtool
|
||||
LIBTOOL='$(top_builddir)/doltlibtool'
|
||||
fi
|
||||
AC_SUBST(LTCOMPILE)
|
||||
AC_SUBST(LTCXXCOMPILE)
|
||||
# end dolt
|
||||
if test :$GC_VERSION_MAJOR: = :: \
|
||||
-o :$GC_VERSION_MINOR: = :: ;
|
||||
then
|
||||
AC_MSG_RESULT(invalid)
|
||||
AC_MSG_ERROR([nonconforming PACKAGE_VERSION='$PACKAGE_VERSION'])
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(GC_VERSION_MAJOR, $GC_VERSION_MAJOR)
|
||||
AC_DEFINE_UNQUOTED(GC_VERSION_MINOR, $GC_VERSION_MINOR)
|
||||
if test :$GC_ALPHA_VERSION: != :: ; then
|
||||
AC_DEFINE_UNQUOTED(GC_ALPHA_VERSION, $GC_ALPHA_VERSION)
|
||||
fi
|
||||
AC_MSG_RESULT(major=$GC_VERSION_MAJOR minor=$GC_VERSION_MINOR \
|
||||
${GC_ALPHA_VERSION:+alpha=}$GC_ALPHA_VERSION)
|
||||
])
|
||||
+3
-23
@@ -94,7 +94,7 @@ case "$THREADS" in
|
||||
fi
|
||||
AC_DEFINE(THREAD_LOCAL_ALLOC)
|
||||
;;
|
||||
*-*-linux* | *-*-nacl*)
|
||||
*-*-linux*)
|
||||
AC_DEFINE(GC_LINUX_THREADS)
|
||||
AC_DEFINE(_REENTRANT)
|
||||
;;
|
||||
@@ -147,13 +147,6 @@ case "$THREADS" in
|
||||
fi
|
||||
AC_DEFINE(THREAD_LOCAL_ALLOC)
|
||||
;;
|
||||
*-*-openbsd*)
|
||||
AC_DEFINE(GC_OPENBSD_THREADS)
|
||||
if test "${enable_parallel_mark}" = yes; then
|
||||
AC_DEFINE(PARALLEL_MARK)
|
||||
fi
|
||||
AC_DEFINE(THREAD_LOCAL_ALLOC)
|
||||
;;
|
||||
*-*-osf*)
|
||||
AC_DEFINE(GC_OSF1_THREADS)
|
||||
if test "${enable_parallel_mark}" = yes; then
|
||||
@@ -337,11 +330,7 @@ case "$host" in
|
||||
machdep="sparc_mach_dep.lo"
|
||||
;;
|
||||
ia64-*-*)
|
||||
machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
|
||||
target_ia64=true
|
||||
;;
|
||||
*-*-nacl*)
|
||||
AC_DEFINE(NO_EXECUTE_PERMISSION)
|
||||
machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
|
||||
;;
|
||||
esac
|
||||
if test x"$machdep" = x; then
|
||||
@@ -349,21 +338,12 @@ AC_MSG_RESULT($machdep)
|
||||
machdep="mach_dep.lo"
|
||||
fi
|
||||
addobjs="$addobjs $machdep"
|
||||
#
|
||||
# Adding object files directly to _LIBADD breaks -j builds, so we need to add the sources
|
||||
# instead, but _SOURCES can't contain autoconf substitutions, so add them using automake
|
||||
# conditionals.
|
||||
#
|
||||
#AC_SUBST(addobjs)
|
||||
AC_SUBST(addobjs)
|
||||
AC_SUBST(addincludes)
|
||||
AC_SUBST(addlibs)
|
||||
AC_SUBST(addtests)
|
||||
|
||||
AM_CONDITIONAL(TARGET_IA64,test x$target_ia64 = xtrue)
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
|
||||
DOLT
|
||||
|
||||
#
|
||||
# Check for AViiON Machines running DGUX
|
||||
|
||||
+1
-8
@@ -57,7 +57,6 @@
|
||||
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
|
||||
!defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
|
||||
!(defined(FREEBSD) && defined(__ELF__)) && \
|
||||
!(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
|
||||
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
|
||||
!defined(DARWIN)
|
||||
--> We only know how to find data segments of dynamic libraries for the
|
||||
@@ -93,12 +92,9 @@
|
||||
|
||||
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
|
||||
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
|
||||
(defined(OPENBSD) && defined(__ELF__)) || \
|
||||
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
|
||||
# include <stddef.h>
|
||||
# if !defined(OPENBSD)
|
||||
# include <elf.h>
|
||||
# endif
|
||||
# include <link.h>
|
||||
#endif
|
||||
|
||||
@@ -299,7 +295,6 @@ void GC_register_dynamic_libraries()
|
||||
|
||||
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
|
||||
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
|
||||
(defined(OPENBSD) && defined(__ELF__)) || \
|
||||
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
|
||||
|
||||
|
||||
@@ -478,10 +473,8 @@ GC_bool GC_register_main_static_data()
|
||||
/* This doesn't necessarily work in all cases, e.g. with preloaded
|
||||
* dynamic libraries. */
|
||||
|
||||
#if defined(NETBSD) || defined(OPENBSD)
|
||||
# if !defined(OPENBSD)
|
||||
#if defined(NETBSD)
|
||||
# include <sys/exec_elf.h>
|
||||
# endif
|
||||
/* for compatibility with 1.4.x */
|
||||
# ifndef DT_DEBUG
|
||||
# define DT_DEBUG 21
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "private/gc_priv.h"
|
||||
|
||||
# if defined(DYNAMIC_LOADING) && (defined(GC_PTHREADS) && !defined(GC_DARWIN_THREADS)) \
|
||||
# if (defined(GC_PTHREADS) && !defined(GC_DARWIN_THREADS)) \
|
||||
|| defined(GC_SOLARIS_THREADS)
|
||||
|
||||
# if defined(dlopen) && !defined(GC_USE_LD_WRAP)
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
|
||||
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
|
||||
defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
|
||||
defined(GC_OPENBSD_THREADS) || \
|
||||
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
|
||||
# define GC_PTHREADS
|
||||
# endif
|
||||
@@ -88,10 +87,6 @@
|
||||
# define GC_DARWIN_THREADS
|
||||
# define GC_PTHREADS
|
||||
# endif
|
||||
# if !defined(GC_PTHREADS) && defined(__OpenBSD__)
|
||||
# define GC_OPENBSD_THREADS
|
||||
# define GC_PTHREADS
|
||||
# endif
|
||||
# if !defined(GC_PTHREADS) && defined(__FreeBSD__)
|
||||
# define GC_FREEBSD_THREADS
|
||||
# define GC_PTHREADS
|
||||
|
||||
@@ -59,11 +59,6 @@
|
||||
#endif
|
||||
int GC_pthread_join(pthread_t thread, void **retval);
|
||||
int GC_pthread_detach(pthread_t thread);
|
||||
#if defined(__native_client__) || defined(NACL)
|
||||
void GC_pthread_exit(void *status);
|
||||
# undef pthread_exit
|
||||
# define pthread_exit GC_pthread_exit
|
||||
#endif
|
||||
|
||||
#if defined(GC_OSF1_THREADS) \
|
||||
&& defined(_PTHREAD_USE_MANGLED_NAMES_) && !defined(_PTHREAD_USE_PTDNAM_)
|
||||
|
||||
@@ -1962,8 +1962,6 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
|
||||
/* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
|
||||
* It is aliased to SIGLOST in asm/signal.h, though. */
|
||||
# define SIG_SUSPEND SIGLOST
|
||||
# elif defined(NACL)
|
||||
# define SIG_SUSPEND 0
|
||||
# else
|
||||
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
|
||||
# define SIG_SUSPEND SIGPWR
|
||||
|
||||
@@ -65,11 +65,6 @@
|
||||
# endif
|
||||
|
||||
/* Determine the machine type: */
|
||||
# if defined(__native_client__)
|
||||
# define NACL
|
||||
# define I386
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(__arm__) || defined(__thumb__)
|
||||
# define ARM32
|
||||
# if !defined(LINUX) && !defined(NETBSD) && !defined(DARWIN)
|
||||
@@ -236,10 +231,6 @@
|
||||
# define I386
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(OPENBSD) && defined(__amd64__)
|
||||
# define X86_64
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(LINUX) && defined(__x86_64__)
|
||||
# define X86_64
|
||||
# define mach_type_known
|
||||
@@ -1091,19 +1082,13 @@
|
||||
# endif
|
||||
|
||||
# ifdef I386
|
||||
# if defined( NACL )
|
||||
# define MACH_TYPE "NACL"
|
||||
# define MACH_TYPE "I386"
|
||||
# if defined(__LP64__) || defined(_WIN64)
|
||||
# define CPP_WORDSZ 64
|
||||
# define ALIGNMENT 8
|
||||
# else
|
||||
# define CPP_WORDSZ 32
|
||||
# define ALIGNMENT 4
|
||||
# else
|
||||
# define MACH_TYPE "I386"
|
||||
# if defined(__LP64__) || defined(_WIN64)
|
||||
# define CPP_WORDSZ 64
|
||||
# define ALIGNMENT 8
|
||||
# else
|
||||
# define CPP_WORDSZ 32
|
||||
# define ALIGNMENT 4
|
||||
# endif
|
||||
/* Appears to hold for all "32 bit" compilers */
|
||||
/* except Borland. The -a4 option fixes */
|
||||
/* Borland. */
|
||||
@@ -1199,32 +1184,7 @@
|
||||
# define HEAP_START DATAEND
|
||||
# endif /* USE_MMAP */
|
||||
# endif /* DGUX */
|
||||
# ifdef NACL
|
||||
# define OS_TYPE "NACL"
|
||||
extern int etext[];
|
||||
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
|
||||
extern int _end[];
|
||||
# define DATAEND (_end)
|
||||
# ifdef STACK_GRAN
|
||||
# undef STACK_GRAN
|
||||
# endif /* STACK_GRAN */
|
||||
# define STACK_GRAN 0x10000
|
||||
# define HEURISTIC1
|
||||
# ifdef USE_MMAP
|
||||
# undef USE_MMAP
|
||||
# endif
|
||||
# ifdef USE_MUNMAP
|
||||
# undef USE_MUNMAP
|
||||
# endif
|
||||
# ifdef USE_MMAP_ANON
|
||||
# undef USE_MMAP_ANON
|
||||
# endif
|
||||
# ifdef USE_MMAP_FIXED
|
||||
# undef USE_MMAP_FIXED
|
||||
# endif
|
||||
# define GETPAGESIZE() 65536
|
||||
# define MAX_NACL_GC_THREADS 1024
|
||||
# endif
|
||||
|
||||
# ifdef LINUX
|
||||
# ifndef __GNUC__
|
||||
/* The Intel compiler doesn't like inline assembly */
|
||||
@@ -1344,18 +1304,6 @@
|
||||
# endif
|
||||
# ifdef OPENBSD
|
||||
# define OS_TYPE "OPENBSD"
|
||||
# ifdef GC_OPENBSD_THREADS
|
||||
# define UTHREAD_SP_OFFSET 192
|
||||
# else
|
||||
# include <sys/param.h>
|
||||
# include <uvm/uvm_extern.h>
|
||||
# define STACKBOTTOM USRSTACK
|
||||
# endif
|
||||
extern int __data_start[];
|
||||
# define DATASTART ((ptr_t)(__data_start))
|
||||
extern char _end[];
|
||||
# define DATAEND ((ptr_t)(&_end))
|
||||
# define DYNAMIC_LOADING
|
||||
# endif
|
||||
# ifdef FREEBSD
|
||||
# define OS_TYPE "FREEBSD"
|
||||
@@ -2138,22 +2086,6 @@
|
||||
extern char etext[];
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# endif
|
||||
# ifdef OPENBSD
|
||||
# define OS_TYPE "OPENBSD"
|
||||
# define ELF_CLASS ELFCLASS64
|
||||
# ifdef GC_OPENBSD_THREADS
|
||||
# define UTHREAD_SP_OFFSET 400
|
||||
# else
|
||||
# include <sys/param.h>
|
||||
# include <uvm/uvm_extern.h>
|
||||
# define STACKBOTTOM USRSTACK
|
||||
# endif
|
||||
extern int __data_start[];
|
||||
# define DATASTART ((ptr_t)(__data_start))
|
||||
extern char _end[];
|
||||
# define DATAEND ((ptr_t)(&_end))
|
||||
# define DYNAMIC_LOADING
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#if defined(LINUX) && defined(USE_MMAP)
|
||||
@@ -2307,7 +2239,7 @@
|
||||
# if defined(GC_IRIX_THREADS) && !defined(IRIX5)
|
||||
--> inconsistent configuration
|
||||
# endif
|
||||
# if defined(GC_LINUX_THREADS) && !(defined(LINUX) || defined(NACL))
|
||||
# if defined(GC_LINUX_THREADS) && !defined(LINUX)
|
||||
--> inconsistent configuration
|
||||
# endif
|
||||
# if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef GC_OPENBSD_STOP_WORLD_H
|
||||
#define GC_OPENBSD_STOP_WORLD_H
|
||||
|
||||
#if !defined(GC_OPENBSD_THREADS)
|
||||
#error openbsd_stop_world.h included without GC_OPENBSD_THREADS defined
|
||||
#endif
|
||||
|
||||
struct thread_stop_info {
|
||||
ptr_t stack_ptr; /* Valid only when stopped. */
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -7,15 +7,6 @@ struct thread_stop_info {
|
||||
/* last successfully handled a suspend */
|
||||
/* signal. */
|
||||
ptr_t stack_ptr; /* Valid only when stopped. */
|
||||
#ifdef NACL
|
||||
/* Grab NACL_GC_REG_STORAGE_SIZE pointers off the stack when going into */
|
||||
/* a syscall. 20 is more than we need, but it's an overestimate in case*/
|
||||
/* the instrumented function uses any callee saved registers, they may */
|
||||
/* be pushed to the stack much earlier. Also, on amd64 'push' puts 8 */
|
||||
/* bytes on the stack even though our pointers are 4 bytes. */
|
||||
#define NACL_GC_REG_STORAGE_SIZE 20
|
||||
ptr_t reg_storage[NACL_GC_REG_STORAGE_SIZE];
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#if defined(GC_DARWIN_THREADS)
|
||||
# include "private/darwin_stop_world.h"
|
||||
#elif defined(GC_OPENBSD_THREADS)
|
||||
# include "private/openbsd_stop_world.h"
|
||||
#else
|
||||
# include "private/pthread_stop_world.h"
|
||||
#endif
|
||||
@@ -28,9 +26,6 @@ typedef struct GC_Thread_Rep {
|
||||
/* guaranteed to be dead, but we may */
|
||||
/* not yet have registered the join.) */
|
||||
pthread_t id;
|
||||
#ifdef PLATFORM_ANDROID
|
||||
pid_t kernel_id;
|
||||
#endif
|
||||
/* Extra bookkeeping information the stopping code uses */
|
||||
struct thread_stop_info stop_info;
|
||||
|
||||
@@ -92,9 +87,6 @@ typedef struct GC_Thread_Rep {
|
||||
|
||||
# define THREAD_TABLE_SZ 128 /* Must be power of 2 */
|
||||
extern volatile GC_thread GC_threads[THREAD_TABLE_SZ];
|
||||
#ifdef NACL
|
||||
extern __thread GC_thread gc_thread_self;
|
||||
#endif
|
||||
|
||||
extern GC_bool GC_thr_initialized;
|
||||
|
||||
|
||||
+1
-1
@@ -492,7 +492,7 @@ ptr_t cold_gc_frame;
|
||||
/* the stack. Return sp. */
|
||||
# ifdef SPARC
|
||||
asm(" .seg \"text\"");
|
||||
# if defined(SVR4) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)
|
||||
# if defined(SVR4) || defined(NETBSD) || defined(FREEBSD)
|
||||
asm(" .globl GC_save_regs_in_stack");
|
||||
asm("GC_save_regs_in_stack:");
|
||||
asm(" .type GC_save_regs_in_stack,#function");
|
||||
|
||||
+2
-2
@@ -473,7 +473,7 @@ size_t GC_get_total_bytes GC_PROTO(())
|
||||
|
||||
int GC_get_suspend_signal GC_PROTO(())
|
||||
{
|
||||
#if defined(SIG_SUSPEND) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS) && !defined(GC_OPENBSD_THREADS)
|
||||
#if defined(SIG_SUSPEND) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS)
|
||||
return SIG_SUSPEND;
|
||||
#else
|
||||
return -1;
|
||||
@@ -684,7 +684,7 @@ void GC_init_inner()
|
||||
# if defined(SEARCH_FOR_DATA_START)
|
||||
GC_init_linux_data_start();
|
||||
# endif
|
||||
# if defined(NETBSD) && defined(__ELF__)
|
||||
# if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
|
||||
GC_init_netbsd_elf();
|
||||
# endif
|
||||
# if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
#include "private/pthread_support.h"
|
||||
|
||||
/* derived from pthread_stop_world.c */
|
||||
|
||||
# if defined(GC_OPENBSD_THREADS)
|
||||
|
||||
#define THREAD_EQUAL(id1, id2) pthread_equal(id1, id2)
|
||||
|
||||
/* We hold allocation lock. Should do exactly the right thing if the */
|
||||
/* world is stopped. Should not fail if it isn't. */
|
||||
void GC_push_all_stacks()
|
||||
{
|
||||
GC_bool found_me = FALSE;
|
||||
size_t nthreads = 0;
|
||||
int i;
|
||||
GC_thread p;
|
||||
ptr_t lo, hi;
|
||||
pthread_t me = pthread_self();
|
||||
|
||||
if (!GC_thr_initialized) GC_thr_init();
|
||||
# if DEBUG_THREADS
|
||||
GC_printf("Pushing stacks from thread 0x%x\n", (unsigned) me);
|
||||
# endif
|
||||
for (i = 0; i < THREAD_TABLE_SZ; i++) {
|
||||
for (p = GC_threads[i]; p != 0; p = p -> next) {
|
||||
if (p -> flags & FINISHED) continue;
|
||||
++nthreads;
|
||||
if (THREAD_EQUAL(p -> id, me)) {
|
||||
# ifdef SPARC
|
||||
lo = (ptr_t)GC_save_regs_in_stack();
|
||||
# else
|
||||
lo = GC_approx_sp();
|
||||
# endif
|
||||
found_me = TRUE;
|
||||
} else {
|
||||
lo = p -> stop_info.stack_ptr;
|
||||
}
|
||||
if ((p -> flags & MAIN_THREAD) == 0) {
|
||||
hi = p -> stack_end;
|
||||
} else {
|
||||
/* The original stack. */
|
||||
hi = GC_stackbottom;
|
||||
}
|
||||
# if DEBUG_THREADS
|
||||
GC_printf("Stack for thread 0x%x = [%p,%p)\n",
|
||||
(unsigned)(p -> id), lo, hi);
|
||||
# endif
|
||||
if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
|
||||
# ifdef STACK_GROWS_UP
|
||||
/* We got them backwards! */
|
||||
GC_push_all_stack(hi, lo);
|
||||
# else
|
||||
GC_push_all_stack(lo, hi);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
if (!found_me && !GC_in_thread_creation)
|
||||
ABORT("Collecting from unknown thread.");
|
||||
}
|
||||
|
||||
/* We hold the allocation lock. Suspend all threads that might */
|
||||
/* still be running. */
|
||||
void GC_suspend_all()
|
||||
{
|
||||
int i;
|
||||
GC_thread p;
|
||||
int result;
|
||||
pthread_t my_thread = pthread_self();
|
||||
|
||||
for (i = 0; i < THREAD_TABLE_SZ; i++) {
|
||||
for (p = GC_threads[i]; p != 0; p = p -> next) {
|
||||
if (!THREAD_EQUAL(p -> id, my_thread)) {
|
||||
if (p -> flags & FINISHED) continue;
|
||||
if (p -> thread_blocked) /* Will wait */ continue;
|
||||
# if DEBUG_THREADS
|
||||
GC_printf("Suspending thread 0x%x\n",
|
||||
(unsigned)(p -> id));
|
||||
# endif
|
||||
|
||||
if (pthread_suspend_np(p -> id) != 0)
|
||||
ABORT("pthread_suspend_np failed");
|
||||
|
||||
/*
|
||||
* This will only work for userland pthreads. It will
|
||||
* fail badly on rthreads. Perhaps we should consider
|
||||
* a pthread_sp_np() function that returns the stack
|
||||
* pointer for a suspended thread and implement in
|
||||
* both pthreads and rthreads.
|
||||
*/
|
||||
p -> stop_info.stack_ptr = *(ptr_t*)((char *)p -> id + UTHREAD_SP_OFFSET);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GC_stop_world()
|
||||
{
|
||||
int i;
|
||||
|
||||
GC_ASSERT(I_HOLD_LOCK());
|
||||
# if DEBUG_THREADS
|
||||
GC_printf("Stopping the world from 0x%x\n", (unsigned)pthread_self());
|
||||
# endif
|
||||
|
||||
/* Make sure all free list construction has stopped before we start. */
|
||||
/* No new construction can start, since free list construction is */
|
||||
/* required to acquire and release the GC lock before it starts, */
|
||||
/* and we have the lock. */
|
||||
# ifdef PARALLEL_MARK
|
||||
GC_acquire_mark_lock();
|
||||
GC_ASSERT(GC_fl_builder_count == 0);
|
||||
/* We should have previously waited for it to become zero. */
|
||||
# endif /* PARALLEL_MARK */
|
||||
|
||||
GC_suspend_all();
|
||||
|
||||
# ifdef PARALLEL_MARK
|
||||
GC_release_mark_lock();
|
||||
# endif
|
||||
#if DEBUG_THREADS
|
||||
GC_printf("World stopped from 0x%x\n", (unsigned)pthread_self());
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Caller holds allocation lock, and has held it continuously since */
|
||||
/* the world stopped. */
|
||||
void GC_start_world()
|
||||
{
|
||||
pthread_t my_thread = pthread_self();
|
||||
register int i;
|
||||
register GC_thread p;
|
||||
register int result;
|
||||
|
||||
# if DEBUG_THREADS
|
||||
GC_printf("World starting\n");
|
||||
# endif
|
||||
|
||||
for (i = 0; i < THREAD_TABLE_SZ; i++) {
|
||||
for (p = GC_threads[i]; p != 0; p = p -> next) {
|
||||
if (!THREAD_EQUAL(p -> id, my_thread)) {
|
||||
if (p -> flags & FINISHED) continue;
|
||||
if (p -> thread_blocked) continue;
|
||||
#if DEBUG_THREADS
|
||||
GC_printf("Resuming thread 0x%x\n",
|
||||
(unsigned)(p -> id));
|
||||
#endif
|
||||
|
||||
if (pthread_resume_np(p -> id) != 0)
|
||||
ABORT("pthread_kill failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
# if DEBUG_THREADS
|
||||
GC_printf("World started\n");
|
||||
# endif
|
||||
}
|
||||
|
||||
void GC_stop_init() {
|
||||
}
|
||||
|
||||
#endif
|
||||
+3
-164
@@ -133,7 +133,7 @@
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#if defined( UNIX_LIKE ) || defined(NACL)
|
||||
#ifdef UNIX_LIKE
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
@@ -392,7 +392,7 @@ static void *tiny_sbrk(ptrdiff_t increment)
|
||||
#define sbrk tiny_sbrk
|
||||
# endif /* ECOS */
|
||||
|
||||
#if defined(NETBSD) && defined(__ELF__)
|
||||
#if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
|
||||
ptr_t GC_data_start;
|
||||
|
||||
void GC_init_netbsd_elf()
|
||||
@@ -405,102 +405,6 @@ static void *tiny_sbrk(ptrdiff_t increment)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OPENBSD)
|
||||
static struct sigaction old_segv_act;
|
||||
sigjmp_buf GC_jmp_buf_openbsd;
|
||||
|
||||
# if defined(GC_OPENBSD_THREADS)
|
||||
# include <sys/syscall.h>
|
||||
sigset_t __syscall(quad_t, ...);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Dont use GC_find_limit() because siglongjmp out of the
|
||||
* signal handler by-passes our userland pthreads lib, leaving
|
||||
* SIGSEGV and SIGPROF masked. Instead use this custom one
|
||||
* that works-around the issues.
|
||||
*/
|
||||
|
||||
/*ARGSUSED*/
|
||||
void GC_fault_handler_openbsd(int sig)
|
||||
{
|
||||
siglongjmp(GC_jmp_buf_openbsd, 1);
|
||||
}
|
||||
|
||||
/* Return the first nonaddressible location > p or bound */
|
||||
/* Requires allocation lock. */
|
||||
ptr_t GC_find_limit_openbsd(ptr_t p, ptr_t bound)
|
||||
{
|
||||
static volatile ptr_t result;
|
||||
/* Safer if static, since otherwise it may not be */
|
||||
/* preserved across the longjmp. Can safely be */
|
||||
/* static since it's only called with the */
|
||||
/* allocation lock held. */
|
||||
struct sigaction act;
|
||||
size_t pgsz = (size_t)sysconf(_SC_PAGESIZE);
|
||||
|
||||
GC_ASSERT(I_HOLD_LOCK());
|
||||
|
||||
act.sa_handler = GC_fault_handler_openbsd;
|
||||
sigemptyset(&act.sa_mask);
|
||||
act.sa_flags = SA_NODEFER | SA_RESTART;
|
||||
sigaction(SIGSEGV, &act, &old_segv_act);
|
||||
|
||||
if (sigsetjmp(GC_jmp_buf_openbsd, 1) == 0) {
|
||||
result = (ptr_t)(((word)(p)) & ~(pgsz-1));
|
||||
for (;;) {
|
||||
result += pgsz;
|
||||
if (result >= bound) {
|
||||
result = bound;
|
||||
break;
|
||||
}
|
||||
GC_noop1((word)(*result));
|
||||
}
|
||||
}
|
||||
|
||||
# if defined(GC_OPENBSD_THREADS)
|
||||
/* due to the siglongjump we need to manually unmask SIGPROF */
|
||||
__syscall(SYS_sigprocmask, SIG_UNBLOCK, sigmask(SIGPROF));
|
||||
# endif
|
||||
|
||||
sigaction(SIGSEGV, &old_segv_act, 0);
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
/* Return first addressable location > p or bound */
|
||||
/* Requires allocation lock. */
|
||||
ptr_t GC_skip_hole_openbsd(ptr_t p, ptr_t bound)
|
||||
{
|
||||
static volatile ptr_t result;
|
||||
struct sigaction act;
|
||||
size_t pgsz = (size_t)sysconf(_SC_PAGESIZE);
|
||||
static volatile int firstpass;
|
||||
|
||||
GC_ASSERT(I_HOLD_LOCK());
|
||||
|
||||
act.sa_handler = GC_fault_handler_openbsd;
|
||||
sigemptyset(&act.sa_mask);
|
||||
act.sa_flags = SA_NODEFER | SA_RESTART;
|
||||
sigaction(SIGSEGV, &act, &old_segv_act);
|
||||
|
||||
firstpass = 1;
|
||||
result = (ptr_t)(((word)(p)) & ~(pgsz-1));
|
||||
if (sigsetjmp(GC_jmp_buf_openbsd, 1) != 0 || firstpass) {
|
||||
firstpass = 0;
|
||||
result += pgsz;
|
||||
if (result >= bound) {
|
||||
result = bound;
|
||||
} else
|
||||
GC_noop1((word)(*result));
|
||||
}
|
||||
|
||||
sigaction(SIGSEGV, &old_segv_act, 0);
|
||||
|
||||
return(result);
|
||||
}
|
||||
#endif
|
||||
|
||||
# ifdef OS2
|
||||
|
||||
# include <stddef.h>
|
||||
@@ -618,12 +522,6 @@ void GC_enable_signals(void)
|
||||
/* longjmp implementations. Most systems appear not to have */
|
||||
/* a signal 32. */
|
||||
# define SIGSETMASK(old, new) (old) = sigsetmask(new)
|
||||
# elif defined(NACL)
|
||||
/* We don't use signals in NaCl. */
|
||||
# define SIGSET_T int
|
||||
# define SIG_DEL(set, signal)
|
||||
# define SIG_FILL(set)
|
||||
# define SIGSETMASK(old, new)
|
||||
# else
|
||||
/* Use POSIX/SYSV interface */
|
||||
# define SIGSET_T sigset_t
|
||||
@@ -1123,8 +1021,7 @@ void *GC_set_stackbottom = NULL;
|
||||
#endif /* FREEBSD_STACKBOTTOM */
|
||||
|
||||
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
|
||||
&& !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS) \
|
||||
&& !defined(GC_OPENBSD_THREADS)
|
||||
&& !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS)
|
||||
|
||||
ptr_t GC_get_stack_base()
|
||||
{
|
||||
@@ -1184,25 +1081,6 @@ ptr_t GC_get_stack_base()
|
||||
|
||||
# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS, !NOSYS, !ECOS */
|
||||
|
||||
#if defined(GC_OPENBSD_THREADS)
|
||||
|
||||
/* Find the stack using pthread_stackseg_np() */
|
||||
|
||||
# include <sys/signal.h>
|
||||
# include <pthread.h>
|
||||
# include <pthread_np.h>
|
||||
|
||||
#define HAVE_GET_STACK_BASE
|
||||
|
||||
ptr_t GC_get_stack_base()
|
||||
{
|
||||
stack_t stack;
|
||||
pthread_stackseg_np(pthread_self(), &stack);
|
||||
return stack.ss_sp;
|
||||
}
|
||||
|
||||
#endif /* GC_OPENBSD_THREADS */
|
||||
|
||||
/*
|
||||
* Register static data segment(s) as roots.
|
||||
* If more data segments are added later then they need to be registered
|
||||
@@ -1567,31 +1445,6 @@ int * etext_addr;
|
||||
|
||||
#else /* !OS2 && !Windows && !AMIGA */
|
||||
|
||||
#if defined(OPENBSD)
|
||||
|
||||
/*
|
||||
* Depending on arch alignment there can be multiple holes
|
||||
* between DATASTART & DATAEND. Scan from DATASTART - DATAEND
|
||||
* and register each region.
|
||||
*/
|
||||
void GC_register_data_segments(void)
|
||||
{
|
||||
ptr_t region_start, region_end;
|
||||
|
||||
region_start = DATASTART;
|
||||
|
||||
for(;;) {
|
||||
region_end = GC_find_limit_openbsd(region_start, DATAEND);
|
||||
GC_add_roots_inner(region_start, region_end, FALSE);
|
||||
if (region_end < DATAEND)
|
||||
region_start = GC_skip_hole_openbsd(region_end, DATAEND);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# else /* !OS2 && !Windows && !AMIGA && !OPENBSD */
|
||||
|
||||
void GC_register_data_segments()
|
||||
{
|
||||
# if !defined(PCR) && !defined(SRC_M3) && !defined(MACOS)
|
||||
@@ -1651,7 +1504,6 @@ void GC_register_data_segments()
|
||||
/* change. */
|
||||
}
|
||||
|
||||
# endif /* ! OPENBSD */
|
||||
# endif /* ! AMIGA */
|
||||
# endif /* ! MSWIN32 && ! MSWINCE*/
|
||||
# endif /* ! OS2 */
|
||||
@@ -2073,21 +1925,8 @@ void GC_remap(ptr_t start, word bytes)
|
||||
int result;
|
||||
|
||||
if (0 == start_addr) return;
|
||||
#ifdef NACL
|
||||
{
|
||||
/* NaCl doesn't expose mprotect, but mmap should work fine */
|
||||
void * mmap_result;
|
||||
mmap_result = mmap(start_addr, len, PROT_READ | PROT_WRITE | OPT_PROT_EXEC,
|
||||
MAP_PRIVATE | MAP_FIXED | OPT_MAP_ANON,
|
||||
zero_fd, 0/* offset */);
|
||||
if (mmap_result != (void *)start_addr) ABORT("mmap as mprotect failed");
|
||||
/* Fake the return value as if mprotect succeeded. */
|
||||
result = 0;
|
||||
}
|
||||
#else /* NACL */
|
||||
result = mprotect(start_addr, len,
|
||||
PROT_READ | PROT_WRITE | OPT_PROT_EXEC);
|
||||
#endif /* NACL */
|
||||
if (result != 0) {
|
||||
GC_err_printf3(
|
||||
"Mprotect failed at 0x%lx (length %ld) with errno %ld\n",
|
||||
|
||||
+4
-186
@@ -2,14 +2,12 @@
|
||||
|
||||
#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
|
||||
&& !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
|
||||
&& !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS) \
|
||||
&& !defined(GC_OPENBSD_THREADS)
|
||||
&& !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS)
|
||||
|
||||
#include <signal.h>
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/* work around a dlopen issue (bug #75390), undefs to avoid warnings with redefinitions */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
@@ -23,19 +21,6 @@
|
||||
#include "include/libgc-mono-debugger.h"
|
||||
#endif
|
||||
|
||||
#ifdef NACL
|
||||
int nacl_park_threads_now = 0;
|
||||
pthread_t nacl_thread_parker = -1;
|
||||
|
||||
int nacl_thread_parked[MAX_NACL_GC_THREADS];
|
||||
int nacl_thread_used[MAX_NACL_GC_THREADS];
|
||||
int nacl_thread_parking_inited = 0;
|
||||
int nacl_num_gc_threads = 0;
|
||||
pthread_mutex_t nacl_thread_alloc_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
__thread int nacl_thread_idx = -1;
|
||||
__thread GC_thread nacl_gc_thread_self = NULL;
|
||||
#endif
|
||||
|
||||
#if DEBUG_THREADS
|
||||
|
||||
#ifndef NSIG
|
||||
@@ -50,7 +35,6 @@ __thread GC_thread nacl_gc_thread_self = NULL;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef NACL
|
||||
void GC_print_sig_mask()
|
||||
{
|
||||
sigset_t blocked;
|
||||
@@ -64,7 +48,7 @@ void GC_print_sig_mask()
|
||||
}
|
||||
GC_printf0("\n");
|
||||
}
|
||||
#endif /* NACL */
|
||||
|
||||
#endif
|
||||
|
||||
/* Remove the signals that we want to allow in thread stopping */
|
||||
@@ -131,7 +115,6 @@ sem_t GC_suspend_ack_sem;
|
||||
|
||||
static void _GC_suspend_handler(int sig)
|
||||
{
|
||||
#ifndef NACL
|
||||
int dummy;
|
||||
pthread_t my_thread = pthread_self();
|
||||
GC_thread me;
|
||||
@@ -201,8 +184,6 @@ static void _GC_suspend_handler(int sig)
|
||||
#if DEBUG_THREADS
|
||||
GC_printf1("Continuing 0x%lx\n", my_thread);
|
||||
#endif
|
||||
|
||||
#endif /* NACL */
|
||||
}
|
||||
|
||||
void GC_suspend_handler(int sig)
|
||||
@@ -296,10 +277,6 @@ static void pthread_push_all_stacks()
|
||||
# else
|
||||
GC_push_all_stack(lo, hi);
|
||||
# endif
|
||||
# ifdef NACL
|
||||
/* Push reg_storage as roots, this will cover the reg context */
|
||||
GC_push_all_stack(p -> stop_info.reg_storage, p -> stop_info.reg_storage + NACL_GC_REG_STORAGE_SIZE);
|
||||
# endif
|
||||
# ifdef IA64
|
||||
# if DEBUG_THREADS
|
||||
GC_printf3("Reg stack for thread 0x%lx = [%lx,%lx)\n",
|
||||
@@ -337,29 +314,11 @@ void GC_push_all_stacks()
|
||||
pthread_t GC_stopping_thread;
|
||||
int GC_stopping_pid;
|
||||
|
||||
#ifdef PLATFORM_ANDROID
|
||||
static
|
||||
int android_thread_kill(pid_t tid, int sig)
|
||||
{
|
||||
int ret;
|
||||
int old_errno = errno;
|
||||
|
||||
ret = tkill(tid, sig);
|
||||
if (ret < 0) {
|
||||
ret = errno;
|
||||
errno = old_errno;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We hold the allocation lock. Suspend all threads that might */
|
||||
/* still be running. Return the number of suspend signals that */
|
||||
/* were sent. */
|
||||
int GC_suspend_all()
|
||||
{
|
||||
#ifndef NACL
|
||||
int n_live_threads = 0;
|
||||
int i;
|
||||
GC_thread p;
|
||||
@@ -378,12 +337,8 @@ int GC_suspend_all()
|
||||
#if DEBUG_THREADS
|
||||
GC_printf1("Sending suspend signal to 0x%lx\n", p -> id);
|
||||
#endif
|
||||
|
||||
#ifndef PLATFORM_ANDROID
|
||||
|
||||
result = pthread_kill(p -> id, SIG_SUSPEND);
|
||||
#else
|
||||
result = android_thread_kill(p -> kernel_id, SIG_SUSPEND);
|
||||
#endif
|
||||
switch(result) {
|
||||
case ESRCH:
|
||||
/* Not really there anymore. Possible? */
|
||||
@@ -398,15 +353,11 @@ int GC_suspend_all()
|
||||
}
|
||||
}
|
||||
return n_live_threads;
|
||||
#else /* NACL */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Caller holds allocation lock. */
|
||||
static void pthread_stop_world()
|
||||
{
|
||||
#ifndef NACL
|
||||
int i;
|
||||
int n_live_threads;
|
||||
int code;
|
||||
@@ -458,128 +409,8 @@ static void pthread_stop_world()
|
||||
GC_printf1("World stopped from 0x%lx\n", pthread_self());
|
||||
#endif
|
||||
GC_stopping_thread = 0; /* debugging only */
|
||||
#else /* NACL */
|
||||
GC_thread p;
|
||||
int i;
|
||||
|
||||
#if DEBUG_THREADS
|
||||
GC_printf1("pthread_stop_world: num_threads %d\n", nacl_num_gc_threads - 1);
|
||||
#endif
|
||||
nacl_thread_parker = pthread_self();
|
||||
nacl_park_threads_now = 1;
|
||||
|
||||
while (1) {
|
||||
#define NACL_PARK_WAIT_NANOSECONDS 100000
|
||||
int num_threads_parked = 0;
|
||||
struct timespec ts;
|
||||
int num_used = 0;
|
||||
/* Check the 'parked' flag for each thread the GC knows about */
|
||||
for (i = 0; i < MAX_NACL_GC_THREADS && num_used < nacl_num_gc_threads; i++) {
|
||||
if (nacl_thread_used[i] == 1) {
|
||||
num_used++;
|
||||
if (nacl_thread_parked[i] == 1) {
|
||||
num_threads_parked++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -1 for the current thread */
|
||||
if (num_threads_parked >= nacl_num_gc_threads - 1)
|
||||
break;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = NACL_PARK_WAIT_NANOSECONDS;
|
||||
#if DEBUG_THREADS
|
||||
GC_printf1("sleeping waiting for %d threads to park...\n", nacl_num_gc_threads - num_threads_parked - 1);
|
||||
#endif
|
||||
nanosleep(&ts, 0);
|
||||
}
|
||||
|
||||
#endif /* NACL */
|
||||
}
|
||||
|
||||
|
||||
#ifdef NACL
|
||||
|
||||
#if __x86_64__
|
||||
|
||||
#define NACL_STORE_REGS() \
|
||||
do { \
|
||||
asm("push %rbx");\
|
||||
asm("push %rbp");\
|
||||
asm("push %r12");\
|
||||
asm("push %r13");\
|
||||
asm("push %r14");\
|
||||
asm("push %r15");\
|
||||
asm("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\
|
||||
memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\
|
||||
asm("add $48, %esp");\
|
||||
asm("add %r15, %rsp");\
|
||||
} while (0)
|
||||
|
||||
#elif __i386__
|
||||
|
||||
#define NACL_STORE_REGS() \
|
||||
do { \
|
||||
asm("push %ebx");\
|
||||
asm("push %ebp");\
|
||||
asm("push %esi");\
|
||||
asm("push %edi");\
|
||||
asm("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\
|
||||
memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\
|
||||
asm("add $16, %esp");\
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
void nacl_pre_syscall_hook()
|
||||
{
|
||||
int local_dummy = 0;
|
||||
if (nacl_thread_idx != -1) {
|
||||
NACL_STORE_REGS();
|
||||
nacl_gc_thread_self->stop_info.stack_ptr = (ptr_t)(&local_dummy);
|
||||
nacl_thread_parked[nacl_thread_idx] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void nacl_post_syscall_hook()
|
||||
{
|
||||
/* Calling __nacl_suspend_thread_if_needed() right away should guarantee we don't mutate the GC set. */
|
||||
__nacl_suspend_thread_if_needed();
|
||||
if (nacl_thread_idx != -1) {
|
||||
nacl_thread_parked[nacl_thread_idx] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void __nacl_suspend_thread_if_needed() {
|
||||
if (nacl_park_threads_now) {
|
||||
pthread_t self = pthread_self();
|
||||
int local_dummy = 0;
|
||||
/* Don't try to park the thread parker. */
|
||||
if (nacl_thread_parker == self)
|
||||
return;
|
||||
|
||||
/* This can happen when a thread is created */
|
||||
/* outside of the GC system (wthread mostly). */
|
||||
if (nacl_thread_idx < 0)
|
||||
return;
|
||||
|
||||
/* If it was already 'parked', we're returning from a syscall, */
|
||||
/* so don't bother storing registers again, the GC has a set. */
|
||||
if (!nacl_thread_parked[nacl_thread_idx]) {
|
||||
NACL_STORE_REGS();
|
||||
nacl_gc_thread_self->stop_info.stack_ptr = (ptr_t)(&local_dummy);
|
||||
}
|
||||
nacl_thread_parked[nacl_thread_idx] = 1;
|
||||
while (nacl_park_threads_now)
|
||||
; /* spin */
|
||||
nacl_thread_parked[nacl_thread_idx] = 0;
|
||||
|
||||
/* Clear out the reg storage for next suspend. */
|
||||
memset(nacl_gc_thread_self->stop_info.reg_storage, 0, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* NACL */
|
||||
|
||||
/* Caller holds allocation lock. */
|
||||
void GC_stop_world()
|
||||
{
|
||||
@@ -612,7 +443,6 @@ void GC_stop_world()
|
||||
/* the world stopped. */
|
||||
static void pthread_start_world()
|
||||
{
|
||||
#ifndef NACL
|
||||
pthread_t my_thread = pthread_self();
|
||||
register int i;
|
||||
register GC_thread p;
|
||||
@@ -635,12 +465,8 @@ static void pthread_start_world()
|
||||
#if DEBUG_THREADS
|
||||
GC_printf1("Sending restart signal to 0x%lx\n", p -> id);
|
||||
#endif
|
||||
|
||||
#ifndef PLATFORM_ANDROID
|
||||
|
||||
result = pthread_kill(p -> id, SIG_THR_RESTART);
|
||||
#else
|
||||
result = android_thread_kill(p -> kernel_id, SIG_THR_RESTART);
|
||||
#endif
|
||||
switch(result) {
|
||||
case ESRCH:
|
||||
/* Not really there anymore. Possible? */
|
||||
@@ -673,12 +499,6 @@ static void pthread_start_world()
|
||||
#if DEBUG_THREADS
|
||||
GC_printf0("World started\n");
|
||||
#endif
|
||||
#else /* NACL */
|
||||
# if DEBUG_THREADS
|
||||
GC_printf0("World starting\n");
|
||||
# endif
|
||||
nacl_park_threads_now = 0;
|
||||
#endif /* NACL */
|
||||
}
|
||||
|
||||
void GC_start_world()
|
||||
@@ -692,7 +512,6 @@ void GC_start_world()
|
||||
}
|
||||
|
||||
static void pthread_stop_init() {
|
||||
#ifndef NACL
|
||||
struct sigaction act;
|
||||
|
||||
if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
|
||||
@@ -733,7 +552,6 @@ static void pthread_stop_init() {
|
||||
GC_printf0("Will retry suspend signal if necessary.\n");
|
||||
}
|
||||
# endif
|
||||
#endif /* NACL */
|
||||
}
|
||||
|
||||
/* We hold the allocation lock. */
|
||||
|
||||
+5
-81
@@ -68,8 +68,7 @@
|
||||
|
||||
# if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
|
||||
defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) || \
|
||||
defined(GC_NETBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC) || \
|
||||
defined(GC_OPENBSD_THREADS)
|
||||
defined(GC_NETBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC)
|
||||
# define USE_PTHREAD_SPECIFIC
|
||||
# endif
|
||||
|
||||
@@ -130,7 +129,7 @@
|
||||
# include <sys/sysctl.h>
|
||||
#endif /* GC_DARWIN_THREADS */
|
||||
|
||||
#if defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS)
|
||||
#if defined(GC_NETBSD_THREADS)
|
||||
# include <sys/param.h>
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
@@ -164,9 +163,6 @@
|
||||
# endif
|
||||
# undef pthread_join
|
||||
# undef pthread_detach
|
||||
# if defined(NACL)
|
||||
# undef pthread_exit
|
||||
# endif
|
||||
# if defined(GC_OSF1_THREADS) && defined(_PTHREAD_USE_MANGLED_NAMES_) \
|
||||
&& !defined(_PTHREAD_USE_PTDNAM_)
|
||||
/* Restore the original mangled names on Tru64 UNIX. */
|
||||
@@ -679,52 +675,6 @@ void GC_mark_thread_local_free_lists(void)
|
||||
|
||||
static struct GC_Thread_Rep first_thread;
|
||||
|
||||
#ifdef NACL
|
||||
extern int nacl_thread_parked[MAX_NACL_GC_THREADS];
|
||||
extern int nacl_thread_used[MAX_NACL_GC_THREADS];
|
||||
extern int nacl_thread_parking_inited;
|
||||
extern int nacl_num_gc_threads;
|
||||
extern pthread_mutex_t nacl_thread_alloc_lock;
|
||||
extern __thread int nacl_thread_idx;
|
||||
extern __thread GC_thread nacl_gc_thread_self;
|
||||
|
||||
void nacl_initialize_gc_thread()
|
||||
{
|
||||
int i;
|
||||
pthread_mutex_lock(&nacl_thread_alloc_lock);
|
||||
if (!nacl_thread_parking_inited)
|
||||
{
|
||||
for (i = 0; i < MAX_NACL_GC_THREADS; i++) {
|
||||
nacl_thread_used[i] = 0;
|
||||
nacl_thread_parked[i] = 0;
|
||||
}
|
||||
nacl_thread_parking_inited = 1;
|
||||
}
|
||||
GC_ASSERT(nacl_num_gc_threads <= MAX_NACL_GC_THREADS);
|
||||
for (i = 0; i < MAX_NACL_GC_THREADS; i++) {
|
||||
if (nacl_thread_used[i] == 0) {
|
||||
nacl_thread_used[i] = 1;
|
||||
nacl_thread_idx = i;
|
||||
nacl_num_gc_threads++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&nacl_thread_alloc_lock);
|
||||
}
|
||||
|
||||
void nacl_shutdown_gc_thread()
|
||||
{
|
||||
pthread_mutex_lock(&nacl_thread_alloc_lock);
|
||||
GC_ASSERT(nacl_thread_idx >= 0 && nacl_thread_idx < MAX_NACL_GC_THREADS);
|
||||
GC_ASSERT(nacl_thread_used[nacl_thread_idx] != 0);
|
||||
nacl_thread_used[nacl_thread_idx] = 0;
|
||||
nacl_thread_idx = -1;
|
||||
nacl_num_gc_threads--;
|
||||
pthread_mutex_unlock(&nacl_thread_alloc_lock);
|
||||
}
|
||||
|
||||
#endif /* NACL */
|
||||
|
||||
/* Add a thread to GC_threads. We assume it wasn't already there. */
|
||||
/* Caller holds allocation lock. */
|
||||
GC_thread GC_new_thread(pthread_t id)
|
||||
@@ -742,15 +692,8 @@ GC_thread GC_new_thread(pthread_t id)
|
||||
}
|
||||
if (result == 0) return(0);
|
||||
result -> id = id;
|
||||
#ifdef PLATFORM_ANDROID
|
||||
result -> kernel_id = gettid();
|
||||
#endif
|
||||
result -> next = GC_threads[hv];
|
||||
GC_threads[hv] = result;
|
||||
#ifdef NACL
|
||||
nacl_gc_thread_self = result;
|
||||
nacl_initialize_gc_thread();
|
||||
#endif
|
||||
GC_ASSERT(result -> flags == 0 && result -> thread_blocked == 0);
|
||||
return(result);
|
||||
}
|
||||
@@ -764,11 +707,6 @@ void GC_delete_thread(pthread_t id)
|
||||
register GC_thread p = GC_threads[hv];
|
||||
register GC_thread prev = 0;
|
||||
|
||||
#ifdef NACL
|
||||
nacl_shutdown_gc_thread();
|
||||
nacl_gc_thread_self = NULL;
|
||||
#endif
|
||||
|
||||
while (!pthread_equal(p -> id, id)) {
|
||||
prev = p;
|
||||
p = p -> next;
|
||||
@@ -1099,7 +1037,7 @@ void GC_thr_init()
|
||||
GC_nprocs = sysconf(_SC_NPROC_ONLN);
|
||||
if (GC_nprocs <= 0) GC_nprocs = 1;
|
||||
# endif
|
||||
# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) || defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS)
|
||||
# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) || defined(GC_NETBSD_THREADS)
|
||||
int ncpus = 1;
|
||||
size_t len = sizeof(ncpus);
|
||||
sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
|
||||
@@ -1175,8 +1113,7 @@ void GC_init_parallel()
|
||||
}
|
||||
|
||||
|
||||
#if !defined(GC_DARWIN_THREADS) && !defined(GC_OPENBSD_THREADS)
|
||||
#ifndef NACL
|
||||
#if !defined(GC_DARWIN_THREADS)
|
||||
int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
|
||||
{
|
||||
sigset_t fudged_set;
|
||||
@@ -1188,7 +1125,6 @@ int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
|
||||
}
|
||||
return(REAL_FUNC(pthread_sigmask)(how, set, oset));
|
||||
}
|
||||
#endif
|
||||
#endif /* !GC_DARWIN_THREADS */
|
||||
|
||||
/* Wrappers for functions that are likely to block for an appreciable */
|
||||
@@ -1319,17 +1255,6 @@ int WRAP_FUNC(pthread_join)(pthread_t thread, void **retval)
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef NACL
|
||||
/* Native Client doesn't support pthread cleanup functions, */
|
||||
/* so wrap pthread_exit and manually cleanup the thread. */
|
||||
void
|
||||
WRAP_FUNC(pthread_exit)(void *status)
|
||||
{
|
||||
GC_thread_exit_proc(0);
|
||||
REAL_FUNC(pthread_exit)(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
WRAP_FUNC(pthread_detach)(pthread_t thread)
|
||||
{
|
||||
@@ -1416,8 +1341,7 @@ void * GC_start_routine_head(void * arg, void *base_addr,
|
||||
if (start) *start = si -> start_routine;
|
||||
if (start_arg) *start_arg = si -> arg;
|
||||
|
||||
if (!(si->flags & FOREIGN_THREAD))
|
||||
sem_post(&(si -> registered)); /* Last action on si. */
|
||||
sem_post(&(si -> registered)); /* Last action on si. */
|
||||
/* OK to deallocate. */
|
||||
# if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
|
||||
LOCK();
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ int main()
|
||||
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
|
||||
printf("-lpthread\n");
|
||||
# endif
|
||||
# if defined(GC_FREEBSD_THREADS) || defined(GC_OPENBSD_THREADS)
|
||||
# if defined(GC_FREEBSD_THREADS)
|
||||
# if (__FREEBSD_version >= 500000)
|
||||
printf("-lpthread\n");
|
||||
# else
|
||||
|
||||
@@ -27,7 +27,6 @@ man_MANS = \
|
||||
mdvalidater.1 \
|
||||
mkbundle.1 \
|
||||
mono.1 \
|
||||
mprof-report.1 \
|
||||
mono-cil-strip.1 \
|
||||
mono-config.5 \
|
||||
monodocer.1 \
|
||||
|
||||
+1
-18
@@ -1,10 +1,8 @@
|
||||
.\"
|
||||
.\" certmgr manual page.
|
||||
.\" Copyright 2004-2005 Novell
|
||||
.\" Copyright 2010 Pablo Ruiz
|
||||
.\" Author:
|
||||
.\" Sebastien Pouliot <[email protected]>
|
||||
.\" Pablo Ruiz Garcia <[email protected]>
|
||||
.\"
|
||||
.TH Mono "certmgr"
|
||||
.SH NAME
|
||||
@@ -26,9 +24,7 @@ server certificates.
|
||||
List the certificates, CTL or CTL in the specified store.
|
||||
.TP
|
||||
.I "-add"
|
||||
Add a certificate, CRL or CTL to specified store. If filename it's a pkcs12
|
||||
or pfx file, and it contains a private key, it will be imported to local key
|
||||
pair container.
|
||||
Add a certificate, CRL or CTL to specified store.
|
||||
.TP
|
||||
.I "-del"
|
||||
Remove a certificate, CRL or CTL from specified store. You must specify the
|
||||
@@ -48,11 +44,6 @@ This action assume an certificate (-c) object type and will import the
|
||||
certificates in appropriate stores (i.e. server certificate in the
|
||||
OtherPeople store, the root certificate in the Trust store, any other
|
||||
intermediate certificates in the IntermediateCA store).
|
||||
.TP
|
||||
.I "-importKey"
|
||||
Allows importing a private key from a pkcs12 file into a local key pair
|
||||
store. (Usefull when you already have the key's corresponding certificate
|
||||
installed at the specific store.)
|
||||
|
||||
.SH OBJECT TYPES
|
||||
.TP
|
||||
@@ -75,9 +66,6 @@ Use the machine's certificate stores (instead of the default user's stores).
|
||||
.I "-v"
|
||||
More details displayed on the console.
|
||||
.TP
|
||||
.I "-p password"
|
||||
Use the specify password when accessing a pkcs12 file.
|
||||
.TP
|
||||
.I "-help", "-h", "-?", "/?"
|
||||
Display help about this tool.
|
||||
|
||||
@@ -100,9 +88,6 @@ The filenames either starts with
|
||||
(subject key identifier).
|
||||
.TP
|
||||
The rest of the filename is the base64-encoded value (tbp or ski).
|
||||
.TP
|
||||
Private key data is stored under
|
||||
.I ~/.config/.mono/keypairs/
|
||||
|
||||
.SH EXAMPLES
|
||||
.TP
|
||||
@@ -155,8 +140,6 @@ element of your machine.config file.
|
||||
|
||||
.SH AUTHOR
|
||||
Written by Sebastien Pouliot
|
||||
|
||||
Minor additions by Pablo Ruiz García
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2004-2005 Novell.
|
||||
.SH MAILING LISTS
|
||||
|
||||
+1
-19
@@ -6,7 +6,7 @@
|
||||
.SH NAME
|
||||
csharp, gsharp \- Interactive C# Shell
|
||||
.SH SYNOPSIS
|
||||
.B csharp [--attach PID] [-e EXPRESSION] [file1 [file2]]
|
||||
.B csharp [--attach PID] [file1 [file2]]
|
||||
[options]
|
||||
.P
|
||||
.B gsharp [file1 [file2]]
|
||||
@@ -29,22 +29,7 @@ target process.
|
||||
.PP
|
||||
Files specified in the command line will be loaded and executed as
|
||||
scripts.
|
||||
.PP
|
||||
Starting with Mono 2.10, the
|
||||
.I csharp
|
||||
command can be used as an interpreter executed by executables flagged
|
||||
with the Unix execute attribute. To do this, make the first line of
|
||||
your C# source code look like this:
|
||||
.nf
|
||||
"#!/usr/bin/csharp"
|
||||
Console.WriteLine ("Hello, World");
|
||||
.fi
|
||||
.SH OPTIONS
|
||||
The commands accept all of the commands that are available to the
|
||||
.I mcs
|
||||
command, so you can reference assemblies, specify paths, language
|
||||
level and so on from the command line. In addition, the following
|
||||
command line options are supported:
|
||||
.TP
|
||||
.I "\-\-attach"
|
||||
This is an advanced option and should only be used if you have a deep
|
||||
@@ -57,9 +42,6 @@ special measures to avoid crashing the target application while using
|
||||
it. For example, you might have to take the proper locks before
|
||||
issuing any commands that might affect the target process state, or
|
||||
sending commands through a method dispatcher.
|
||||
.TP
|
||||
.I "\-e" EXPRESSION
|
||||
This will evaluate the specified C# EXPRESSION and exit
|
||||
.SH OPERATION
|
||||
Once you launch the csharp command, you will be greeted with the
|
||||
interactive prompt:
|
||||
|
||||
@@ -351,11 +351,6 @@ shell will perform globbing, so you might want to use it like this:
|
||||
$ mcs -recurse:'*.cs'
|
||||
.fi
|
||||
.TP
|
||||
.I \-sdk:VERSION
|
||||
Used to specify the version of Base Class Library assemblies. The possible
|
||||
values are: 2 (default), 4. The version number means which .NET version
|
||||
should the produced assembly be compatible with.
|
||||
.TP
|
||||
.I \-\-shell
|
||||
Starts up the compiler in interactive mode, providing a C# shell for
|
||||
statements and expressions. A shortcut is to use the
|
||||
|
||||
+406
-79
@@ -220,13 +220,6 @@ Specifies the diagnostics log level for
|
||||
.Sp
|
||||
Used to specify the file where the log will be stored, it defaults to
|
||||
standard output.
|
||||
.TP
|
||||
.I server=[y/n]
|
||||
Defaults to no, with the default option Mono will actively connect to the
|
||||
host/port configured with the \fBaddress\fR option. If you set it to 'y', it
|
||||
instructs the Mono runtime to start debugging in server mode, where Mono
|
||||
actively waits for the debugger front end to connect to the Mono process.
|
||||
Mono will print out to stdout the IP address and port where it is listening.
|
||||
.ne
|
||||
.RE
|
||||
.TP
|
||||
@@ -422,10 +415,6 @@ Turns on profiling. For more information about profiling applications
|
||||
and code coverage see the sections "PROFILING" and "CODE COVERAGE"
|
||||
below.
|
||||
.TP
|
||||
This option can be used multiple times, each time will load an
|
||||
additional profiler. This allows developers to use modules that
|
||||
extend the JIT through the Mono profiling interface.
|
||||
.TP
|
||||
\fB--trace[=expression]\fR
|
||||
Shows method names as they are invoked. By default all methods are
|
||||
traced.
|
||||
@@ -638,22 +627,412 @@ Note that the statistical profiler has a very low overhead and should
|
||||
be the preferred profiler to use (for better output use the full path
|
||||
to the mono binary when running and make sure you have installed the
|
||||
addr2line utility that comes from the binutils package).
|
||||
.SH LOG PROFILER
|
||||
This is the most advanced profiler.
|
||||
.SH LOGGING PROFILER
|
||||
.PP
|
||||
The Mono \f[I]log\f[] profiler can be used to collect a lot of
|
||||
information about a program running in the Mono runtime.
|
||||
This data can be used (both while the process is running and later)
|
||||
to do analyses of the program behaviour, determine resource usage,
|
||||
performance issues or even look for particular execution patterns.
|
||||
The
|
||||
.I logging profiler
|
||||
is a general purpose profiler that can track many different kinds of
|
||||
events and logs those into a file as the program executes. This is
|
||||
different than previous profilers in Mono that kept the information in
|
||||
memory and rendered a summary of the results when the program shut
|
||||
down.
|
||||
.PP
|
||||
This is accomplished by logging the events provided by the Mono
|
||||
runtime through the profiling interface and periodically writing
|
||||
them to a file which can be later inspected with the mprof-report(1)
|
||||
tool.
|
||||
Using the logging profiler means that useful information can be
|
||||
gathered for long-running applications, applications that terminate
|
||||
abormally (crashes, segfaults, complicated tear down processes) or
|
||||
when no data about the shutdown is required.
|
||||
.PP
|
||||
More information about how to use the log profiler is available on the
|
||||
mprof-report(1) page.
|
||||
The data collected by the running threads is kept independent of each
|
||||
other to minimize the runtime overhead and the information dumped into
|
||||
the log at regular intervals.
|
||||
.PP
|
||||
A sample use is very simple:
|
||||
.nf
|
||||
$ mono --profile=logging program.exe
|
||||
|
||||
$ mprof-decoder program.mprof
|
||||
.fi
|
||||
.PP
|
||||
In the above example the logging profiler is used in its default mode
|
||||
that merely records GC statistics for the execution of program.exe.
|
||||
The profiling data collected is stored in the file program.mprof. The
|
||||
mprof-decoder tool is then used to analyze the data.
|
||||
.PP
|
||||
You can instruct the logging profiler to record different one or more
|
||||
sets of events. These are the modes supported:
|
||||
.IP
|
||||
.I Statistical Profiling (stat)
|
||||
the program instruction pointer is periodically sampled to determine
|
||||
where the program is spending most of its time. Statistical
|
||||
profiling has a very low impact on a running application and it is
|
||||
very useful to get a general picture of where time is being spent on a
|
||||
program.
|
||||
.IP
|
||||
If call chains are requested, for each sample the profiler gets a
|
||||
partial stack trace (limited by the specified depth) so that
|
||||
caller-callee information is available.
|
||||
.IP
|
||||
.I Instrumenting:
|
||||
each method enter and exit is logged with a timestamp; further processing of
|
||||
the data can show the methods that took the longer to execute, with complete
|
||||
accounting for callers and callees. However, this way of profiling is rather
|
||||
intrusive and slows down the application significantly.
|
||||
.IP
|
||||
.I Allocation:
|
||||
each allocation is logged.
|
||||
.IP
|
||||
.I Allocation summary:
|
||||
shows, for each collection, a summary of the heap contents broken down by
|
||||
class (for each class the number of allocated and released objects is
|
||||
given, together with their aggregated size in bytes).
|
||||
.IP
|
||||
.I Heap snapshot mode:
|
||||
dumps the whole heap contents at every collection (or at user specified
|
||||
collections). It is also possible to request a collection and snapshot dump
|
||||
with a signal.
|
||||
.PP
|
||||
Moreover, other events can be logged and analyzed, like jit time for each
|
||||
method, load and unload for assemblies, modules and and individual classes,
|
||||
and appdomain and thread creation and destruction.
|
||||
.PP
|
||||
This profiler is activated passing the \fB--profile=logging\fR option to
|
||||
the mono runtime, and is controlled attaching further options, like
|
||||
\fB--profile=logging:statistical\fR for doing statistical profiling (multiple
|
||||
options are separated by commas).
|
||||
.PP
|
||||
As a quick primer, here are a few examples of the most common usage modes:
|
||||
.PP
|
||||
To perform statistical profiling:
|
||||
.nf
|
||||
|
||||
mono --profile=logging:stat program.exe
|
||||
.fi
|
||||
.PP
|
||||
To perform statistical profiling, inspecting call chains up to depth 8:
|
||||
.nf
|
||||
|
||||
mono --profile=logging:stat=8 program.exe
|
||||
.fi
|
||||
.PP
|
||||
To profile allocations (by default the call stack will be analized for
|
||||
each allocation, producing detailed caller method attribution infornation):
|
||||
.nf
|
||||
|
||||
mono --profile=logging:allocations program.exe
|
||||
.fi
|
||||
.PP
|
||||
To profile garbage collection activity at a high level (collection time and objects freed
|
||||
at each collection for each class are reported, but heap snapshots are not saved to disk):
|
||||
.nf
|
||||
|
||||
mono --profile=logging:allocations-summary program.exe
|
||||
.fi
|
||||
.PP
|
||||
To perform heap profiling taking heap snapshots:
|
||||
.nf
|
||||
|
||||
mono --profile=logging:heap=all program.exe
|
||||
.fi
|
||||
.PP
|
||||
To write the resulting data to a different file:
|
||||
.nf
|
||||
|
||||
mono --profile=logging:output=mydata.mprof program.exe
|
||||
.fi
|
||||
.PP
|
||||
Then you would need to invoke the decoder \fImprof-decoder(1)\fR
|
||||
on the output file to see the profiling results, or to examine heap
|
||||
snapshots and allocations in detail \fImprof-heap-viewer(1)\fR.
|
||||
.PP
|
||||
The operating modes described above are the default ones, and are sufficient
|
||||
to use the profiler.
|
||||
.PP
|
||||
To further customize the profiler behavior there are more options, described
|
||||
below.
|
||||
.PP
|
||||
These options can be individually enabled and disabled prefixing them
|
||||
with an (optional) '+' character or a '-' character. For instance,
|
||||
the "allocations" option by default records also the full call stack
|
||||
at each allocation. If only the caller is wanted, one should use
|
||||
"allocations,-save-allocation-stack", or to disable call tracking
|
||||
completely (making the profiler less intrusive)
|
||||
"allocations,-save-allocation-caller,-save-allocation-stack". In
|
||||
practice the "allocation" option by default behaves like
|
||||
"allocations,save-allocation-caller,save-allocation-stack", but the
|
||||
user can tune this to his needs.
|
||||
.PP
|
||||
These are all the available options, organized by category:
|
||||
.PP
|
||||
\fBExecution profiling modes\fR
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
\fIstatistical\fR, \fIstat\fR or \fIs\fR
|
||||
Performs statistical profiling. This is a lightweight profiling
|
||||
mechanism and it has a much lower overhead than the \fIenter-leave\fR
|
||||
profiling as it works by sampling where the program is spending its
|
||||
time by using a timer.
|
||||
If specified with \fIs=<number>\fR, also inspect call chains up to level
|
||||
<number>.
|
||||
.TP
|
||||
\fIenter-leave\fR, \fIcalls\fR or \fIc\fR
|
||||
Measure the time spent inside each method call, this is done by
|
||||
logging the time when a method enters and when the method leaves.
|
||||
This can be a time consuming operation.
|
||||
.TP
|
||||
\fIjit\fR, \fIj\fR
|
||||
Collect information about time spent by the JIT engine compiling
|
||||
methods.
|
||||
.ne
|
||||
.RE
|
||||
.PP
|
||||
\fBAllocation profiling modes\fR
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
\fIallocations\fR, \fIalloc\fR or \fIa\fR
|
||||
Collect information about each allocation (object class and size).
|
||||
By default this also implies "+save-allocation-caller" and
|
||||
"+save-allocation-stack".
|
||||
.TP
|
||||
\fIsave-allocation-caller\fR, \fIsac\fR
|
||||
Save the direct caller of each allocation. The profiler filters out wrapper
|
||||
methods, and also recognizes if the allocation has been performed by the
|
||||
runtime while jitting a method.
|
||||
.TP
|
||||
\fIsave-allocation-stack\fR, \fIsas\fR
|
||||
Save the full managed execution stack at each allocation.
|
||||
While the "sac" option saves the direct caller, this one records the whole
|
||||
stack trace.
|
||||
Note that in the call stack the wrapper methods are not filtered out.
|
||||
Anyway the "sac" and "sas" options can be combined, and the decoder will
|
||||
attribute the allocation to the correct method even if the wrapper is at the
|
||||
top of the stack trace.
|
||||
.TP
|
||||
\fIallocations-summary\fR or \fIas\fR
|
||||
At each collection dump a summary
|
||||
of the heap contents (for each class, the number and collective size of all
|
||||
live and freed heap objects). This very lightweight compared to full heap
|
||||
snapshots.
|
||||
.TP
|
||||
\fIunreachable\fR, \fIfree\fR or \fIf\fR
|
||||
Performs a lightweight profile of the garbage collector. On each
|
||||
collection performed by the GC, the list of unreachable objects is
|
||||
recorded, and for each object the class and size is provided. This
|
||||
information can be used to compute the heap size broken down by class
|
||||
(combined with "a" can give the same information of "as", but the log
|
||||
file contains info about each individual object, while in "as" the
|
||||
processing is done directly at runtime and the log file contains only
|
||||
the summarized data broken down by class).
|
||||
.TP
|
||||
\fIgc\fR or \fIg\fR
|
||||
Measure the time spent in each collection, and also trace heap resizes.
|
||||
.TP
|
||||
\fIheap-shot[=ARG]\fR, \fIheap[=ARG]\fR or \fIh[=ARH]\fR
|
||||
Performs full heap profiling. In this case on each
|
||||
collection a full heap snapshot is recorded to disk.
|
||||
Inside the snapshots, each object reference is still represented so
|
||||
that it's possible to investigate who is responsible for keeping objects
|
||||
alive.
|
||||
.PP
|
||||
If the value of ARG is
|
||||
.B all,
|
||||
a heap snapshot is taken at each collection.
|
||||
.PP
|
||||
If the value is an integer
|
||||
.B n,
|
||||
a snapshot will be taken at the first
|
||||
.B n
|
||||
collections (like setting
|
||||
.B gcd=n
|
||||
);
|
||||
.PP
|
||||
If no additional argument is given to the heap option, the only way to take
|
||||
heap snapshots is to requeste them using the runtime socket based command
|
||||
interface described below (see "Profiler activity control").
|
||||
.PP
|
||||
Heap profiling also enables full allocation profiling (with call
|
||||
stacks), and each allocation can be related to its corresponding
|
||||
object in the snapshots, enabling investigations like "find all
|
||||
objects of a given class allocated by a given method and still live at
|
||||
a given collection, and then find all objects referencing them".
|
||||
.PP
|
||||
This kind of heap snapshot analysis is performed using the mprof-heap-viewer(1)
|
||||
application.
|
||||
.PP
|
||||
The number of heap snapshots taken (and the moment in which they are taken)
|
||||
can be further customized with the following options:
|
||||
.TP
|
||||
\fIgc-dumps=N\fR, \fIgc-d=N\fR, \fIgcd=N\fR
|
||||
states the number of snapshots that must be dumped (since the application
|
||||
starts). Zero means no dumps at all, -1 means dump at all collections.
|
||||
.TP
|
||||
These options exist because it can happen that the user wants to investigate
|
||||
what happens during collections but without forcing a collection using the
|
||||
command interface, because forcing a collection alters the program behavior.
|
||||
Of course it is possible to simply take a snapshot at every collection, but
|
||||
in some workloads this is could not be feasible (too much data).
|
||||
So we have this "garbage collection dumps" counter to control how many
|
||||
snapshots to take.
|
||||
.ne
|
||||
.RE
|
||||
.PP
|
||||
\fBProfiler activity control\fR
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
\fIoutput=FILE\fR, \fIout=FILE\fR or \fIo=FILE\fR
|
||||
Use this option to provide the output file name for the profile log.
|
||||
If this option is not specified, it will default to "<program-name>.mprof".
|
||||
.TP
|
||||
\fIoutput-suffix=SUFFIX\fR, \fIsuffix=SUFFIX\fR or \fIos=SUFFIX\fR: makes
|
||||
the output file name equals to "<program-name>-SUFFIX.mprof".
|
||||
.TP
|
||||
\fIstart-enabled\fR or \fIse\fR: start with the profiler active
|
||||
(which is the default).
|
||||
.TP
|
||||
\fIstart-disabled\fR or \fIsd\fR: start with the profiler inactive.
|
||||
.TP
|
||||
\fIforce-accurate-timer\fR (or \fIfac\fR): the profiler by default uses
|
||||
rtdsc to acquire timestamps for frequent events, but this can be imprecise;
|
||||
using this option you force the use of "gettimeofday" at every event, which
|
||||
is more accurate but much slower.
|
||||
.TP
|
||||
\fIcommand-port=port\fR or \fIcp=port\fR (where port is an integer between
|
||||
1024 nd 65535):
|
||||
Choose a TCP port where the profiler will listen for user commands.
|
||||
The protocol is ASCII based and line oriented (one line per command), and the
|
||||
profiler answers with one line containing either "OK" or "ERROR" to each
|
||||
received command.
|
||||
.PP
|
||||
The user can telnet to this port and give commands manually, or a GUI can
|
||||
use this facility to control the profiler at runtime.
|
||||
.PP
|
||||
The available commands are:
|
||||
.TP
|
||||
\fIenable\fR: Enables the profiler.
|
||||
.TP
|
||||
\fIdisable\fR: Disables the profiler.
|
||||
.TP
|
||||
\fIheap-snapshot\fR: Takes a heap snapshot now (forces a full garbage collection).
|
||||
.TP
|
||||
\fIheap-snapshot-counter=arg\fR: Set the counter of the next heap snapshots
|
||||
that must be taken, where arg can be "all" (take a snapshot at every
|
||||
collection), "none" (do not take snapshots), or an integer "n" (take a heap
|
||||
snapshot for the next "n" collections).
|
||||
.ne
|
||||
.RE
|
||||
.PP
|
||||
\fBInternal buffer sizes\fR
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
\fIper-thread-buffer-size=N\fR, \fItbs=N\fR
|
||||
Use to specify the number of events that a thread buffer
|
||||
can hold. When the thread buffer is full, a log block is
|
||||
written to disk.
|
||||
.Sp
|
||||
This defaults to tbs=10000.
|
||||
.TP
|
||||
\fIstatistical-thread-buffer-size=N\fR, \fIsbs=N\fR
|
||||
The number of statistical samples that
|
||||
are held in memory before they are dumped to disk (the system does
|
||||
double-buffering and the statistical samples are written by a helper
|
||||
thread, so the statistical profiler never stops and is able to profile
|
||||
the profiler itself).
|
||||
.Sp
|
||||
This defaults to sbs=10000.
|
||||
.TP
|
||||
\fIwrite-buffer-size\fR, \fIwbs\fR
|
||||
Specifies the size in bytes of the internal write buffers.
|
||||
.Sp
|
||||
This defaults to wbs=1024.
|
||||
.ne
|
||||
.RE
|
||||
.PP
|
||||
In its current state, this profiler can also perform heap analysis
|
||||
like the HeapShot profiler, but there is no UI to process this
|
||||
information.
|
||||
.PP
|
||||
Another known issue is that if the timer is not strictly monotonic (like
|
||||
rtdsc), differences between times can underflow (they are handled as
|
||||
unsigned integers) and weird numbers can show up in the logs.
|
||||
.PP
|
||||
Finally, it can happen that when exceptions are thrown the profiler temporarily
|
||||
loses track of the execution stack and misattributes the caller for a few
|
||||
allocations (and method execution time).
|
||||
.PP
|
||||
The output file contains compressed events, to process the data you should
|
||||
use tools like the "Mono.Profiler" tool provided on the Mono SVN
|
||||
repository.
|
||||
.PP
|
||||
More explanations are provided here: "http://www.mono-project.com/LoggingProfiler".
|
||||
.SH EXTERNAL PROFILERS
|
||||
There are a number of external profilers that have been developed for
|
||||
Mono, we will update this section to contain the profilers.
|
||||
.PP
|
||||
The heap Shot profiler can track all live objects, and references to
|
||||
these objects, and includes a GUI tool, this is our recommended
|
||||
profiler.
|
||||
To install you must download the profiler
|
||||
from Mono's SVN:
|
||||
.nf
|
||||
svn co svn://anonsvn.mono-project.com/source/trunk/heap-shot
|
||||
cd heap-shot
|
||||
./autogen
|
||||
make
|
||||
make install
|
||||
.fi
|
||||
.PP
|
||||
See the included documentation for details on using it.
|
||||
.PP
|
||||
The Live Type profiler shows at every GC iteration all of the live
|
||||
objects of a given type. To install you must download the profiler
|
||||
from Mono's SVN:
|
||||
.nf
|
||||
svn co svn://anonsvn.mono-project.com/source/trunk/heap-prof
|
||||
cd heap-prof
|
||||
./autogen
|
||||
make
|
||||
make install
|
||||
.fi
|
||||
.PP
|
||||
To use the profiler, execute:
|
||||
.nf
|
||||
mono --profile=desc-heap program.exe
|
||||
.fi
|
||||
.PP
|
||||
The output of this profiler looks like this:
|
||||
.nf
|
||||
Checkpoint at 102 for heap-resize
|
||||
System.MonoType : 708
|
||||
System.Threading.Thread : 352
|
||||
System.String : 3230
|
||||
System.String[] : 104
|
||||
Gnome.ModuleInfo : 112
|
||||
System.Object[] : 160
|
||||
System.Collections.Hashtable : 96
|
||||
System.Int32[] : 212
|
||||
System.Collections.Hashtable+Slot[] : 296
|
||||
System.Globalization.CultureInfo : 108
|
||||
System.Globalization.NumberFormatInfo : 144
|
||||
.fi
|
||||
.PP
|
||||
The first line describes the iteration number for the GC, in this case
|
||||
checkpoint 102.
|
||||
.PP
|
||||
Then on each line the type is displayed as well as the number of bytes
|
||||
that are being consumed by live instances of this object.
|
||||
.PP
|
||||
The AOT profiler is used to feed back information to the AOT compiler
|
||||
about how to order code based on the access patterns for pages. To
|
||||
use it, use:
|
||||
.nf
|
||||
mono --profile=aot program.exe
|
||||
.fi
|
||||
The output of this profile can be fed back into Mono's AOT compiler to
|
||||
order the functions on the disk to produce precompiled images that
|
||||
have methods in sequential pages.
|
||||
.SH CUSTOM PROFILERS
|
||||
Mono provides a mechanism for loading other profiling modules which in
|
||||
the form of shared libraries. These profiling modules can hook up to
|
||||
@@ -1002,35 +1381,7 @@ The default is 512 megabytes.
|
||||
Specifies which write barrier to use. Options are `cardtable' and
|
||||
`remset'. The card table barrier is faster but less precise, and only
|
||||
supported for the Mark&Sweep major collector on 32 bit platforms. The
|
||||
default is `cardtable' if it is supported, otherwise `remset'. The cardtable
|
||||
write barrier is faster and has a more stable and usually smaller
|
||||
memory footprint. If the program causes too much pinning during
|
||||
thread scan, it might be faster to enable remset.
|
||||
.TP
|
||||
\fBevacuation-threshold=\fIthreshold\fR
|
||||
Sets the evacuation threshold in percent. This option is only available
|
||||
on the Mark&Sweep major collectors. The value must be an
|
||||
integer in the range 0 to 100. The default is 66. If the sweep phase of
|
||||
the collection finds that the occupancy of a specific heap block type is
|
||||
less than this percentage, it will do a copying collection for that block
|
||||
type in the next major collection, thereby restoring occupancy to close
|
||||
to 100 percent. A value of 0 turns evacuation off.
|
||||
.TP
|
||||
\fB(no-)concurrent-sweep\fR
|
||||
Enables or disables concurrent sweep for the Mark&Sweep collector. If
|
||||
enabled, the sweep phase of the garbage collection is done in a thread
|
||||
concurrently with the application. Concurrent sweep is disabled by
|
||||
default.
|
||||
.TP
|
||||
\fBstack-mark=\fImark-mode\fR
|
||||
Specifies how application threads should be scanned. Options are
|
||||
`precise` and `conservative`. Precise marking allow the collector
|
||||
to know what values on stack are references and what are not.
|
||||
Conservative marking threats all values as potentially references
|
||||
and leave them untouched. Precise marking reduces floating garbage
|
||||
and can speed up nursery collection and allocation rate, it has
|
||||
the downside of requiring a significant extra memory per compiled
|
||||
method. The right option, unfortunately, requires experimentation.
|
||||
default is `cardtable' if it is supported, otherwise `remset'.
|
||||
.ne
|
||||
.RE
|
||||
.TP
|
||||
@@ -1303,36 +1654,11 @@ trading off the small leaks for the increased performance
|
||||
unload the application domains on production systems, it is worth
|
||||
using this feature).
|
||||
.TP
|
||||
\fBdyn-runtime-invoke\fR
|
||||
Instructs the runtime to try to use a generic runtime-invoke wrapper
|
||||
instead of creating one invoke wrapper.
|
||||
.TP
|
||||
\fBgdb\fR
|
||||
Equivalent to setting the \fBMONO_XDEBUG\fR variable, this emits
|
||||
symbols into a shared library as the code is JITed that can be loaded
|
||||
into GDB to inspect symbols.
|
||||
.TP
|
||||
\fBgen-seq-points\fR
|
||||
Automatically generates sequence points where the
|
||||
IL stack is empty. These are places where the debugger can set a
|
||||
breakpoint.
|
||||
.TP
|
||||
\fBexplicit-null-checks\fR
|
||||
Makes the JIT generate an explicit NULL check on variable dereferences
|
||||
instead of depending on the operating system to raise a SIGSEGV or
|
||||
another form of trap event when an invalid memory location is
|
||||
accessed.
|
||||
.TP
|
||||
\fBhandle-sigint\fR
|
||||
Captures the interrupt signal (Control-C) and displays a stack trace
|
||||
when pressed. Useful to find out where the program is executing at a
|
||||
given point. This only displays the stack trace of a single thread.
|
||||
.TP
|
||||
\fBinit-stacks\FR
|
||||
Instructs the runtime to initialize the stack with
|
||||
some known values (0x2a on x86-64) at the start of a method to assist
|
||||
in debuggin the JIT engine.
|
||||
.TP
|
||||
\fBkeep-delegates\fR
|
||||
This option will leak delegate trampolines that are no longer
|
||||
referenced as to present the user with more information about a
|
||||
@@ -1356,6 +1682,7 @@ This option will disable the GDB backtrace emitted by the runtime
|
||||
after a SIGSEGV or SIGABRT in unmanaged code.
|
||||
.TP
|
||||
\fBsuspend-on-sigsegv\fR
|
||||
|
||||
This option will suspend the program when a native SIGSEGV is received.
|
||||
This is useful for debugging crashes which do not happen under gdb,
|
||||
since a live process contains more information than a core file.
|
||||
@@ -1450,7 +1777,7 @@ Mono JIT by default turns this on.
|
||||
\fBMONO_XDEBUG\fR
|
||||
When the the MONO_XDEBUG env var is set, debugging info for JITted
|
||||
code is emitted into a shared library, loadable into gdb. This enables,
|
||||
for example, to see managed frame names on gdb backtraces.
|
||||
for example, to see managed frame names on gdb backtraces.
|
||||
.TP
|
||||
\fBMONO_VERBOSE_METHOD\fR
|
||||
Enables the maximum JIT verbosity for the specified method. This is
|
||||
|
||||
@@ -1,524 +0,0 @@
|
||||
.TH mprof-report 1 ""
|
||||
.SH The Mono log profiler
|
||||
.PP
|
||||
The Mono \f[I]log\f[] profiler can be used to collect a lot of
|
||||
information about a program running in the Mono runtime.
|
||||
This data can be used (both while the process is running and later)
|
||||
to do analyses of the program behaviour, determine resource usage,
|
||||
performance issues or even look for particular execution patterns.
|
||||
.PP
|
||||
This is accomplished by logging the events provided by the Mono
|
||||
runtime through the profiling interface and periodically writing
|
||||
them to a file which can be later inspected with the command line
|
||||
\f[I]mprof-report\f[] program or with a GUI (not developed yet).
|
||||
.PP
|
||||
The events collected include (among others):
|
||||
.IP \[bu] 2
|
||||
method enter and leave
|
||||
.IP \[bu] 2
|
||||
object allocation
|
||||
.IP \[bu] 2
|
||||
garbage collection
|
||||
.IP \[bu] 2
|
||||
JIT compilation
|
||||
.IP \[bu] 2
|
||||
metadata loading
|
||||
.IP \[bu] 2
|
||||
lock contention
|
||||
.IP \[bu] 2
|
||||
exceptions
|
||||
.PP
|
||||
In addition, the profiler can periodically collect info about all
|
||||
the objects present in the heap at the end of a garbage collection
|
||||
(this is called heap shot and currently implemented only for the
|
||||
sgen garbage collector).
|
||||
Another available profiler mode is the \f[I]sampling\f[] or
|
||||
\f[I]statistical\f[] mode: periodically the program is sampled and
|
||||
the information about what the program was busy with is saved.
|
||||
This allows to get information about the program behaviour without
|
||||
degrading its performance too much (usually less than 10%).
|
||||
.SS Basic profiler usage
|
||||
.PP
|
||||
The simpler way to use the profiler is the following:
|
||||
.PP
|
||||
\f[B]mono\ --profile=log\ program.exe\f[]
|
||||
.PP
|
||||
At the end of the execution the file \f[I]output.mlpd\f[] will be
|
||||
found in the current directory.
|
||||
A summary report of the data can be printed by running:
|
||||
.PP
|
||||
\f[B]mprof-report\ output.mlpd\f[]
|
||||
.PP
|
||||
With this invocation a huge amount of data is collected about the
|
||||
program execution and collecting and saving this data can
|
||||
significantly slow down program execution.
|
||||
If saving the profiling data is not needed, a report can be
|
||||
generated directly with:
|
||||
.PP
|
||||
\f[B]mono\ --profile=log:report\ program.exe\f[]
|
||||
.PP
|
||||
If the information about allocations is not of interest, it can be
|
||||
excluded:
|
||||
.PP
|
||||
\f[B]mono\ --profile=log:noalloc\ program.exe\f[]
|
||||
.PP
|
||||
On the other hand, if method call timing is not important, while
|
||||
allocations are, the needed info can be gathered with:
|
||||
.PP
|
||||
\f[B]mono\ --profile=log:nocalls\ program.exe\f[]
|
||||
.PP
|
||||
You will still be able to inspect information about the sequence of
|
||||
calls that lead to each allocation because at each object
|
||||
allocation a stack trace is collected if full enter/leave
|
||||
information is not available.
|
||||
.PP
|
||||
To periodically collect heap shots (and exclude method and
|
||||
allocation events) use the following options (making sure you run
|
||||
with the sgen garbage collector):
|
||||
.PP
|
||||
\f[B]mono\ --gc=sgen\ --profile=log:heapshot\ program.exe\f[]
|
||||
.PP
|
||||
To perform a sampling profiler run, use the \f[I]sample\f[] option:
|
||||
.PP
|
||||
\f[B]mono\ --profile=log:sample\ program.exe\f[]
|
||||
.SS Profiler option documentation
|
||||
.PP
|
||||
By default the \f[I]log\f[] profiler will gather all the events
|
||||
provided by the Mono runtime and write them to a file named
|
||||
\f[I]output.mlpd\f[].
|
||||
When no option is specified, it is equivalent to using:
|
||||
.PP
|
||||
\f[B]--profile=log:calls,alloc,output=output.mlpd,maxframes=8,calldepth=100\f[]
|
||||
.PP
|
||||
The following options can be used to modify this default behaviour.
|
||||
Each option is separated from the next by a \f[B],\f[] character,
|
||||
with no spaces and all the options are included after the
|
||||
\f[I]log:\f[] profile module specifier.
|
||||
.IP \[bu] 2
|
||||
\f[I]help\f[]: display concise help info about each available
|
||||
option
|
||||
.IP \[bu] 2
|
||||
\f[I][no]alloc\f[]: \f[I]noalloc\f[] disables collecting object
|
||||
allocation info, \f[I]alloc\f[] enables it if it was disabled by
|
||||
another option like \f[I]heapshot\f[].
|
||||
.IP \[bu] 2
|
||||
\f[I][no]calls\f[]: \f[I]nocalls\f[] disables collecting method
|
||||
enter and leave events.
|
||||
When this option is used at each object allocation and at some
|
||||
other events (like lock contentions and exception throws) a stack
|
||||
trace is collected by default.
|
||||
See the \f[I]maxframes\f[] option to control this behaviour.
|
||||
\f[I]calls\f[] enables method enter/leave events if they were
|
||||
disabled by another option like \f[I]heapshot\f[].
|
||||
.IP \[bu] 2
|
||||
\f[I]heapshot[=MODE]\f[]: collect heap shot data at each major
|
||||
collection.
|
||||
The frequency of the heap shots can be changed with the
|
||||
\f[I]MODE\f[] parameter.
|
||||
When this option is used allocation events and method enter/leave
|
||||
events are not recorded by default: if they are needed, they need
|
||||
to be enabled explicitly.
|
||||
The optional parameter \f[I]MODE\f[] can modify the default heap
|
||||
shot frequency.
|
||||
heapshot can be used multiple times with different modes: in that
|
||||
case a heap shot is taken if either of the conditions are met.
|
||||
MODE can be one of:
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
\f[I]NUM\f[]ms: perform a heap shot if at least \f[I]NUM\f[]
|
||||
milliseconds passed since the last one.
|
||||
.IP \[bu] 2
|
||||
\f[I]NUM\f[]gc: perform a heap shot every \f[I]NUM\f[] major
|
||||
garbage collections
|
||||
.IP \[bu] 2
|
||||
\f[I]ondemand\f[]: perform a heap shot when such a command is sent
|
||||
to the control port
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[I]sample[=TYPE[/FREQ]]\f[]: collect statistical samples of the
|
||||
program behaviour.
|
||||
The default is to collect a 1000 times per second the instruction
|
||||
pointer.
|
||||
This is equivalent to the value \[lq]cycles/1000\[rq] for
|
||||
\f[I]TYPE\f[].
|
||||
On some systems, like with recent Linux kernels, it is possible to
|
||||
cause the sampling to happen for other events provided by the
|
||||
performance counters of the cpu.
|
||||
In this case, \f[I]TYPE\f[] can be one of:
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
\f[I]cycles\f[]: processor cycles
|
||||
.IP \[bu] 2
|
||||
\f[I]instr\f[]: executed instructions
|
||||
.IP \[bu] 2
|
||||
\f[I]cacherefs\f[]: cache references
|
||||
.IP \[bu] 2
|
||||
\f[I]cachemiss\f[]: cache misses
|
||||
.IP \[bu] 2
|
||||
\f[I]branches\f[]: executed branches
|
||||
.IP \[bu] 2
|
||||
\f[I]branchmiss\f[]: mispredicted branches
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[I]time=TIMER\f[]: use the TIMER timestamp mode.
|
||||
TIMER can have the following values:
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
\f[I]fast\f[]: a usually faster but possibly more inaccurate timer
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[I]maxframes=NUM\f[]: when a stack trace needs to be performed,
|
||||
collect \f[I]NUM\f[] frames at the most.
|
||||
The default is 8.
|
||||
.IP \[bu] 2
|
||||
\f[I]calldepth=NUM\f[]: ignore method enter/leave events when the
|
||||
call chain depth is bigger than NUM.
|
||||
.IP \[bu] 2
|
||||
\f[I]zip\f[]: automatically compress the output data in gzip
|
||||
format.
|
||||
.IP \[bu] 2
|
||||
\f[I]output=OUTSPEC\f[]: instead of writing the profiling data to
|
||||
the output.mlpd file, substitute \f[I]%p\f[] in \f[I]OUTSPEC\f[]
|
||||
with the current process id and \f[I]%t\f[] with the current date
|
||||
and time, then do according to \f[I]OUTSPEC\f[]:
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
if \f[I]OUTSPEC\f[] begins with a \f[I]|\f[] character, execute the
|
||||
rest as a program and feed the data to its standard input
|
||||
.IP \[bu] 2
|
||||
if \f[I]OUTSPEC\f[] begins with a \f[I]-\f[] character, use the
|
||||
rest of OUTSPEC as the filename, but force overwrite any existing
|
||||
file by that name
|
||||
.IP \[bu] 2
|
||||
otherwise write the data the the named file: note that is a file by
|
||||
that name already exists, a warning is issued and profiling is
|
||||
disabled.
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[I]report\f[]: the profiling data is sent to mprof-report, which
|
||||
will print a summary report.
|
||||
This is equivalent to the option: \f[B]output=mprof-report\ -\f[].
|
||||
If the \f[I]output\f[] option is specified as well, the report will
|
||||
be written to the output file instead of the console.
|
||||
.IP \[bu] 2
|
||||
\f[I]port=PORT\f[]: specify the tcp/ip port to use for the
|
||||
listening command server.
|
||||
Currently not available for windows.
|
||||
This server is started for example when heapshot=ondemand is used:
|
||||
it will read commands line by line.
|
||||
The following commands are available:
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
\f[I]heapshot\f[]: perform a heapshot as soon as possible
|
||||
.RE
|
||||
.SS Analyzing the profile data
|
||||
.PP
|
||||
Currently there is a command line program (\f[I]mprof-report\f[])
|
||||
to analyze the data produced by the profiler.
|
||||
This is ran automatically when the \f[I]report\f[] profiler option
|
||||
is used.
|
||||
Simply run:
|
||||
.PP
|
||||
\f[B]mprof-report\ output.mlpd\f[]
|
||||
.PP
|
||||
to see a summary report of the data included in the file.
|
||||
.SS Trace information for events
|
||||
.PP
|
||||
Often it is important for some events, like allocations, lock
|
||||
contention and exception throws to know where they happened.
|
||||
Or we may want to see what sequence of calls leads to a particular
|
||||
method invocation.
|
||||
To see this info invoke mprof-report as follows:
|
||||
.PP
|
||||
\f[B]mprof-report\ --traces\ output.mlpd\f[]
|
||||
.PP
|
||||
The maximum number of methods in each stack trace can be specified
|
||||
with the \f[I]\[em]maxframes=NUM\f[] option:
|
||||
.PP
|
||||
\f[B]mprof-report\ --traces\ --maxframes=4\ output.mlpd\f[]
|
||||
.PP
|
||||
The stack trace info will be available if method enter/leave events
|
||||
have been recorded or if stack trace collection wasn't explicitly
|
||||
disabled with the \f[I]maxframes=0\f[] profiler option.
|
||||
Note that the profiler will collect up to 8 frames by default at
|
||||
specific events when the \f[I]nocalls\f[] option is used, so in
|
||||
that case, if more stack frames are required in mprof-report, a
|
||||
bigger value for maxframes when profiling must be used, too.
|
||||
.PP
|
||||
The \f[I]\[em]traces\f[] option also controls the reverse reference
|
||||
feature in the heapshot report: for each class it reports how many
|
||||
references to objects of that class come from other classes.
|
||||
.SS Sort order for methods and allocations
|
||||
.PP
|
||||
When a list of methods is printed the default sort order is based
|
||||
on the total time spent in the method.
|
||||
This time is wall clock time (that is, it includes the time spent,
|
||||
for example, in a sleep call, even if actual cpu time would be
|
||||
basically 0).
|
||||
Also, if the method has been ran on different threads, the time
|
||||
will be a sum of the time used in each thread.
|
||||
.PP
|
||||
To change the sort order, use the option:
|
||||
.PP
|
||||
\f[B]--method-sort=MODE\f[]
|
||||
.PP
|
||||
where \f[I]MODE\f[] can be:
|
||||
.IP \[bu] 2
|
||||
\f[I]self\f[]: amount of time spent in the method itself and not in
|
||||
its callees
|
||||
.IP \[bu] 2
|
||||
\f[I]calls\f[]: the number of method invocations
|
||||
.IP \[bu] 2
|
||||
\f[I]total\f[]: the total time spent in the method.
|
||||
.PP
|
||||
Object allocation lists are sorted by default depending on the
|
||||
total amount of bytes used by each type.
|
||||
.PP
|
||||
To change the sort order of object allocations, use the option:
|
||||
.PP
|
||||
\f[B]--alloc-sort=MODE\f[]
|
||||
.PP
|
||||
where \f[I]MODE\f[] can be:
|
||||
.IP \[bu] 2
|
||||
\f[I]count\f[]: the number of allocated objects of the given type
|
||||
.IP \[bu] 2
|
||||
\f[I]bytes\f[]: the total number of bytes used by objects of the
|
||||
given type
|
||||
.SS Selecting what data to report
|
||||
.PP
|
||||
The profiler by default collects data about many runtime subsystems
|
||||
and mprof-report prints a summary of all the subsystems that are
|
||||
found in the data file.
|
||||
It is possible to tell mprof-report to only show information about
|
||||
some of them with the following option:
|
||||
.PP
|
||||
\f[B]--reports=R1[,R2...]\f[]
|
||||
.PP
|
||||
where the report names R1, R2 etc.
|
||||
can be:
|
||||
.IP \[bu] 2
|
||||
\f[I]header\f[]: information about program startup and profiler
|
||||
version
|
||||
.IP \[bu] 2
|
||||
\f[I]jit\f[]: JIT compiler information
|
||||
.IP \[bu] 2
|
||||
\f[I]sample\f[]: statistical sampling information
|
||||
.IP \[bu] 2
|
||||
\f[I]gc\f[]: garbage collection information
|
||||
.IP \[bu] 2
|
||||
\f[I]alloc\f[]: object allocation information
|
||||
.IP \[bu] 2
|
||||
\f[I]call\f[]: method profiling information
|
||||
.IP \[bu] 2
|
||||
\f[I]metadata\f[]: metadata events like image loads
|
||||
.IP \[bu] 2
|
||||
\f[I]exception\f[]: exception throw and handling information
|
||||
.IP \[bu] 2
|
||||
\f[I]monitor\f[]: lock contention information
|
||||
.IP \[bu] 2
|
||||
\f[I]thread\f[]: thread information
|
||||
.IP \[bu] 2
|
||||
\f[I]heapshot\f[]: live heap usage at heap shots
|
||||
.PP
|
||||
It is possible to limit some of the data displayed to a timeframe
|
||||
of the program execution with the option:
|
||||
.PP
|
||||
\f[B]--time=FROM-TO\f[]
|
||||
.PP
|
||||
where \f[I]FROM\f[] and \f[I]TO\f[] are seconds since application
|
||||
startup (they can be floating point numbers).
|
||||
.PP
|
||||
Another interesting option is to consider only events happening on
|
||||
a particular thread with the following option:
|
||||
.PP
|
||||
\f[B]--thread=THREADID\f[]
|
||||
.PP
|
||||
where \f[I]THREADID\f[] is one of the numbers listed in the thread
|
||||
summary report (or a thread name when present).
|
||||
.PP
|
||||
By default long lists of methods or other information like object
|
||||
allocations are limited to the most important data.
|
||||
To increase the amount of information printed you can use the
|
||||
option:
|
||||
.PP
|
||||
\f[B]--verbose\f[]
|
||||
.SS Track individual objects
|
||||
.PP
|
||||
Instead of printing the usual reports from the profiler data, it is
|
||||
possible to track some interesting information about some specific
|
||||
object addresses.
|
||||
The objects are selected based on their address with the
|
||||
\f[I]\[em]track\f[] option as follows:
|
||||
.PP
|
||||
\f[B]--track=0xaddr1[,0xaddr2,...]\f[]
|
||||
.PP
|
||||
The reported info (if available in the data file), will be class
|
||||
name, size, creation time, stack trace of creation (with the
|
||||
\f[I]\[em]traces\f[] option), etc.
|
||||
If heapshot data is available it will be possible to also track
|
||||
what other objects reference one of the listed addresses.
|
||||
.PP
|
||||
The object addresses can be gathered either from the profiler
|
||||
report in some cases (like in the monitor lock report), from the
|
||||
live application or they can be selected with the
|
||||
\f[I]\[em]find=FINDSPEC\f[] option.
|
||||
FINDSPEC can be one of the following:
|
||||
.IP \[bu] 2
|
||||
\f[I]S:SIZE\f[]: where the object is selected if it's size is at
|
||||
least \f[I]SIZE\f[]
|
||||
.IP \[bu] 2
|
||||
\f[I]T:NAME\f[]: where the object is selected if \f[I]NAME\f[]
|
||||
partially matches its class name
|
||||
.PP
|
||||
This option can be specified multiple times with one of the
|
||||
different kinds of FINDSPEC.
|
||||
For example, the following:
|
||||
.PP
|
||||
\f[B]--find=S:10000\ --find=T:Byte[]\f[]
|
||||
.PP
|
||||
will find all the byte arrays that are at least 10000 bytes in
|
||||
size.
|
||||
.PP
|
||||
Note that with a moving garbage collector the object address can
|
||||
change, so you may need to track the changed address manually.
|
||||
It can also happen that multiple objects are allocated at the same
|
||||
address, so the output from this option can become large.
|
||||
.SS Saving a profiler report
|
||||
.PP
|
||||
By default mprof-report will print the summary data to the console.
|
||||
To print it to a file, instead, use the option:
|
||||
.PP
|
||||
\f[B]--out=FILENAME\f[]
|
||||
.SS Dealing with profiler slowness
|
||||
.PP
|
||||
If the profiler needs to collect lots of data, the execution of the
|
||||
program will slow down significantly, usually 10 to 20 times
|
||||
slower.
|
||||
There are several ways to reduce the impact of the profiler on the
|
||||
program execution.
|
||||
.SS Use the statistical sampling mode
|
||||
.PP
|
||||
Statistical sampling allows executing a program under the profiler
|
||||
with minimal performance overhead (usually less than 10%).
|
||||
This mode allows checking where the program is spending most of
|
||||
it's execution time without significantly perturbing its behaviour.
|
||||
.SS Collect less data
|
||||
.PP
|
||||
Collecting method enter/leave events can be very expensive,
|
||||
especially in programs that perform many millions of tiny calls.
|
||||
The profiler option \f[I]nocalls\f[] can be used to avoid
|
||||
collecting this data or it can be limited to only a few call levels
|
||||
with the \f[I]calldepth\f[] option.
|
||||
.PP
|
||||
Object allocation information is expensive as well, though much
|
||||
less than method enter/leave events.
|
||||
If it's not needed, it can be skipped with the \f[I]noalloc\f[]
|
||||
profiler option.
|
||||
Note that when method enter/leave events are discarded, by default
|
||||
stack traces are collected at each allocation and this can be
|
||||
expensive as well.
|
||||
The impact of stack trace information can be reduced by setting a
|
||||
low value with the \f[I]maxframes\f[] option or by eliminating them
|
||||
completely, by setting it to 0.
|
||||
.PP
|
||||
The other major source of data is the heapshot profiler option:
|
||||
especially if the managed heap is big, since every object needs to
|
||||
be inspected.
|
||||
The \f[I]MODE\f[] parameter of the \f[I]heapshot\f[] option can be
|
||||
used to reduce the frequency of the heap shots.
|
||||
.SS Reduce the timestamp overhead
|
||||
.PP
|
||||
On many operating systems or architectures what actually slows down
|
||||
profiling is the function provided by the system to get timestamp
|
||||
information.
|
||||
The \f[I]time=fast\f[] profiler option can be usually used to speed
|
||||
up this operation, but, depending on the system, time accounting
|
||||
may have some level of approximation (though statistically the data
|
||||
should be still fairly valuable).
|
||||
.SS Dealing with the size of the data files
|
||||
.PP
|
||||
When collecting a lot of information about a profiled program, huge
|
||||
data files can be generated.
|
||||
There are a few ways to minimize the amount of data, for example by
|
||||
not collecting some of the more space-consuming information or by
|
||||
compressing the information on the fly or by just generating a
|
||||
summary report.
|
||||
.SS Reducing the amount of data
|
||||
.PP
|
||||
Method enter/leave events can be excluded completely with the
|
||||
\f[I]nocalls\f[] option or they can be limited to just a few levels
|
||||
of calls with the \f[I]calldepth\f[] option.
|
||||
For example, the option:
|
||||
.PP
|
||||
\f[B]calldepth=10\f[]
|
||||
.PP
|
||||
will ignore the method events when there are more than 10 managed
|
||||
stack frames.
|
||||
This is very useful for programs that have deep recursion or for
|
||||
programs that perform many millions of tiny calls deep enough in
|
||||
the call stack.
|
||||
The optimal number for the calldepth option depends on the program
|
||||
and it needs to be balanced between providing enough profiling
|
||||
information and allowing fast execution speed.
|
||||
.PP
|
||||
Note that by default, if method events are not recorded at all, the
|
||||
profiler will collect stack trace information at events like
|
||||
allocations.
|
||||
To avoid gathering this data, use the \f[I]maxframes=0\f[] profiler
|
||||
option.
|
||||
.PP
|
||||
Allocation events can be eliminated with the \f[I]noalloc\f[]
|
||||
option.
|
||||
.PP
|
||||
Heap shot data can also be huge: by default it is collected at each
|
||||
major collection.
|
||||
To reduce the frequency, you can specify a heapshot mode: for
|
||||
example to collect every 5 collections (including major and minor):
|
||||
.PP
|
||||
\f[B]heapshot=5gc\f[]
|
||||
.PP
|
||||
or when at least 5 seconds passed since the last heap shot:
|
||||
.PP
|
||||
\f[B]heapshot=5000ms\f[]
|
||||
.SS Compressing the data
|
||||
.PP
|
||||
To reduce the amout of disk space used by the data, the data can be
|
||||
compressed either after it has been generated with the gzip
|
||||
command:
|
||||
.PP
|
||||
\f[B]gzip\ -9\ output.mlpd\f[]
|
||||
.PP
|
||||
or it can be compressed automatically by using the \f[I]zip\f[]
|
||||
profiler option.
|
||||
Note that in this case there could be a significant slowdown of the
|
||||
profiled program.
|
||||
.PP
|
||||
The mprof-report program will tranparently deal with either
|
||||
compressed or uncompressed data files.
|
||||
.SS Generating only a summary report
|
||||
.PP
|
||||
Often it's enough to look at the profiler summary report to
|
||||
diagnose an issue and in this case it's possible to avoid saving
|
||||
the profiler data file to disk.
|
||||
This can be accomplished with the \f[I]report\f[] profiler option,
|
||||
which will basically send the data to the mprof-report program for
|
||||
display.
|
||||
.PP
|
||||
To have more control of what summary information is reported (or to
|
||||
use a completely different program to decode the profiler data),
|
||||
the \f[I]output\f[] profiler option can be used, with \f[B]|\f[] as
|
||||
the first character: the rest of the output name will be executed
|
||||
as a program with the data fed in on the standard input.
|
||||
.PP
|
||||
For example, to print only the Monitor summary with stack trace
|
||||
information, you could use it like this:
|
||||
.PP
|
||||
\f[B]output=|mprof-report\ --reports=monitor\ --traces\ -\f[]
|
||||
.SH WEB SITE
|
||||
http://www.mono-project.com/Profiler
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
mono(1)
|
||||
.SH AUTHORS
|
||||
Paolo Molaro.
|
||||
|
||||
+3
-8
@@ -73,10 +73,9 @@ to $prefix/lib/mono/xbuild . When used in Import, like:
|
||||
|
||||
xbuild tries various values for the msbuild property $(MSBuildExtensionsPath), in order:
|
||||
|
||||
1. /Library/Frameworks/Mono.framework/External/xbuild on Mac OSX.
|
||||
2. Paths specified in the environment variable $MSBuildExtensionsPath.
|
||||
3. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.SpecialFolder.ApplicationData)
|
||||
4. $prefix/lib/mono/xbuild (default location)
|
||||
1. Paths specified in the environment variable $MSBuildExtensionsPath.
|
||||
2. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.SpecialFolder.ApplicationData)
|
||||
3. $prefix/lib/mono/xbuild (default location)
|
||||
|
||||
Anywhere else in the project files, $(MSBuildExtensionsPath) will always resolve to the default
|
||||
location. This is a xbuild-only feature.
|
||||
@@ -112,10 +111,6 @@ For example, you could set this variable from your shell:
|
||||
You can disable the built-in color scheme by setting this variable to
|
||||
"disable".
|
||||
|
||||
.SH NOTES
|
||||
On Mac OSX, for locating pkg-config (.pc) files, xbuild additionally
|
||||
looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" .
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR mono(1), mcs(1)
|
||||
.SH COPYRIGHT
|
||||
|
||||
+2
-1
@@ -13,8 +13,9 @@ tests/?mcs.log
|
||||
tests/gtest-*.dll
|
||||
tests/test-*.dll
|
||||
tests/xml-*.xml
|
||||
tests/?xml-*.xml
|
||||
tests/test-*.netmodule
|
||||
tests/gxml-*.xml
|
||||
tests/test-*.xml
|
||||
tests/data.xml
|
||||
class/Mono.Data.Sqlite/test.db
|
||||
class/Mono.CSharp/Mono.CSharp.dll.sources
|
||||
|
||||
+20
-13
@@ -3,13 +3,16 @@ thisdir := .
|
||||
SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
|
||||
|
||||
basic_SUBDIRS := build jay mcs class tools
|
||||
net_2_0_SUBDIRS := build class nunit24 ilasm tools tests errors mcs
|
||||
moonlight_raw_SUBDIRS := build class tools mcs
|
||||
moonlight_SUBDIRS := tools
|
||||
monodroid_SUBDIRS := build class mcs
|
||||
monotouch_SUBDIRS := build class mcs
|
||||
net_2_0_bootstrap_SUBDIRS := build tools
|
||||
net_2_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors
|
||||
moonlight_bootstrap_SUBDIRS := build mcs class
|
||||
moonlight_raw_SUBDIRS := build mcs class tools
|
||||
moonlight_SUBDIRS := tools tests errors
|
||||
monotouch_SUBDIRS := build mcs class
|
||||
monotouch_bootstrap_SUBDIRS := build mcs class
|
||||
net_3_5_SUBDIRS := build class tools/xbuild
|
||||
net_4_0_SUBDIRS := build class nunit24 ilasm tools tests errors mcs docs
|
||||
net_4_0_bootstrap_SUBDIRS := build mcs class tools
|
||||
net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
|
||||
|
||||
# List of test subdirs that should pass 100%
|
||||
centum_tests := \
|
||||
@@ -100,13 +103,16 @@ profiles-do--run-test:
|
||||
|
||||
# Orchestrate the bootstrap here.
|
||||
_boot_ = all clean install
|
||||
$(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--basic--%
|
||||
$(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--net_4_0_bootstrap--%
|
||||
$(_boot_:%=profile-do--net_4_0_bootstrap--%): profile-do--net_4_0_bootstrap--%: profile-do--net_2_0--%
|
||||
$(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
|
||||
$(_boot_:%=profile-do--moonlight--%): profile-do--moonlight--%: profile-do--moonlight_raw--%
|
||||
$(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--basic--%
|
||||
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--basic--%
|
||||
$(_boot_:%=profile-do--moonlight_raw--%): profile-do--moonlight_raw--%: profile-do--basic--%
|
||||
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--basic--%
|
||||
$(_boot_:%=profile-do--moonlight--%): profile-do--moonlight--%: profile-do--moonlight_raw--%
|
||||
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--monotouch_bootstrap--%
|
||||
$(_boot_:%=profile-do--monotouch_bootstrap--%): profile-do--monotouch_bootstrap--%: profile-do--net_2_0--%
|
||||
$(_boot_:%=profile-do--moonlight_raw--%): profile-do--moonlight_raw--%: profile-do--moonlight_bootstrap--%
|
||||
$(_boot_:%=profile-do--moonlight_bootstrap--%): profile-do--moonlight_bootstrap--%: profile-do--basic--%
|
||||
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--net_2_0_bootstrap--%
|
||||
$(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--basic--%
|
||||
|
||||
testcorlib:
|
||||
@cd class/corlib && $(MAKE) test run-test
|
||||
@@ -132,7 +138,8 @@ DISTFILES = \
|
||||
MonoIcon.png \
|
||||
README \
|
||||
ScalableMonoIcon.svg \
|
||||
winexe.in
|
||||
winexe.in \
|
||||
nunit.key
|
||||
|
||||
dist-local: dist-default
|
||||
|
||||
|
||||
@@ -17,10 +17,13 @@ common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
|
||||
PLATFORMS = darwin linux win32
|
||||
PROFILES = \
|
||||
basic \
|
||||
net_2_0_bootstrap \
|
||||
net_2_0 \
|
||||
moonlight_bootstrap \
|
||||
moonlight_raw \
|
||||
moonlight \
|
||||
net_3_5 \
|
||||
net_4_0_bootstrap \
|
||||
net_4_0
|
||||
|
||||
COMMON_SRCS = \
|
||||
|
||||
@@ -39,7 +39,7 @@ static class Consts
|
||||
public const string MonoProduct = "MONO Common language infrastructure";
|
||||
public const string MonoCopyright = "(c) various MONO Authors";
|
||||
|
||||
#if NET_4_0
|
||||
#if NET_4_0 || BOOTSTRAP_NET_4_0
|
||||
public const string FxVersion = "4.0.0.0";
|
||||
public const string FxFileVersion = "4.0.30319.1";
|
||||
|
||||
@@ -62,7 +62,7 @@ static class Consts
|
||||
public const string VsVersion = "9.0.0.0"; // unused, but needed for compilation
|
||||
public const string FxFileVersion = "4.0.50524.0";
|
||||
public const string VsFileVersion = "9.0.50727.42"; // unused, but needed for compilation
|
||||
#elif NET_2_0
|
||||
#elif NET_2_0 || BOOTSTRAP_NET_2_0
|
||||
// Versions of .NET Framework 2.0 RTM
|
||||
public const string FxVersion = "2.0.0.0";
|
||||
public const string VsVersion = "8.0.0.0";
|
||||
@@ -82,7 +82,9 @@ static class Consts
|
||||
|
||||
public const string AssemblyI18N = "I18N, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756";
|
||||
public const string AssemblyMicrosoft_VisualStudio = "Microsoft.VisualStudio, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
|
||||
#if NET_2_0
|
||||
public const string AssemblyMicrosoft_VisualStudio_Web = "Microsoft.VisualStudio.Web, Version=" + VsVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
|
||||
#endif
|
||||
public const string AssemblyMicrosoft_VSDesigner = "Microsoft.VSDesigner, Version=" + VsVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
|
||||
public const string AssemblyMono_Http = "Mono.Http, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756";
|
||||
public const string AssemblyMono_Posix = "Mono.Posix, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756";
|
||||
@@ -100,7 +102,7 @@ static class Consts
|
||||
public const string AssemblySystem_ServiceProcess = "System.ServiceProcess, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
|
||||
public const string AssemblySystem_Web = "System.Web, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
|
||||
public const string AssemblySystem_Windows_Forms = "System.Windows.Forms, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
#if NET_4_0
|
||||
#if NET_4_0 || BOOTSTRAP_NET_4_0
|
||||
public const string AssemblySystem_2_0 = "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
public const string AssemblySystemCore_3_5 = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
//
|
||||
|
||||
namespace System {
|
||||
#pragma warning disable 436
|
||||
|
||||
[AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
|
||||
internal class MonoTODOAttribute : Attribute {
|
||||
|
||||
@@ -97,5 +97,4 @@ namespace System {
|
||||
{
|
||||
}
|
||||
}
|
||||
#pragma warning restore 436
|
||||
}
|
||||
@@ -233,8 +233,6 @@ $(the_lib): $(build_lib)
|
||||
$(Q) test ! -f $(build_lib:.dll=.pdb) || mv $(build_lib:.dll=.pdb) $(the_lib:.dll=.pdb)
|
||||
endif
|
||||
|
||||
library_CLEAN_FILES += $(PROFILE)_aot.log
|
||||
|
||||
ifdef PLATFORM_AOT_SUFFIX
|
||||
Q_AOT=$(if $(V),,@echo "AOT [$(PROFILE)] $(notdir $(@))";)
|
||||
$(the_lib)$(PLATFORM_AOT_SUFFIX): $(the_lib)
|
||||
@@ -252,7 +250,7 @@ endif
|
||||
makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag
|
||||
library_CLEAN_FILES += $(makefrag)
|
||||
$(makefrag): $(sourcefile)
|
||||
# @echo Creating $@ ...
|
||||
@echo Creating $@ ...
|
||||
@sed 's,^,$(build_lib): ,' $< >$@
|
||||
@if test ! -f $(sourcefile).makefrag; then :; else \
|
||||
cat $(sourcefile).makefrag >> $@ ; \
|
||||
@@ -270,7 +268,7 @@ $(response): $(sourcefile)
|
||||
@echo Converting $(sourcefile) to $@ ...
|
||||
@cat $(sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
|
||||
endif
|
||||
|
||||
|
||||
endif
|
||||
|
||||
-include $(makefrag)
|
||||
|
||||
@@ -8,7 +8,7 @@ use_monolite := $(wildcard $(monolite_flag))
|
||||
|
||||
ifdef use_monolite
|
||||
PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME)
|
||||
BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/monolite/mcs.exe
|
||||
BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/monolite/gmcs.exe
|
||||
else
|
||||
PROFILE_RUNTIME = $(EXTERNAL_RUNTIME)
|
||||
BOOTSTRAP_MCS = $(EXTERNAL_MCS)
|
||||
@@ -60,7 +60,7 @@ do-profile-check: $(depsdir)/.stamp
|
||||
$(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \
|
||||
rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
|
||||
if $$ok; then :; else \
|
||||
if test -f $(topdir)/class/lib/monolite/mcs.exe; then \
|
||||
if test -f $(topdir)/class/lib/monolite/gmcs.exe; then \
|
||||
$(MAKE) -s do-profile-check-monolite ; \
|
||||
else \
|
||||
echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2; \
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#! -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
NO_TEST = yes
|
||||
|
||||
# the tuner takes care of the install
|
||||
NO_INSTALL = yes
|
||||
@@ -1,15 +1,17 @@
|
||||
#! -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
|
||||
INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
BOOTSTRAP_PROFILE = monotouch_bootstrap
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:MONOTOUCH -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MONOTOUCH
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
NO_TEST = yes
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#! -*- makefile -*-
|
||||
|
||||
INTERNAL_SMCS = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack $(topdir)/class/lib/$(PROFILE)/smcs.exe
|
||||
|
||||
BOOTSTRAP_PROFILE = net_2_0
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
|
||||
|
||||
# We can enable this if System.dll depends on features of the mscorlib.dll from this profile
|
||||
#PROFILE_MCS_HAS_BOOTSTRAP_FALLBACK = yes
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MONOTOUCH
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
NO_TEST = yes
|
||||
|
||||
# the tuner takes care of the install
|
||||
NO_INSTALL = yes
|
||||
@@ -0,0 +1,21 @@
|
||||
#! -*- makefile -*-
|
||||
|
||||
INTERNAL_SMCS = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack $(topdir)/class/lib/$(PROFILE)/smcs.exe
|
||||
INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/basic/gmcs.exe
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
|
||||
|
||||
# We can enable this if System.dll depends new features of the mscorlib.dll from this profile
|
||||
#PROFILE_MCS_HAS_BOOTSTRAP_FALLBACK = yes
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOONLIGHT
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
NO_TEST = yes
|
||||
|
||||
# the tuner takes care of the install
|
||||
NO_INSTALL = yes
|
||||
@@ -1,15 +1,17 @@
|
||||
#! -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
|
||||
INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
BOOTSTRAP_PROFILE = moonlight_bootstrap
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOONLIGHT -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOONLIGHT
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
NO_TEST = yes
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
BUILD_TOOLS_PROFILE = net_2_0_bootstrap
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
|
||||
# nuttzing!
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699
|
||||
FRAMEWORK_VERSION = 2.0
|
||||
@@ -0,0 +1,18 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
#
|
||||
# Note that we're using the .NET 1.1 MCS but MONO_PATH points to the net_2_0_bootstrap directory.
|
||||
# We do it this way to get assembly version references right.
|
||||
#
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
|
||||
MCS = $(BOOTSTRAP_MCS)
|
||||
|
||||
profile-check:
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0
|
||||
FRAMEWORK_VERSION = 2.0
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
NO_TEST = yes
|
||||
NO_INSTALL = yes
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0/gmcs.exe
|
||||
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
# nuttzing!
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) -lib:$(topdir)/class/lib/net_2_0 $(DEFAULT_REFERENCES)
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5
|
||||
FRAMEWORK_VERSION = 3.5
|
||||
|
||||
TEST_HARNESS = $(topdir)/class/lib/net_2_0/nunit-console.exe
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = basic
|
||||
INTERNAL_DMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/dmcs.exe
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
BOOTSTRAP_PROFILE = net_4_0_bootstrap
|
||||
|
||||
BOOTSTAP_DMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/dmcs.exe
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(BOOTSTAP_DMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_DMCS)
|
||||
|
||||
# nuttzing!
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699
|
||||
FRAMEWORK_VERSION = 4.0
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
BOOTSTRAP_PROFILE = net_2_0
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/dmcs.exe
|
||||
|
||||
# we have BOOTSTRAP_PROFILE listed in the MONO_PATH of MCS
|
||||
PROFILE_MCS_HAS_BOOTSTRAP_FALLBACK = yes
|
||||
|
||||
profile-check:
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:BOOTSTRAP_NET_4_0
|
||||
FRAMEWORK_VERSION = 4.0
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
NO_TEST = yes
|
||||
NO_INSTALL = yes
|
||||
|
||||
@@ -36,13 +36,14 @@ INSTALL_DATA = $(INSTALL) -c -m 644
|
||||
INSTALL_BIN = $(INSTALL) -c -m 755
|
||||
INSTALL_LIB = $(INSTALL_BIN)
|
||||
MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
|
||||
INTERNAL_MCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/mcs.exe
|
||||
INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
|
||||
INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/basic/mcs.exe
|
||||
INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/gmcs.exe
|
||||
INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
|
||||
corlib = mscorlib.dll
|
||||
|
||||
ifndef BUILD_TOOLS_PROFILE
|
||||
BUILD_TOOLS_PROFILE = basic
|
||||
BUILD_TOOLS_PROFILE = $(BOOTSTRAP_PROFILE)
|
||||
endif
|
||||
|
||||
INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
|
||||
@@ -196,6 +197,11 @@ dist-default:
|
||||
$(MKINSTALLDIRS) $(@D)
|
||||
touch $@
|
||||
|
||||
# Useful
|
||||
|
||||
withmcs:
|
||||
$(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all
|
||||
|
||||
## Documentation stuff
|
||||
|
||||
Q_MDOC =$(if $(V),,@echo "MDOC [$(PROFILE)] $(notdir $(@))";)
|
||||
|
||||
@@ -109,11 +109,11 @@ $(test_lib): $(the_assembly) $(test_response) $(test_nunit_dep)
|
||||
$(TEST_COMPILE) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
|
||||
|
||||
$(test_response): $(test_sourcefile)
|
||||
# @echo Creating $@ ...
|
||||
@echo Creating $@ ...
|
||||
@sed -e '/^$$/d' -e 's,^,Test/,' $(test_sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
|
||||
|
||||
$(test_makefrag): $(test_response)
|
||||
# @echo Creating $@ ...
|
||||
@echo Creating $@ ...
|
||||
@sed 's,^,$(test_lib): ,' $< >$@
|
||||
|
||||
-include $(test_makefrag)
|
||||
|
||||
@@ -447,7 +447,7 @@ namespace I18N.CJK
|
||||
// Decoder that handles a rolling Shift-JIS state.
|
||||
sealed class CP932Decoder : DbcsEncoding.DbcsDecoder
|
||||
{
|
||||
private new JISConvert convert;
|
||||
private JISConvert convert;
|
||||
private int last_byte_count;
|
||||
private int last_byte_chars;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace I18N.Common
|
||||
{
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
|
||||
// This class provides an internal list of handlers, for runtime
|
||||
// engines that do not implement the altered "GetFile" semantics.
|
||||
@@ -210,20 +210,19 @@ public sealed class Handlers
|
||||
"I18N.West.ENCibm865"
|
||||
};
|
||||
|
||||
static Dictionary<string, string> aliases;
|
||||
static Hashtable aliases;
|
||||
public static string GetAlias (string name)
|
||||
{
|
||||
if (aliases == null)
|
||||
BuildHash ();
|
||||
|
||||
string v;
|
||||
aliases.TryGetValue (name, out v);
|
||||
return v;
|
||||
return aliases [name] as string;
|
||||
}
|
||||
|
||||
static void BuildHash ()
|
||||
{
|
||||
aliases = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
|
||||
aliases = new Hashtable (new CaseInsensitiveHashCodeProvider (),
|
||||
new CaseInsensitiveComparer ());
|
||||
|
||||
aliases.Add ("arabic", "iso_8859_6");
|
||||
aliases.Add ("csISOLatinArabic", "iso_8859_6");
|
||||
|
||||
@@ -48,12 +48,11 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
#if NET_4_0
|
||||
[assembly: AssemblyVersion("4.84.0.0")]
|
||||
#elif NET_2_0
|
||||
#if NET_2_0
|
||||
[assembly: AssemblyVersion("2.84.0.0")]
|
||||
#else
|
||||
#error "No profile"
|
||||
// not worrying about the NET_1_0 profile for now.
|
||||
[assembly: AssemblyVersion("0.84.0.0")]
|
||||
#endif
|
||||
|
||||
[assembly: AssemblyDelaySign(true)]
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2009 Jeroen Frijters
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jeroen Frijters
|
||||
jeroen@frijters.net
|
||||
|
||||
*/
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace IKVM.Reflection
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class AmbiguousMatchException : Exception
|
||||
{
|
||||
public AmbiguousMatchException()
|
||||
{
|
||||
}
|
||||
|
||||
public AmbiguousMatchException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public AmbiguousMatchException(string message, Exception inner)
|
||||
: base(message, inner)
|
||||
{
|
||||
}
|
||||
|
||||
private AmbiguousMatchException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2009 Jeroen Frijters
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jeroen Frijters
|
||||
jeroen@frijters.net
|
||||
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IKVM.Reflection
|
||||
{
|
||||
public abstract class Assembly : ICustomAttributeProvider
|
||||
{
|
||||
internal readonly Universe universe;
|
||||
|
||||
internal Assembly(Universe universe)
|
||||
{
|
||||
this.universe = universe;
|
||||
}
|
||||
|
||||
public abstract Type[] GetTypes();
|
||||
public abstract string FullName { get; }
|
||||
public abstract AssemblyName GetName();
|
||||
public abstract string ImageRuntimeVersion { get; }
|
||||
public abstract Module ManifestModule { get; }
|
||||
public abstract MethodInfo EntryPoint { get; }
|
||||
public abstract string Location { get; }
|
||||
public abstract AssemblyName[] GetReferencedAssemblies();
|
||||
public abstract Module[] GetModules(bool getResourceModules);
|
||||
public abstract Module[] GetLoadedModules(bool getResourceModules);
|
||||
public abstract Module GetModule(string name);
|
||||
public abstract string[] GetManifestResourceNames();
|
||||
public abstract ManifestResourceInfo GetManifestResourceInfo(string resourceName);
|
||||
public abstract System.IO.Stream GetManifestResourceStream(string resourceName);
|
||||
|
||||
internal abstract Type GetTypeImpl(string typeName);
|
||||
|
||||
public Module[] GetModules()
|
||||
{
|
||||
return GetModules(true);
|
||||
}
|
||||
|
||||
public Module[] GetLoadedModules()
|
||||
{
|
||||
return GetLoadedModules(true);
|
||||
}
|
||||
|
||||
public AssemblyName GetName(bool copiedName)
|
||||
{
|
||||
return GetName();
|
||||
}
|
||||
|
||||
public bool ReflectionOnly
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public Type[] GetExportedTypes()
|
||||
{
|
||||
List<Type> list = new List<Type>();
|
||||
foreach (Type type in GetTypes())
|
||||
{
|
||||
if (type.IsVisible)
|
||||
{
|
||||
list.Add(type);
|
||||
}
|
||||
}
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
public Type GetType(string typeName)
|
||||
{
|
||||
return GetType(typeName, false);
|
||||
}
|
||||
|
||||
public Type GetType(string typeName, bool throwOnError)
|
||||
{
|
||||
TypeNameParser parser = TypeNameParser.Parse(typeName, throwOnError);
|
||||
if (parser.Error)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (parser.AssemblyName != null)
|
||||
{
|
||||
if (throwOnError)
|
||||
{
|
||||
throw new ArgumentException("Type names passed to Assembly.GetType() must not specify an assembly.");
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return parser.Expand(GetTypeImpl(parser.FirstNamePart), this, throwOnError, typeName);
|
||||
}
|
||||
|
||||
public virtual Module LoadModule(string moduleName, byte[] rawModule)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public Module LoadModule(string moduleName, byte[] rawModule, byte[] rawSymbolStore)
|
||||
{
|
||||
return LoadModule(moduleName, rawModule);
|
||||
}
|
||||
|
||||
public bool IsDefined(Type attributeType, bool inherit)
|
||||
{
|
||||
return CustomAttributeData.__GetCustomAttributes(this, attributeType, inherit).Count != 0;
|
||||
}
|
||||
|
||||
public IList<CustomAttributeData> __GetCustomAttributes(Type attributeType, bool inherit)
|
||||
{
|
||||
return CustomAttributeData.__GetCustomAttributes(this, attributeType, inherit);
|
||||
}
|
||||
|
||||
public static string CreateQualifiedName(string assemblyName, string typeName)
|
||||
{
|
||||
return assemblyName == null ? typeName : typeName + ", " + assemblyName;
|
||||
}
|
||||
|
||||
public static Assembly GetAssembly(Type type)
|
||||
{
|
||||
return type.Assembly;
|
||||
}
|
||||
|
||||
public string CodeBase
|
||||
{
|
||||
get
|
||||
{
|
||||
string path = this.Location.Replace(System.IO.Path.DirectorySeparatorChar, '/');
|
||||
if (!path.StartsWith("/"))
|
||||
{
|
||||
path = "/" + path;
|
||||
}
|
||||
return "file://" + path;
|
||||
}
|
||||
}
|
||||
|
||||
internal abstract IList<CustomAttributeData> GetCustomAttributesData(Type attributeType);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 4836 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user