The branch, master has been updated via b4ba669 s4-smbd: initialise process models in smbtorture before use via 35d466e s4-smbd: leave the single process model as internal via 55063cd waf: fixed building of non-shared binaries that contain modules via b2a5654 s4-heimdal: lex_err_message() should not be static via a139628 s4-waf: added a lexyacc.sh script that manually rebuilds the heimdal parsers via a00657d s4-test: don't override modules dir via e08c9ac waf: get rid of target aliases in wafsamba via 679eba6 s4-build: removed some unnecessary dependencies via f5251c0 s4-ndr: make ndr-table a subsystem via 2ea41fd s4-cmdline: make cmdline-credentials a private library via 88fd7e0 s4-dns: make the dns update task an external module via 87b3d38 s4-cluster: make cluster a private shared lib via 3f3783c s4-replace: make libreplace a private shared lib in s4 via eb0005d s4-tdb: make tdb-wrap into a private library via 045e344 s4-auth: make KERBEROS subsystem into authkrb5 private library via 7a26bb9 s4-credentials: make a private library from CREDENTIALS subsystem via 306754f s4-ldb: add explicit depenencies on ldb library in ldb modules via 04574d5 s4-ldbwrap: split ldb-wrap out from the LDBSAMBA subsystem via 228803c zlib: use the real library name 'z' instead of ZLIB via 0563c5b s4-rpc: split the dcesrv reply code out of dcerpc_server via ac8e910 s4-modules: remove LD_SAMBA_MODULE_PATH via 256349d s4-torture: simplify the depenencies for TORTURE_DRS via a57e0ae s4-smbd: make our process models into real modules via 046d38f s4-smbd: don't initialise process models more than once via 3a78148 waf: save the samba_deps_extended via f7b70a5 waf: give a better error on a bad grouping library via 78d732c waf: cope with subsystems with no static modules via ae0f420 waf: don't auto-depend on subsystems via adabc3d waf: added --symbol-check option via df34bb2 waf: build all libraries after all object files via 170c255 waf: use Utils.WafError() instead of raising an AssertionError via d1e9498 waf: cope with rules with no inputs via ccbb776 waf: separate out get_tgt_list() via e97be08 waf: display the paths in library loops via d489880 waf: added env.DEVELOPER_MODE flag via 65743f9 waf: added suncc_wrap via b6b0d2c s4-kdc: create a 'pac' private grouping library via 89c829f s4-heimdal: removed the use of signal.c from roken via 4bd7814 s4-heimdal: fixed the use of error_message() in heimdal via d6299d2 replace: create a private replace-test library via 0d45d97 s4-ldb: create a private library ldb-cmdline from 56b46d8 talloc: Fix manual pages in standalone build.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit b4ba669e48f7dd213d530a24f4587dea93c84223 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 23:42:27 2010 +1100 s4-smbd: initialise process models in smbtorture before use the spoolss notify test needs to setup the process models before use Autobuild-User: Andrew Tridgell <tri...@samba.org> Autobuild-Date: Sat Oct 30 13:32:09 UTC 2010 on sn-devel-104 commit 35d466e66b464cefca2e33fa8e1ff7301b029690 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 21:44:17 2010 +1100 s4-smbd: leave the single process model as internal This helps with the static smbtorture for samba3, and the spoolss tests which start a server commit 55063cddd574ecca6a51b20a10fa979d55d6b70a Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 16:37:27 2010 +1100 waf: fixed building of non-shared binaries that contain modules we need to incorporate the module objects too commit b2a565488ef0b2aad7401a0a2c61dd5853038a28 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 15:47:21 2010 +1100 s4-heimdal: lex_err_message() should not be static commit a139628423e0a48c1a63321ee054734673f03c9e Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 15:47:03 2010 +1100 s4-waf: added a lexyacc.sh script that manually rebuilds the heimdal parsers we so rarely need to rebuild these that it is simplest to just run lexyacc.sh when we import a new heimdal release commit a00657db758ba2a1bdc26f27024d72b8c7a1f114 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 15:09:30 2010 +1100 s4-test: don't override modules dir it is set correctly during the build commit e08c9ac696776cbd0bcd13b08409c709a18680e2 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:33:06 2010 +1100 waf: get rid of target aliases in wafsamba these aliases are no longer needed, and can cause a lot of confusion commit 679eba61ea5f52b6a8a31cac472ef575af5c03f8 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:25:14 2010 +1100 s4-build: removed some unnecessary dependencies based on running waf --symbol-check commit f5251c064ee0d1127b59de47ae82f59bcb5483dd Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:24:04 2010 +1100 s4-ndr: make ndr-table a subsystem its already part of the ndr-samba4 library Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 2ea41fdbe2bc56b411aee213c852cecadb325427 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:19:11 2010 +1100 s4-cmdline: make cmdline-credentials a private library commit 88fd7e0920dfdd9c1819c71b65dd3eda80a350f9 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:17:15 2010 +1100 s4-dns: make the dns update task an external module this simplifies some dependencies commit 87b3d384c6d26852d5c26cb8740eb42836193577 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:16:35 2010 +1100 s4-cluster: make cluster a private shared lib commit 3f3783cad3cf1c6379014b0408f4b3f12a69d3c1 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 14:16:07 2010 +1100 s4-replace: make libreplace a private shared lib in s4 commit eb0005dfcabedbeed0a75f139d6625b268d5062a Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 12:14:15 2010 +1100 s4-tdb: make tdb-wrap into a private library this prevents double linking of the tdb wrap code commit 045e3445a0cea796c400eacbdb28611b664ef902 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:46:20 2010 +1100 s4-auth: make KERBEROS subsystem into authkrb5 private library this fixes some double linking. The name 'KERBEROS' was also a bit confusing, as it sounded like a base kerberos library, when it is in fact part of auth commit 7a26bb9f7790cf9e0bf2e0e7b841fd5c4a64594c Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:44:07 2010 +1100 s4-credentials: make a private library from CREDENTIALS subsystem Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 306754f2949f72f2629a954e2c8bfd6182307370 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:42:51 2010 +1100 s4-ldb: add explicit depenencies on ldb library in ldb modules ldb modules call module functions from the main ldb library Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 04574d5738bb6a3bed3f6ee536b93068517263d8 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:41:11 2010 +1100 s4-ldbwrap: split ldb-wrap out from the LDBSAMBA subsystem ldb-wrap and the ldif-handlers are not really related, and this allows us to remove another dependency loop Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 228803cd015e54362e988e168a9976f6b7a27f85 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:37:42 2010 +1100 zlib: use the real library name 'z' instead of ZLIB using subsystem aliases has a lot of potential for confusion. Better to use the real name of the library. commit 0563c5bacf96d1b6759acd78377c417715f30fff Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:33:53 2010 +1100 s4-rpc: split the dcesrv reply code out of dcerpc_server this allows us to remove a dependency on the dcerpc_server from code that uses rpc forwarding Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit ac8e9106862fc4d49c070d3d307f43df9d7cc842 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:29:49 2010 +1100 s4-modules: remove LD_SAMBA_MODULE_PATH this isn't needed now that we automatically get the module path right in our build and install trees Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 256349d827517eba15ee4d0fbae725eace352c64 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:28:22 2010 +1100 s4-torture: simplify the depenencies for TORTURE_DRS it doesn't need to depend on the kitchen sink Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit a57e0ae7031971f45f41cf88c4a1573e8646681b Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:27:33 2010 +1100 s4-smbd: make our process models into real modules this simplifies some of the dependencies between bin/samba and the various services, making it easier to get a clean depenency tree Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 046d38faa5e78f2bdcfcdb3b1582427c2ecc80b8 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:24:15 2010 +1100 s4-smbd: don't initialise process models more than once this also removes the event_context parameter from process model initialisation. It isn't needed, and is confusing when a process model init can be called from more than one place, possibly with different event contexts. Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 3a7814826989b2ece34b8370c77bce9727814701 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:23:09 2010 +1100 waf: save the samba_deps_extended this is needed for the symbols.py extension commit f7b70a5a7acb3b3ed46112d0cd52f67bc763543c Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:22:29 2010 +1100 waf: give a better error on a bad grouping library give a clear error on an unknown dependency in a grouping library Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 78d732cc4002f92fa7741e848a8c922e60989a56 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:21:35 2010 +1100 waf: cope with subsystems with no static modules we still need the STATIC_xx_MODULES define when there are no static modules. It contains just the sentinal. Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit ae0f420dd989b165876b4b07754043a01604583e Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:19:08 2010 +1100 waf: don't auto-depend on subsystems this is part of an effort to reduce the amount of automatic dependency munging we do. When working on the correct dependency tree for Samba it is easier to add the right dependencies in the wscript files than rely on them being added by the waf rules. This change removes the automatic dependency of modules on their subsystem. Many modules don't actually need this dependency anyway, so it is better to add it where they are needed (for example, for ldb modules) Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit adabc3d082a2e23a9bca9282ad5e7be07fa776e9 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:17:30 2010 +1100 waf: added --symbol-check option this adds checking of the symbols in all our object files, libraries and syslibs. It will form the basis in future for a lot more checks, but for now it just checks basic rules like not allowing us to use symbols that are in system libs. Currently this is enabled only if you use the --symbol-check option, (or use make with SYMBOLCHECK=1) but I intend to make this always enabled once it has had more testing. Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit df34bb268566ea86f2b77ed7bb04983b8c05e4c3 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:07:40 2010 +1100 waf: build all libraries after all object files this makes it easier to perform symbol checking before the link stage. The two new build groups symbolcheck and syslibcheck will be used by the symbols.py extension commit 170c255f09a3d629bba86cf62c6a0cf81ff81bf1 Author: Andrew Tridgell <tri...@samba.org> Date: Sat Oct 30 11:06:13 2010 +1100 waf: use Utils.WafError() instead of raising an AssertionError this produces clearer output on errors commit d1e94980bf76a7dc07b01979c5d263fc32dccbf8 Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:53:15 2010 +1100 waf: cope with rules with no inputs when we display a rule with no inputs, just call the original display function Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit ccbb77693cec4e612d839b2dca92f97aa05f342e Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:52:25 2010 +1100 waf: separate out get_tgt_list() this is a useful function for the new symbols code, so separate it out of samba_deps.py Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit e97be0860b73270e610757c6c9312106587f7161 Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:51:17 2010 +1100 waf: display the paths in library loops when we detect a library loop, try to display the paths between the two libraries. This should make it easier to fix. Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit d489880ecd8b68aaabb6c154c85cc72a454d712a Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:50:25 2010 +1100 waf: added env.DEVELOPER_MODE flag this makes it easier to add project rules that are only run in developer mode Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 65743f932b511db009655847e77288c95c0aa525 Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:49:31 2010 +1100 waf: added suncc_wrap this should solve a problem with creating alias modules with Sun CC. Thanks to Matthieu for the idea, and Thomas for the waf code commit b6b0d2cea32c06c3f7a5574d22d1a344d70bd0d3 Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:48:06 2010 +1100 s4-kdc: create a 'pac' private grouping library this removes the final case where we have an object file linked into two libraries Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 89c829f654b5b67f37ce39b93bc0a456a3718ecd Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:47:11 2010 +1100 s4-heimdal: removed the use of signal.c from roken we don't need to replace signal() Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit 4bd7814a4e2970a1276b91b93987ce4fa9406c19 Author: Andrew Tridgell <tri...@samba.org> Date: Fri Oct 29 11:46:44 2010 +1100 s4-heimdal: fixed the use of error_message() in heimdal the lex code in heimdal had a function error_message() which conflicts with a function from the com_err library. This replaces it with lex_err_message() Pair-Programmed-With: Andrew Bartlett <abart...@samba.org> commit d6299d2667909487986782afc596cca45f2cbdac Author: Andrew Tridgell <tri...@samba.org> Date: Wed Oct 27 14:25:39 2010 +1100 replace: create a private replace-test library used by replace_testuite and smbtorture commit 0d45d97540df3b826c62bdd8e1ab29cde1f7f758 Author: Andrew Tridgell <tri...@samba.org> Date: Wed Oct 27 14:25:06 2010 +1100 s4-ldb: create a private library ldb-cmdline this prevents duplicate linking of the cmdline support code ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/samba_autoconf.py | 1 + buildtools/wafsamba/samba_deps.py | 98 ++++---- buildtools/wafsamba/samba_optimisation.py | 17 +- buildtools/wafsamba/samba_utils.py | 22 ++- buildtools/wafsamba/symbols.py | 382 ++++++++++++++++++++++++++ buildtools/wafsamba/wafsamba.py | 33 ++- buildtools/wafsamba/wscript | 4 + lib/replace/wscript | 13 +- lib/zlib/wscript | 6 +- libcli/auth/wscript_build | 2 +- librpc/wscript_build | 4 +- selftest/selftest.pl | 3 +- selftest/target/Samba4.pm | 1 - source3/wscript_build | 10 +- source4/auth/credentials/wscript_build | 19 +- source4/auth/gensec/wscript_build | 4 +- source4/auth/kerberos/wscript_build | 15 +- source4/cluster/wscript_build | 9 +- source4/dns_server/dns_server.c | 2 +- source4/dns_server/wscript_build | 2 +- source4/dsdb/samdb/ldb_modules/wscript_build | 4 +- source4/dsdb/samdb/samdb.c | 1 + source4/dsdb/wscript_build | 13 +- source4/heimdal/lib/asn1/asn1parse.c | 28 +- source4/heimdal/lib/asn1/asn1parse.y | 28 +- source4/heimdal/lib/asn1/gen_decode.c | 2 +- source4/heimdal/lib/asn1/lex.c | 8 +- source4/heimdal/lib/asn1/lex.h | 2 +- source4/heimdal/lib/asn1/lex.l | 10 +- source4/heimdal/lib/asn1/symbol.c | 2 +- source4/heimdal/lib/com_err/lex.c | 4 +- source4/heimdal/lib/com_err/lex.h | 2 +- source4/heimdal/lib/com_err/lex.l | 4 +- source4/heimdal/lib/com_err/parse.c | 2 +- source4/heimdal/lib/com_err/parse.y | 2 +- source4/heimdal_build/lexyacc.sh | 82 ++++++ source4/heimdal_build/wscript_build | 10 +- source4/kdc/kdc.c | 2 +- source4/kdc/wscript_build | 6 + source4/ldap_server/ldap_server.c | 2 +- source4/lib/cmdline/wscript_build | 12 +- source4/lib/com/wscript_build | 2 +- source4/lib/ldb-samba/ldb_wrap.h | 3 + source4/lib/ldb-samba/wscript_build | 25 +- source4/lib/ldb/wscript | 23 +- source4/lib/messaging/wscript_build | 2 +- source4/lib/registry/wscript_build | 2 +- source4/lib/samba3/wscript_build | 2 +- source4/lib/wscript_build | 13 +- source4/libcli/wscript_build | 4 +- source4/librpc/wscript_build | 9 +- source4/ntp_signd/ntp_signd.c | 2 +- source4/ntptr/simple_ldb/ntptr_simple_ldb.c | 2 + source4/ntvfs/ipc/rap_server.c | 1 + source4/param/util.c | 3 +- source4/param/wscript_build | 6 +- source4/rpc_server/common/forward.c | 1 + source4/rpc_server/common/reply.c | 254 +++++++++++++++++ source4/rpc_server/dcerpc_server.c | 172 +------------ source4/rpc_server/dcesrv_auth.c | 1 + source4/rpc_server/service_rpc.c | 2 +- source4/rpc_server/wscript_build | 8 +- source4/smb_server/smb_samba3.c | 2 +- source4/smb_server/wscript_build | 2 +- source4/smbd/process_model.c | 78 +++--- source4/smbd/process_model.h | 5 +- source4/smbd/process_onefork.c | 2 +- source4/smbd/process_prefork.c | 2 +- source4/smbd/process_single.c | 2 +- source4/smbd/process_standard.c | 2 +- source4/smbd/process_thread.c | 4 +- source4/smbd/service.c | 2 +- source4/smbd/wscript_build | 85 +++--- source4/torture/drs/wscript_build | 2 +- source4/torture/local/local.c | 1 + source4/torture/local/wscript_build | 4 +- source4/torture/rpc/spoolss_notify.c | 8 +- source4/torture/wscript_build | 2 +- source4/utils/wscript_build | 2 +- source4/web_server/web_server.c | 2 +- source4/winbind/wb_server.c | 2 +- source4/wrepl_server/wrepl_in_connection.c | 4 +- source4/wscript | 2 +- source4/wscript_build | 2 + 84 files changed, 1142 insertions(+), 485 deletions(-) create mode 100644 buildtools/wafsamba/symbols.py create mode 100755 source4/heimdal_build/lexyacc.sh create mode 100644 source4/rpc_server/common/reply.c Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 34acfdd..f987d1d 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -577,6 +577,7 @@ def SAMBA_CONFIG_H(conf, path=None): # we add these here to ensure that -Wstrict-prototypes is not set during configure conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k', testflags=True) + conf.env.DEVELOPER_MODE = True if Options.options.picky_developer: conf.ADD_CFLAGS('-Werror', testflags=True) diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index faac03e..7471118 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -19,16 +19,6 @@ def BREAK_CIRCULAR_LIBRARY_DEPENDENCIES(ctx): ctx.env.ALLOW_CIRCULAR_LIB_DEPENDENCIES = True -def TARGET_ALIAS(bld, target, alias): - '''define an alias for a target name''' - cache = LOCAL_CACHE(bld, 'TARGET_ALIAS') - if alias in cache: - Logs.error("Target alias %s already set to %s : newalias %s" % (alias, cache[alias], target)) - sys.exit(1) - cache[alias] = target -Build.BuildContext.TARGET_ALIAS = TARGET_ALIAS - - @conf def SET_SYSLIB_DEPS(conf, target, deps): '''setup some implied dependencies for a SYSLIB''' @@ -36,15 +26,6 @@ def SET_SYSLIB_DEPS(conf, target, deps): cache[target] = deps -def EXPAND_ALIAS(bld, target): - '''expand a target name via an alias''' - aliases = LOCAL_CACHE(bld, 'TARGET_ALIAS') - if target in aliases: - return aliases[target] - return target -Build.BuildContext.EXPAND_ALIAS = EXPAND_ALIAS - - def expand_subsystem_deps(bld): '''expand the reverse dependencies resulting from subsystem attributes of modules. This is walking over the complete list @@ -52,12 +33,9 @@ def expand_subsystem_deps(bld): module<->subsystem dependencies''' subsystem_list = LOCAL_CACHE(bld, 'INIT_FUNCTIONS') - aliases = LOCAL_CACHE(bld, 'TARGET_ALIAS') targets = LOCAL_CACHE(bld, 'TARGET_TYPE') for subsystem_name in subsystem_list: - if subsystem_name in aliases: - subsystem_name = aliases[subsystem_name] bld.ASSERT(subsystem_name in targets, "Subsystem target %s not declared" % subsystem_name) type = targets[subsystem_name] if type == 'DISABLED' or type == 'EMPTY': @@ -83,13 +61,6 @@ def expand_subsystem_deps(bld): # subsystem it is part of needs to have it as a dependency, so targets # that depend on this subsystem get the modules of that subsystem subsystem.samba_deps_extended.append(module_name) - module = bld.name_to_obj(module_name, bld.env) - bld.ASSERT(module is not None, "Unable to find module %s in subsystem %s" % (module_name, subsystem_name)) - module.samba_includes_extended.extend(subsystem.samba_includes_extended) - if targets[subsystem_name] in ['SUBSYSTEM']: - # if a subsystem is a plain object type (not a library) then any modules - # in that subsystem need to depend on the subsystem - module.samba_deps_extended.extend(subsystem.samba_deps_extended) subsystem.samba_deps_extended = unique_list(subsystem.samba_deps_extended) @@ -232,14 +203,16 @@ def add_init_functions(self): if m is not None: modules.append(m) - if modules == []: - return - sentinal = getattr(self, 'init_function_sentinal', 'NULL') targets = LOCAL_CACHE(bld, 'TARGET_TYPE') - cflags = getattr(self, 'samba_cflags', [])[:] + + if modules == []: + cflags.append('-DSTATIC_%s_MODULES=%s' % (sname.replace('-','_'), sentinal)) + self.ccflags = cflags + return + for m in modules: bld.ASSERT(m in subsystems, "No init_function defined for module '%s' in target '%s'" % (m, self.sname)) @@ -410,6 +383,7 @@ def replace_grouping_libraries(bld, tgt_list): if not getattr(t, 'grouping_library', False): continue for dep in t.samba_deps_extended: + bld.ASSERT(dep in targets, "grouping library target %s not declared in %s" % (dep, t.sname)) if targets[dep] == 'SUBSYSTEM': grouping[dep] = t.sname @@ -447,7 +421,6 @@ def build_direct_deps(bld, tgt_list): if getattr(t, 'samba_use_global_deps', False) and not t.sname in global_deps_exclude: deps.extend(global_deps) for d in deps: - d = EXPAND_ALIAS(bld, d) if d == t.sname: continue if not d in targets: Logs.error("Unknown dependency '%s' in '%s'" % (d, t.sname)) @@ -754,6 +727,25 @@ def reduce_objects(bld, tgt_list): return True +def show_library_loop(bld, lib1, lib2, path, seen): + '''show the detailed path of a library loop between lib1 and lib2''' + + t = bld.name_to_obj(lib1, bld.env) + if not lib2 in getattr(t, 'final_libs', set()): + return + + for d in t.samba_deps_extended: + if d in seen: + continue + seen.add(d) + path2 = path + '=>' + d + if d == lib2: + Logs.warn('library loop path: ' + path2) + return + show_library_loop(bld, d, lib2, path2, seen) + seen.remove(d) + + def calculate_final_deps(bld, tgt_list, loops): '''calculate the final library and object dependencies''' for t in tgt_list: @@ -771,6 +763,9 @@ def calculate_final_deps(bld, tgt_list, loops): # handle any non-shared binaries for t in tgt_list: if t.samba_type == 'BINARY' and bld.NONSHARED_BINARY(t.sname): + subsystem_list = LOCAL_CACHE(bld, 'INIT_FUNCTIONS') + targets = LOCAL_CACHE(bld, 'TARGET_TYPE') + # replace lib deps with objlist deps for l in t.final_libs: objname = l + '.objlist' @@ -780,6 +775,22 @@ def calculate_final_deps(bld, tgt_list, loops): sys.exit(1) t.final_objects.add(objname) t.final_objects = t.final_objects.union(extended_objects(bld, t2, set())) + if l in subsystem_list: + # its a subsystem - we also need the contents of any modules + for d in subsystem_list[l]: + module_name = d['TARGET'] + if targets[module_name] == 'LIBRARY': + objname = module_name + '.objlist' + elif targets[module_name] == 'SUBSYSTEM': + objname = module_name + else: + continue + t2 = bld.name_to_obj(objname, bld.env) + if t2 is None: + Logs.error('ERROR: subsystem %s not found' % objname) + sys.exit(1) + t.final_objects.add(objname) + t.final_objects = t.final_objects.union(extended_objects(bld, t2, set())) t.final_libs = set() # find any library loops @@ -798,6 +809,8 @@ def calculate_final_deps(bld, tgt_list, loops): else: Logs.error('ERROR: circular library dependency between %s and %s' % (t.sname, t2.sname)) + show_library_loop(bld, t.sname, t2.sname, t.sname, set()) + show_library_loop(bld, t2.sname, t.sname, t2.sname, set()) sys.exit(1) for loop in loops: @@ -927,10 +940,10 @@ def show_object_duplicates(bld, tgt_list): # this provides a way to save our dependency calculations between runs savedeps_version = 3 savedeps_inputs = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags', 'source', 'grouping_library'] -savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags'] +savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags', 'samba_deps_extended'] savedeps_outenv = ['INC_PATHS'] savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES'] -savedeps_caches = ['GLOBAL_DEPENDENCIES', 'TARGET_ALIAS', 'TARGET_TYPE', 'INIT_FUNCTIONS', 'SYSLIB_DEPS'] +savedeps_caches = ['GLOBAL_DEPENDENCIES', 'TARGET_TYPE', 'INIT_FUNCTIONS', 'SYSLIB_DEPS'] savedeps_files = ['buildtools/wafsamba/samba_deps.py'] def save_samba_deps(bld, tgt_list): @@ -1056,21 +1069,10 @@ def load_samba_deps(bld, tgt_list): def check_project_rules(bld): '''check the project rules - ensuring the targets are sane''' - targets = LOCAL_CACHE(bld, 'TARGET_TYPE') loops = {} inc_loops = {} - # build a list of task generators we are interested in - tgt_list = [] - for tgt in targets: - type = targets[tgt] - if not type in ['SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON']: - continue - t = bld.name_to_obj(tgt, bld.env) - if t is None: - Logs.error("Target %s of type %s has no task generator" % (tgt, type)) - sys.exit(1) - tgt_list.append(t) + tgt_list = get_tgt_list(bld) add_samba_attributes(bld, tgt_list) diff --git a/buildtools/wafsamba/samba_optimisation.py b/buildtools/wafsamba/samba_optimisation.py index 1c3478c..ad05348 100644 --- a/buildtools/wafsamba/samba_optimisation.py +++ b/buildtools/wafsamba/samba_optimisation.py @@ -7,7 +7,7 @@ # overall this makes some build tasks quite a bit faster from TaskGen import feature, after -import preproc +import preproc, Task @feature('cc', 'cxx') @after('apply_type_vars', 'apply_lib_vars', 'apply_core') @@ -148,3 +148,18 @@ Task.TaskBase.hash_constraints = hash_constraints # return task + +def suncc_wrap(cls): + '''work around a problem with cc on solaris not handling module aliases + which have empty libs''' + if getattr(cls, 'solaris_wrap', False): + return + cls.solaris_wrap = True + oldrun = cls.run + def run(self): + if self.env.CC_NAME == "sun" and not self.inputs: + self.env = self.env.copy() + self.env.append_value('LINKFLAGS', '-') + return oldrun(self) + cls.run = run +suncc_wrap(Task.TaskBase.classes['cc_link']) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 4139aa1..a25393b 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -102,8 +102,7 @@ def LOCAL_CACHE_SET(ctx, cachename, key, value): def ASSERT(ctx, expression, msg): '''a build assert call''' if not expression: - Logs.error("ERROR: %s\n" % msg) - raise AssertionError + raise Utils.WafError("ERROR: %s\n" % msg) Build.BuildContext.ASSERT = ASSERT @@ -569,3 +568,22 @@ def make_libname(ctx, name, nolibprefix=False, version=None, python=False): libname = "%s%s.%s" % (root, ext, version) return libname Build.BuildContext.make_libname = make_libname + + +def get_tgt_list(bld): + '''return a list of build objects for samba''' + + targets = LOCAL_CACHE(bld, 'TARGET_TYPE') + + # build a list of task generators we are interested in + tgt_list = [] + for tgt in targets: + type = targets[tgt] + if not type in ['SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON']: + continue + t = bld.name_to_obj(tgt, bld.env) + if t is None: + Logs.error("Target %s of type %s has no task generator" % (tgt, type)) + sys.exit(1) + tgt_list.append(t) + return tgt_list diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py new file mode 100644 index 0000000..e90eb88 --- /dev/null +++ b/buildtools/wafsamba/symbols.py @@ -0,0 +1,382 @@ +# a waf tool to extract symbols from object files or libraries +# using nm, producing a set of exposed defined/undefined symbols + +import Utils, Build, subprocess, Logs +from samba_wildcard import fake_build_environment +from samba_utils import * + +def symbols_extract(objfiles, dynamic=False): + '''extract symbols from objfile, returning a dictionary containing + the set of undefined and public symbols for each file''' + + ret = {} + + cmd = ["nm"] + if dynamic: + # needed for some .so files + cmd.append("-D") + cmd.extend(objfiles) + + nmpipe = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout + if len(objfiles) == 1: + filename = objfiles[0] + ret[filename] = { "PUBLIC": set(), "UNDEFINED" : set()} + + for line in nmpipe: + line = line.strip() + if line.endswith(':'): + filename = line[:-1] + ret[filename] = { "PUBLIC": set(), "UNDEFINED" : set() } + continue + cols = line.split(" ") + if cols == ['']: + continue + # see if the line starts with an address + if len(cols) == 3: + symbol_type = cols[1] + symbol = cols[2] + else: + symbol_type = cols[0] + symbol = cols[1] + if symbol_type in "BDGTRVWSi": + # its a public symbol + ret[filename]["PUBLIC"].add(symbol) + elif symbol_type in "U": + ret[filename]["UNDEFINED"].add(symbol) + + return ret + + +def real_name(name): + if name.find(".objlist") != -1: + name = name[:-8] + return name + + +def find_syslib_path(bld, libname, deps): + '''find the path to the syslib we will link against''' + # the strategy is to use the targets that depend on the library, and run ldd + # on it to find the real location of the library that is used + + linkpath = deps[0].link_task.outputs[0].abspath(bld.env) + + if libname == "python": + libname += bld.env.PYTHON_VERSION + + ret = None + + lddpipe = subprocess.Popen(['ldd', linkpath], stdout=subprocess.PIPE).stdout + for line in lddpipe: + line = line.strip() + cols = line.split(" ") + if len(cols) < 3 or cols[1] != "=>": + continue + if cols[0].startswith("lib%s." % libname.lower()): + ret = cols[2] + if cols[0].startswith("libc."): + # save this one too + bld.env.libc_path = cols[2] + return ret + + +def build_symbol_sets(bld, tgt_list): + '''build the public_symbols and undefined_symbols attributes for each target''' + + objlist = [] # list of object file + objmap = {} # map from object filename to target + + + for t in tgt_list: + t.public_symbols = set() + t.undefined_symbols = set() + for tsk in getattr(t, 'compiled_tasks', []): + for output in tsk.outputs: + objpath = output.abspath(bld.env) + objlist.append(objpath) + objmap[objpath] = t + + symbols = symbols_extract(objlist) + for obj in objlist: + t = objmap[obj] + t.public_symbols = t.public_symbols.union(symbols[obj]["PUBLIC"]) + t.undefined_symbols = t.undefined_symbols.union(symbols[obj]["UNDEFINED"]) + + t.undefined_symbols = t.undefined_symbols.difference(t.public_symbols) + + # and the reverse map of public symbols to subsystem name + bld.env.symbol_map = {} + + for t in tgt_list: + for s in t.public_symbols: + bld.env.symbol_map[s] = real_name(t.sname) + + targets = LOCAL_CACHE(bld, 'TARGET_TYPE') + + bld.env.public_symbols = {} + for t in tgt_list: + name = real_name(t.sname) + if name in bld.env.public_symbols: + bld.env.public_symbols[name] = bld.env.public_symbols[name].union(t.public_symbols) + else: + bld.env.public_symbols[name] = t.public_symbols + if t.samba_type == 'LIBRARY': + for dep in t.add_objects: + t2 = bld.name_to_obj(dep, bld.env) + bld.ASSERT(t2 is not None, "Library '%s' has unknown dependency '%s'" % (name, dep)) + bld.env.public_symbols[name] = bld.env.public_symbols[name].union(t2.public_symbols) + + +def build_syslib_sets(bld, tgt_list): + '''build the public_symbols for all syslibs''' + + # work out what syslibs we depend on, and what targets those are used in + syslibs = {} + objmap = {} + for t in tgt_list: + if getattr(t, 'uselib', []) and t.samba_type in [ 'LIBRARY', 'BINARY', 'PYTHON' ]: + for lib in t.uselib: + if lib in ['PYEMBED', 'PYEXT']: + lib = "python" + if not lib in syslibs: + syslibs[lib] = [] + syslibs[lib].append(t) + + # work out the paths to each syslib + syslib_paths = [] + for lib in syslibs: + path = find_syslib_path(bld, lib, syslibs[lib]) + if path is None: + print("Unable to find syslib path for %s used by %s" % lib) + if path is not None: + syslib_paths.append(path) + objmap[path] = lib.lower() + + # add in libc + syslib_paths.append(bld.env.libc_path) + objmap[bld.env.libc_path] = 'c' + + symbols = symbols_extract(syslib_paths, dynamic=True) + + # keep a map of syslib names to public symbols + bld.env.syslib_symbols = {} + for lib in symbols: + bld.env.syslib_symbols[lib] = symbols[lib]["PUBLIC"] + + # add to the map of symbols to dependencies + for lib in symbols: + for sym in symbols[lib]["PUBLIC"]: + bld.env.symbol_map[sym] = objmap[lib] + + # keep the libc symbols as well, as these are useful for some of the + # sanity checks + bld.env.libc_symbols = symbols[bld.env.libc_path]["PUBLIC"] + + # add to the combined map of dependency name to public_symbols + for lib in bld.env.syslib_symbols: + bld.env.public_symbols[objmap[lib]] = bld.env.syslib_symbols[lib] + +def build_autodeps(bld, t): + '''build the set of dependencies for a target''' + deps = set() + name = real_name(t.sname) + + targets = LOCAL_CACHE(bld, 'TARGET_TYPE') + + for sym in t.undefined_symbols: + if sym in t.public_symbols: + continue + if sym in bld.env.symbol_map: + depname = bld.env.symbol_map[sym] + if depname == name: + # self dependencies aren't interesting + continue + if t.in_library == [depname]: + # no need to depend on the library we are part of + continue + if depname in ['c', 'python']: + # these don't go into autodeps + continue + if targets[depname] in [ 'SYSLIB' ]: + deps.add(depname) + continue + t2 = bld.name_to_obj(depname, bld.env) + if len(t2.in_library) != 1: + deps.add(depname) + continue + if t2.in_library == t.in_library: + # if we're part of the same library, we don't need to autodep + continue -- Samba Shared Repository