"Fossies" - the Fresh Open Source Software Archive

Member "qt-everywhere-src-6.3.1/qtwebengine/src/3rdparty/chromium/third_party/dpkg-shlibdeps/patches/0001-dkpg-shlibdeps-add-option-to-ignore-weak-undefined-symbols.patch" (8 Jun 2022, 2839 Bytes) of package /linux/misc/qt-everywhere-src-6.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From 59477dae6f2c68f0ebd9ccca18e737b67408bc11 Mon Sep 17 00:00:00 2001
    2 From: Tom Anderson <thomasanderson@chromium.org>
    3 Date: Wed, 8 Jan 2020 10:55:20 -0800
    4 Subject: [PATCH 1/2] dkpg-shlibdeps: Add option to ignore weak undefined
    5  symbols
    6 
    7 Weak undefined symbols can be used to test feature support. For example:
    8 
    9 __attribute__((weak)) uint64_t gbm_bo_get_modifier(struct gbm_bo* bo);
   10 void foo(gbm_bo* bo) {
   11     // gbm_create_device is a strong undefined symbol. The dynamic linker will
   12     // fail if this is not available.
   13     gbm_create_device(1234);
   14     // gbm_bo_get_modifier is a weak undefined symbol. It will be NULL if it's
   15     // not available.
   16     if (gbm_bo_get_modifier)
   17         gbm_bo_get_modifier(bo);
   18 }
   19 
   20 However currently, dpkg-shlibdeps would consider gbm_bo_get_modifier in the
   21 example to be a required symbol (and would increase the minimum required library
   22 version), even though the intention is to use it only if it is available.
   23 
   24 To address this, this change skips weak undefined symbols when checking for
   25 dependencies. Out of an abundance of caution, this behavior is guarded behind a
   26 new flag: --ignore-weak-undefined.
   27 ---
   28  scripts/dpkg-shlibdeps.pl | 6 ++++++
   29  1 file changed, 6 insertions(+)
   30 
   31 diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
   32 index 8142c85b4..e3d8c7200 100755
   33 --- a/scripts/dpkg-shlibdeps.pl
   34 +++ b/scripts/dpkg-shlibdeps.pl
   35 @@ -67,6 +67,7 @@ my $varlistfile = 'debian/substvars';
   36  my $varlistfilenew;
   37  my $varnameprefix = 'shlibs';
   38  my $ignore_missing_info = 0;
   39 +my $ignore_weak_undefined = 0;
   40  my $warnings = WARN_SYM_NOT_FOUND | WARN_DEP_AVOIDABLE;
   41  my $debug = 0;
   42  my @exclude = ();
   43 @@ -120,6 +121,8 @@ foreach (@ARGV) {
   44     }
   45      } elsif (m/^--ignore-missing-info$/) {
   46     $ignore_missing_info = 1;
   47 +    } elsif (m/^--ignore-weak-undefined$/) {
   48 +   $ignore_weak_undefined = 1;
   49      } elsif (m/^--warnings=(\d+)$/) {
   50     $warnings = $1;
   51      } elsif (m/^-t(.*)$/) {
   52 @@ -365,6 +368,7 @@ foreach my $file (keys %exec) {
   53      }
   54      debug(2, 'Analyzing all undefined symbols');
   55      foreach my $sym ($obj->get_undefined_dynamic_symbols()) {
   56 +   next if $ignore_weak_undefined && $sym->{weak};
   57     my $name = $sym->{name};
   58     if ($sym->{version}) {
   59         $name .= '@' . "$sym->{version}";
   60 @@ -610,6 +614,8 @@ sub usage {
   61                               in the given build directory.
   62    -v                       enable verbose mode (can be used multiple times).
   63    --ignore-missing-info    don't fail if dependency information can't be found.
   64 +  --ignore-weak-undefined  only allow strong undefined symbols to introduce
   65 +                             dependencies.
   66    --warnings=<value>       define set of active warnings (see manual page).
   67    --admindir=<directory>   change the administrative directory.
   68    -?, --help               show this help message.
   69 -- 
   70 2.25.0.rc1.283.g88dfdc4193-goog
   71