Go to file
Jeffery To 37762abcb4
rust: Set rustflags by environment variable
In order to use $(RUSTC_TARGET_ARCH) in HOST_BUILD_DIR, the line to
include rust-values.mk in the Rust makefile was moved in
f489e019ac, causing it to be included
before package.mk is included.

This had the side effect of preventing "-lssp_nonshared" from being
added to RUSTC_LDFLAGS, because PKG_SSP is indirectly set by package.mk
(package.mk includes hardening.mk, hardening.mk sets PKG_SSP).

There is a deeper issue; it is the Rust package's PKG_SSP value that
causes RUSTC_LDFLAGS to be set and written to the Cargo config file. For
packages that use Rust to build, their PKG_SSP value does not affect the
linker flag.

This sets rustflags with the RUSTFLAGS environment variable, instead of
writing the value to the Cargo config file, allowing PKG_SSP from the
package being built to be used and for the package being built to modify
the rustflags used.

This also:

* Fix "-lssp_nonshared" being added to TARGET_CFLAGS instead of
  RUSTC_LDFLAGS, when CONFIG_PKG_CC_STACKPROTECTOR_STRONG is set.

* Remove the use of $(RUSTC_TARGET_ARCH) in HOST_BUILD_DIR and move the
  include line for rust-values.mk back to after package.mk.

  Since the host build directory was moved under the target build
  directory in efdbac38dc, it is no longer
  necessary to separate build directories with RUSTC_TARGET_ARCH;
  $(BUILD_DIR) already separates build directories by target.

* Add BUILDONLY:=1, as the Rust package does not build a target package.

* Install the Cargo config file as "config.toml" instead of "config", as
  this is the preferred form[1].

* Rename RUST_CFLAGS to RUSTC_CFLAGS and CONFIG_HOST_SUFFIX to
  RUSTC_HOST_SUFFIX, for consistency.

* Allow CARGO_VARS to be set before rust-values.mk is included.

[1]: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure

Fixes: f489e019ac ("rust: compile host package per target")
Fixes: 83785a7ce0 ("rust-lang: Add the rust language support")
Fixes: https://github.com/openwrt/packages/issues/22133

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-09-18 09:30:56 +08:00
.circleci CircleCI: Add 22.03 public keys, 18.06 v2 gpg key, 18.06 usign key 2022-05-11 16:40:55 +08:00
.github CI: Fix finding test script 2023-07-17 20:17:44 +08:00
.keys build: move gpg keys into .keys directory 2018-04-30 13:14:25 -07:00
admin syslog-ng: update to version 4.3.1 2023-09-15 09:27:40 +02:00
devel gitlab-runner: Update to 16.0.2 2023-06-22 21:38:36 +03:00
fonts/dejavu-fonts-ttf [dejavu-fonts] add license info and myself as maintainer 2017-02-22 18:39:54 +01:00
ipv6 treewide: remove AUTORELEASE 2023-04-21 22:46:58 +02:00
kernel ovpn-dco: fix package dependencies 2023-09-16 17:03:03 +08:00
lang rust: Set rustflags by environment variable 2023-09-18 09:30:56 +08:00
libs Merge pull request #21935 from G10h4ck/libssh-mbedtls 2023-09-10 20:07:49 +03:00
mail alpine: disable parallel build 2023-06-19 16:05:00 +03:00
multimedia ffmpeg: update to version 5.1.3 2023-09-17 09:46:19 +02:00
net iperf3: update to 3.15 2023-09-17 07:38:54 +02:00
sound mpd: Update to 0.23.13 2023-08-31 09:14:14 -07:00
utils podman: update to 4.6.2 2023-09-16 21:43:15 +08:00
CONTRIBUTING.md CONTRIBUTING: add CI information 2020-09-30 10:47:12 -10:00
LICENSE Add GPLv2 pro-forma license 2014-06-16 08:14:04 +02:00
README.md Update the SDK URL in the README. 2020-05-24 14:50:30 -07:00

README.md

OpenWrt packages feed

Description

This is the OpenWrt "packages"-feed containing community-maintained build scripts, options and patches for applications, modules and libraries used within OpenWrt.

Installation of pre-built packages is handled directly by the opkg utility within your running OpenWrt system or by using the OpenWrt SDK on a build system.

Usage

This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: OpenWrt Buildroot Installation on the OpenWrt support site.

This feed is enabled by default. To install all its package definitions, run:

./scripts/feeds update packages
./scripts/feeds install -a -p packages

License

See LICENSE file.

Package Guidelines

See CONTRIBUTING.md file.