summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/symbols.py
Commit message (Collapse)AuthorAgeFilesLines
* buildtools: Fix code spellingAndreas Schneider2023-03-281-1/+1
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org>
* python: Don't use deprecated escape sequencesAndreas Schneider2023-01-201-2/+2
| | | | | | | | | | | | | Certain escape sequences are not valid in Python string literals, and will eventually result in a SyntaxError. Follow up patch of 5045382c6dd04b1bae0eaaae823be908213ff079 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jan 20 09:06:49 UTC 2023 on atb-devel-224
* wafsamba: introduce SAMBA[3]_PLUGIN()Stefan Metzmacher2021-11-301-5/+5
| | | | | | | | | | | | | | | | | | | | This will be used to define plugins we provide to be used via dbopen/dlsym to external consumers. SAMBA_PLUGIN() is used instead of SAMBA_LIBRARY() in order to make it more strict that these plugins can't be used as normal depedency by other subsystems and libraries. With require_builtin_deps=True we make sure that only symbols explicitly marked with _PUBLIC_ are exported and we only link to system libraries and include all internal depedencies as builtin subsystems. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* wafsamba: introduce ↵Stefan Metzmacher2021-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | require_builtin_deps/provide_builtin_linking/builtin_cflags to SAMBA_{SUBSYSTEM,LIBRARY} The 'provide_builtin_linking=True' option that allows wscript files to specify that a SAMBA_{SUBSYSTEM,LIBRARY} will also create a builtin version of them in addition. The logic behind this is very similar to what we already have with the '--builtin-libraries=BUILTIN_LIBRARIES' configure option. This avoids the need for manual definitions of SAMBA_SUBSYSTEMS() with like this: bld.SAMBA_SUBSYSTEM('replace-hidden', source=REPLACE_SOURCE, group='base_libraries', hide_symbols=True, deps='dl attr' + extra_libs) The builtin version will also make sure that it will include all dependecies (of internal code) also in the builtin variant. Note that this is also possible if the dependency also provided 'provide_builtin_linking=True' in order to limit the scope. We now imply '-D_PUBLIC_=_PRIVATE_' and 'hide_symbols=True' for builtin libraries and subsystems in order to avoid exporting the symbols of them. With 'require_builtin_deps=True' a library can specify that it is only able to use libraries/subsystems marked with provide_builtin_linking=True. As a result it won't link against any other SAMBA_LIBRARY() dependency, but link in everything internal. Only system libraries still get linked dynamically. Use 'git show -w' to see a reduced diff. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* build: Remove workaround for missing os.path.relpath in Python < 2.6Andrew Bartlett2019-11-131-2/+2
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* wafsamba/symbols: change regex to match both rpath and runpath for different ↵Joe Guo2019-02-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | readelf output In `wafsamba.dumplicate_symbols` test, it will use Popen to call: readelf --dynamic bin/default/source3/lib/netapi/examples/netlogon/netlogon_control2 then try to find rpath lib lines from output with regex: re_rpath = re.compile(b'Library rpath: \[(.*)\]') In ubuntu 14.04 docker image, which current CI is using, the actual output from `readelf` is `runpath` instead of 'rpath': ... Library runpath: [/home/gitlab-runner/samba/bin/shared:/home/gitlab-runner/samba/bin/shared/private]\n' ... So the regex never matched, and hide a bug. In Ubuntu 1604 docker image, the output changes to `rpath` and matched the regex, which expose the error in previous commit. Improve the regex to match both `rpath` and `runpath`. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* wafsamba/symbols: always split Popen output by bytesJoe Guo2019-02-181-1/+2
| | | | | | | | | | | | | | | | | | | In py3, `wafsamba.duplicate_symbols` test may fail: ... elfpipe = subprocess.Popen(['readelf', '--dynamic', binname], stdout=subprocess.PIPE).stdout ... File "./buildtools/wafsamba/symbols.py", line 153, in get_libs rpath.extend(m.group(1).split(":")) TypeError: a bytes-like object is required, not 'str' Because Popen will always return bytestr even in py3, and ":" is a unicode str in py3. Change ":" to b":" to fix. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* waf-py3: Allow waf build --dup-symbol-check to operate in python3Andrew Bartlett2018-12-131-10/+10
| | | | | | | Use the b prefix on output from subcommands to match bytes with bytes. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* third_party:waf: update to upstream 2.0.4 releaseAlexander Bokovoy2018-09-051-6/+6
| | | | | | | | | Update third_party/waf/ to 2.0.4 to bring us closer to Python 3 This change requires a number of changes in buildtools/ too. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* build:wafsamba: removed most import * statementsThomas Nagy2015-10-281-3/+4
| | | | | | | | | | | | | The 'import *' statements make it more difficult to reason about the modules and tends to conceal bugs. These changes enable running pyflakes against most of the build scripts. Signed-off-by: Thomas Nagy <tnagy@waf.io> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Oct 28 12:52:17 CET 2015 on sn-devel-104
* build:wafsamba: Use the Waf 1.8 API get_tgen_by_name instead of name_to_objThomas Nagy2015-09-021-7/+7
| | | | | | | | | Signed-off-by: Thomas Nagy <tnagy@waf.io> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Sep 2 03:49:51 CEST 2015 on sn-devel-104
* wafsamba: Ignore some more symbols when checking for dupes.Jelmer Vernooij2012-10-111-1/+1
|
* build: Remove special case for the build farmAndrew Bartlett2012-08-211-1/+1
| | | | | | | | | | | Except in the formatting of the selftest output, this removes the special case of the build farm, so that an autobuild, a manual make test and the build farm are more similar. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Aug 21 06:39:04 CEST 2012 on sn-devel-104
* build:ignore solaris _GLOBAL_OFFSET_TABLE_ in duplicate symbol checkerAndrew Bartlett2012-05-101-0/+2
|
* build: Add duplicate symbol checking as part of make testAndrew Bartlett2011-09-081-6/+22
| | | | | | | | | | This ensures we do not get duplicate symbols again, when run as ./configure.developer on non-build farm machines. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Sep 8 13:37:40 CEST 2011 on sn-devel-104
* waf-symbols: don't look for symbol lists in GENERATOR targetsAndrew Tridgell2011-06-101-1/+1
| | | | | | generated header files are not object files Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* build: use readelf as a replacement for lddAndrew Tridgell2011-04-131-33/+77
| | | | | | | | using readelf allows us to do a non-recursive library listing, which is important to remove false positive symbol duplication Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Wed Apr 13 04:37:33 CEST 2011 on sn-devel-104
* build: speed up SYMBOLCHECK codeAndrew Tridgell2011-04-131-6/+41
| | | | | | | this uses a nm and ldd cache to speed up the duplicate symbol checking code Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* waf: a better way to detect duplicated symbolsAndrew Tridgell2011-04-061-20/+82
| | | | | | | | | | | | | | this detects when we have the same symbol linked in twice in any binary by using ldd and nm on the binary and its associated libraries. Some of these duplicates are caused by a subsystem being linked twice, and some are caused by two versions of the same function name being linked into a binary Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Wed Apr 6 06:44:14 CEST 2011 on sn-devel-104
* waf: prevent an error in the symbol checking codeAndrew Tridgell2011-03-231-1/+2
|
* build: don't display expected duplicate symbolsAndrew Tridgell2011-02-231-1/+6
|
* build: duplicate symbols between system libraries aren't interestingAndrew Tridgell2011-02-231-0/+10
| | | | | | | we expect dups in libpthread, libc and libattr Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Wed Feb 23 01:29:38 CET 2011 on sn-devel-104
* build: added WHYNEEDED=TARGET:DEPENDENCYAndrew Tridgell2011-02-221-9/+36
| | | | | | | | | | | | | | you can now do: make WHYNEEDED=smbd/smbd:gensec and it will print: Checking why smbd/smbd needs to link to gensec target 'smbd/smbd' uses symbols set(['open_schannel_session_store']) from 'gensec' Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Feb 22 03:35:58 CET 2011 on sn-devel-104
* build: enhanced the symbolcheck codeAndrew Tridgell2011-02-221-14/+86
| | | | | | we can now work out why a binary needs a library, and we can find all the duplicate symbols (we currently have 1087 symbols defined in more than one place in Samba).
* waf: less verbose message for failing to resolve a syslib pathAndrew Tridgell2010-12-011-1/+1
|
* waf: use Logs.warn() instead of print() in the symbol check codeAndrew Tridgell2010-12-011-1/+1
|
* waf: added --symbol-check optionAndrew Tridgell2010-10-301-47/+121
| | | | | | | | | | | | | 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 <abartlet@samba.org>
* waf: added env.DEVELOPER_MODE flagAndrew Tridgell2010-10-301-0/+308
this makes it easier to add project rules that are only run in developer mode Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>