Skip to content
Snippets Groups Projects
This project is mirrored from https://git.openwrt.org/openwrt/openwrt.git. Pull mirroring updated .
  1. Jan 14, 2025
  2. Dec 12, 2024
  3. Nov 13, 2024
  4. Oct 29, 2024
    • Christian Marangi's avatar
      build: permit overwrite PACKAGE_DIR and PACKAGE_DIR_ALL · 5667b380
      Christian Marangi authored
      
      Permit to overwrite PACKAGE_DIR and PACKAGE_DIR_ALL variables in
      rules.mk.
      
      This is to handle a special case with the ImageBuilder where these
      variable are overwrite.
      
      The main problem is that any include calling rules.mk again (example
      image.mk) will set these variables again dropping the modified value.
      
      To keep the modified value, set the PACKAGE_DIR and PACKAGE_DIR_ALL only
      if not already set. This permits the ImageBuilder to use custom
      directory instead of the default one defined in rules.mk.
      
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Unverified
      5667b380
  5. Jul 08, 2024
  6. Jun 27, 2024
    • Michael Pratt's avatar
      build: add test for 64-bit time support · 39e8ef33
      Michael Pratt authored
      
      Several GNU tools such as tar, coreutils, and findutils
      now build with support for 64-bit time by default
      and otherwise require reconfiguring with a flag
      --disable-year2038 in order to build without 64-bit time.
      
      Some standard C libraries, for example,
      certain older versions of glibc such as 2.31
      have large file support but not long time bits support:
      
        checking for ... option to enable large file support... -D_FILE_OFFSET_BITS=64
        checking for ... option for timestamps after 2038... support not detected
      
      This test using C code taken from largefile.m4 in gnulib
      uses math and casting to check for overflow
      with a macro and array pair that can only be defined
      when 64-bit time support is present, and otherwise errors.
      It is the exact same code used to test for 64-bit time
      during the configure stage of building these tools,
      so the results of this test before configure takes place
      will always be in concordance with the results of
      the test that takes place during the configure script.
      
      Based on the test, the configure flag --disable-year2038
      is added to every host tool build depending on the host system.
      
      When the year 2038 problem finally comes around,
      the effect of the test can be converted
      from the toggling of a configure option into a build prerequisite,
      requiring it to pass in order to continue building.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      Link: https://github.com/openwrt/openwrt/pull/15799
      
      
      Signed-off-by: default avatarRobert Marko <robimarko@gmail.com>
      39e8ef33
  7. May 18, 2024
  8. Apr 21, 2024
    • Christian Marangi's avatar
      toolchain/wrapper: fill and reference info.mk in staging_dir ext toolchain · 0e161968
      Christian Marangi authored
      
      Currently when external toolchain is used, a info.mk is created (with
      to-be-filled values) but is never actually filled with real values and
      is never actually used in rules.mk.
      
      This info.mk is used down the code with special packages like libgcc to
      reference info like gcc version and package special library.
      
      To mimic what is done with internal toolchain, add the include in
      rules.mk for info.mk also for external library and in fix
      toolchain/wrapper to fill the staging_dir info.mk.
      
      The logic is to check if the external toolchain provide an info.mk and
      if it doesn't we at least fill the GCC_VERSION with the value set in the
      .config file.
      
      With this special library like libgcc correctly reference and have set the
      GCC_VERSION variable.
      
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Unverified
      0e161968
  9. Oct 20, 2023
  10. Aug 15, 2023
  11. Jul 05, 2023
  12. Jun 05, 2023
    • Michael Pratt's avatar
      treewide: add ORIG_PATH variable · d87a8aa1
      Michael Pratt authored
      
      Add a variable that stores the original value of $PATH
      in the host system's shell, before Make alters it.
      
      This can be useful for when it is necessary
      to ignore symlinks and programs made by the build system.
      
      Define this new variable before all instances of
      'export PATH:=' or similar.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      Unverified
      d87a8aa1
  13. May 04, 2023
    • Michael Pratt's avatar
      tools: add gnulib source · fe33d5ba
      Michael Pratt authored
      
      By having a local copy of gnulib, we can:
      import the latest macro fixes into any package,
      get rid of some statically stored macros that were otherwise missing,
      bootstrap GNU tools with the latest relevant source
      without having to wait for a release or rely on git submodules,
      and possibly more...
      
      The patch assists in bootstrapping by ignoring
      the building of po files using gettext,
      and also to allow a user-defined path to a program
      to include parameters.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      Unverified
      fe33d5ba
    • Michael Pratt's avatar
      prereq-build: add check for true and false · ffd7c05a
      Michael Pratt authored
      
      Some uses cases, like with autotools, need a path for 'true'
      if we use them to force something to skip.
      
      This will work by default on Linux hosts,
      and require MacOS hosts to get coreutils,
      which is currently installed in the CI
      for 'macos-latest' host.
      
      In the future, prereq stage can be reworked
      to search for the actual binary
      instead of relying on env.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      Unverified
      ffd7c05a
  14. Mar 27, 2023
    • Michael Pratt's avatar
      rules.mk: add FILECMD variable · 2bb8e4a8
      Michael Pratt authored
      
      Some packages using Libtool have the possibility
      of using this environment variable if set,
      instead of the direct command for "file" using PATH,
      or the need to patch a hard-coded path.
      
      This is a new feature of Libtool 2.4.7
      
      Ref: bf261073 ("tools/libtool: bump to 2.4.7")
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      2bb8e4a8
  15. Mar 06, 2023
  16. Jan 10, 2023
    • Christian Marangi's avatar
      treewide: derive host and hostpkg path from STAGING_DIR · 2a328364
      Christian Marangi authored
      
      STAGING_DIR may be provided from command line. We currently hardcoded
      STAGING_DIR_HOST and STAGING_DIR_HOSTPKG to the default location but we
      currently have some relocatable patch that derive the path from
      STAGING_DIR.
      
      Fix this and correctly derive STAGING_DIR_HOST and STAGING_DIR_HOSTPKG
      from STAGING_DIR.
      
      The intention is to fix inconsistency from the relocatable patch and the
      use of STAGING_DIR_HOST that is always hardcoded.
      This with a wrong configuration may end up in broken state with some
      host tools expecing a PATH from STAGING_DIR and others using library
      from the default staging_dir/host path.
      
      To save downstream project the original implementation is saved while
      fixing the inconsistency between patch and .mk.
      
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Unverified
      2a328364
  17. Dec 26, 2022
    • Christian Marangi's avatar
      rules: drop -Wno-error additional flags from default TARGET_CFLAGS · 5db4fbad
      Christian Marangi authored
      
      We currently enable -Wno-error=unused-but-set-variable and
      -Wno-error=unused-result by default on every compile package.
      
      While this is (relatively) unharmful, we should follow other project
      direction and starts enforcing good code quality. For example the linux
      kernel recently started to enforce Wall by default and clean code is
      mandatory for inclusion.
      
      Drop for good these flags and and make it mandatory to correctly handle
      return values at least with a warning log if they are not strictly error
      condition.
      
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Unverified
      5db4fbad
  18. Dec 18, 2022
  19. Oct 05, 2022
  20. Sep 23, 2022
    • Michael Pratt's avatar
      rules.mk: add option to download files into a subdirectory · 59db2868
      Michael Pratt authored
      
      Some packages download a single raw file or set of raw files
      instead of an archive.
      
      The filenames of these download files have names and version numbers
      that do not directly correspond to the name and version of the package
      as it is defined in its Makefile.
      
      To better organize downloaded files, this adds the option of
      creating a subdirectory in the download directory for these files
      that can be named with package specific variables.
      
      DL_DIR is now a recursively expanded variable
      since the value now depends on whether DL_SUBDIR is defined.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      59db2868
  21. Sep 10, 2022
    • Josh Roys's avatar
      scripts: always check certificates · 90c6e3ae
      Josh Roys authored
      
      Remove flags from wget and curl instructing them to ignore bad server
      certificates. Although other mechanisms can protect against malicious
      modifications of downloads, other vectors of attack may be available
      to an adversary.
      
      TLS certificate verification can be disabled by turning oof the
      "Enable TLS certificate verification during package download" option
      enabled by default in the "Global build settings" in "make menuconfig"
      
      Signed-off-by: default avatarJosh Roys <roysjosh@gmail.com>
      [ add additional info on how to disable this option ]
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Unverified
      90c6e3ae
  22. Jul 25, 2022
  23. Jun 21, 2022
  24. Jan 24, 2022
    • Felix Fietkau's avatar
      build: change PYTHON to python3 · f8bc8fa3
      Felix Fietkau authored
      
      On recent macOS, /usr/bin/python3 is a wrapper that finds the right python executable
      It checks argv[0] to determine if python2 or python3 should be called. Always execute
      it as python3 to ensure it calls the right version
      
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      f8bc8fa3
  25. Jan 17, 2022
  26. Sep 20, 2021
  27. Jun 12, 2021
  28. May 13, 2021
    • Leonardo Mörlein's avatar
      build: introduce $(MKHASH) · b993b68b
      Leonardo Mörlein authored
      
      Before this commit, it was assumed that mkhash is in the PATH. While
      this was fine for the normal build workflow, this led to some issues if
      
          make TOPDIR="$(pwd)" -C "$pkgdir" compile
      
      was called manually. In most of the cases, I just saw warnings like this:
      
          make: Entering directory '/home/.../package/gluon-status-page'
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          bash: line 1: mkhash: command not found
          [...]
      
      While these were only warnings and the package still compiled sucessfully,
      I also observed that some package even fail to build because of this.
      
      After applying this commit, the variable $(MKHASH) is introduced. This
      variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the
      correct path.
      
      Signed-off-by: default avatarLeonardo Mörlein <me@irrelefant.net>
      b993b68b
  29. Mar 25, 2021
    • Philip Prindeville's avatar
      build: make sure asm gets built with -DPIC · af22991e
      Philip Prindeville authored
      
      Fixes issue openwrt/packages#14921, whereby inline ASM wasn't getting
      built as PIC; look at gmp-6.2.1/mpn/x86/pentium/popcount.asm for
      example:
      
      ifdef(`PIC',`
      ...
      
      for a routine that exists in both PIC and non-PIC versions.
      
      Make sure that wherever $(FPIC) gets passed as a variable expansion
      that it gets quoted where necessary (such as setting environment
      variables in shell commands).
      
      Signed-off-by: default avatarPhilip Prindeville <philipp@redfish-solutions.com>
      af22991e
  30. Feb 16, 2021
  31. Feb 15, 2021
    • Felix Fietkau's avatar
      build: add support for fixing up library soname · b12288fa
      Felix Fietkau authored
      
      This makes it possible to declare a package ABI_VERSION independent from the
      upstream soname by setting PKG_ABI_VERSION in the package makefile.
      The library filename is fixed up for files installed to packages and to the
      staging dir. References to the original from executables within the same
      package are also fixed up
      
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      b12288fa
  32. Feb 05, 2021
  33. Jan 31, 2021
  34. Jan 27, 2021
    • Paul Spooren's avatar
      rules: fix COMMITCOUNT logic · 513f7171
      Paul Spooren authored
      
      The newly added $(COMMITCOUNT) variable was wrongly increased by plus
      one. The addition should have been only added to $(AUTORELEASE) as
      OpenWrt traditionally starts counting at one rather than zero.
      
      $(AUTORELEASE) counts the commits since the last bump, which is zero on
      the version bump commit itself.
      
      This commit increases $(AUTORELEASE) by one while leaving $(COMMITCOUNT)
      as is.
      
      The base-files package is the only package using $(COMMITCOUNT) so far
      and requires a pseudo commit to keep the PKG_RELEASE correct. A non
      functional change (Copyright bump) is done in the next commit.
      
      Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
      513f7171
  35. Jan 23, 2021
    • Paul Spooren's avatar
      rules: add AUTORELEASE and COMMITCOUNT variables · 9ae3c6f9
      Paul Spooren authored
      
      The lack of bumped PKG_RELEASE variables is a recurring theme on the
      mailing list and in GitHub comments. This costs precious review time,
      a rare good within the OpenWrt project.
      
      Instead of relying on a manually set PKG_RELEASE this commit adds a
      `commitcount` function that uses the number of Git commits to determine
      the release. The function is called via the variables `$(AUTORELEASE)`
      or `$(COMMITCOUNT)`. The `PKG_RELEASE` variable can be set to either of
      the two.
      
      - $(AUTORELEASE):
      
      Release is automagically set to the number of commits since the last
      commit containing either ": update to " or ": bump to ".
      
      Example below:
      
          $ git log packages/foobar/
          foobar: fixup file location
          foobar: disable docs
          foobar: bump to 5.3.2
          foobar: fixup copyright
      
      Resulting package name: foobar_5.3.2-3_all.ipk, two package changes
      since the last upstream version change, using a 1 based counter.
      
      - $(COMMITCOUNT):
      
      For non-traditional versioning (x.y.z), most prominent `base-files`,
      this variable contains the total number of package commits.
      
      The new functionality can also be used by other feeds like packages.git.
      
      In case no build information is available, e.g. when using release
      tarballs, the SOURCE_DATE_EPOCH is used to have a reproducible release
      identifier.
      
      Suggested-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
      9ae3c6f9
  36. Dec 08, 2020
    • Stijn Tintel's avatar
      rules.mk: use -fPIC instead of -fpic on arm64 · 0eb2fa39
      Stijn Tintel authored
      
      Some packages fail to build on arm64 when PKG_ASLR_PIE_ALL=y, due to
      machine-specific size restrictions on the global offset table.
      While the manual instructs to recompile with -fPIC if it fails with
      -fpic, by doing this per package, there is still a risk of random
      breakage due to version bumps or other changes, so let's use -fPIC on
      arm64 by default.
      
      While comparing the sizes of 141 packages built with -fpic vs -fPIC,
      most packages are either equal or smaller in size. Only 9 of the
      compared packages turned out slightly larger.
      
      Signed-off-by: default avatarStijn Tintel <stijn@linux-ipv6.be>
      0eb2fa39
Loading