Go to file
Torsten Rasmussen da3726006b cmake: newlib linking flags -lc and -lgcc circular dependency
Fixes: #28650

Linking with newlib now defines the following linker flags as:
```
${CMAKE_C_LINKER_WRAPPER_FLAG}${CMAKE_LINK_LIBRARY_FLAG}c
${CMAKE_C_LINKER_WRAPPER_FLAG}${CMAKE_LINK_LIBRARY_FLAG}gcc
c
```

This is needed because when linking with newlib on aarch64, then libgcc
has a link dependency to libc (strchr), but libc also has dependencies
to libgcc.

CMake is capable of handling circular link dependencies for CMake
defined static libraries, which can be further controlled using
`LINK_INTERFACE_MULTIPLICITY`.

However, libc and libgcc are not regular CMake libraries, and is seen as
linker flags by CMake, and thus symbol de-duplications will be
performed.

CMake link options cannot be used, as that will place those libs first
on the linker invocation. -Wl,--start-group is problematic as the
placement of -lc and -lgcc is not guaranteed in case later libraries are
also using -lc / -libbgcc as interface linker flags.

Thus, we resort to use
`${CMAKE_C_LINKER_WRAPPER_FLAG}${CMAKE_LINK_LIBRARY_FLAG}`
as this ensures the uniqueness and thus avoids symbol de-duplication
which means libc will be followed by libgcc, which is finally followed
by libc again.

It would have been possible to use `-lc` directly, but there is a risk
that an externally library is also adding `-lc` and thus de-duplication
and re-arrangement of this flag happens. This risk is in theory also
existing with this fix, but the long nature of this link flag with using
`${CMAKE_C_LINKER_WRAPPER_FLAG}` would likely indicate a similar fix and
thus those libraries will stay in order.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-20 09:25:38 -05:00
.buildkite ci: update docker image to v0.11.12 2021-01-18 17:09:22 -05:00
.github actions: run manifest workflow only on manifest changes 2021-01-19 11:50:39 -06:00
.known-issues doc: update known-issues for Sphinx==3.3.0 2020-11-03 15:27:37 +01:00
arch x86: cache: Use new cache APIs 2021-01-19 14:31:02 -05:00
boards boards: arm: stm32: Adjust maximum speed for STM32F746G disco board 2021-01-20 08:08:11 -06:00
cmake cmake: zephyr modules: sanitize all module name when used as variable 2021-01-20 12:59:19 +01:00
doc doc/release-note: mcuboot bootutil_public library record 2021-01-20 14:49:44 +01:00
drivers drivers: pwm: add driver for the NXP Kinetis Pulse Width Timer (PWT) 2021-01-20 08:05:57 -06:00
dts dts: arm: nxp: ke1xf: add PWT devicetree node 2021-01-20 08:05:57 -06:00
include api: add C++ friendly version of Z_TIMEOUT_TICKS. 2021-01-20 09:23:20 -05:00
kernel cache: Expand the APIs for cache flushing 2021-01-19 14:31:02 -05:00
lib cmake: newlib linking flags -lc and -lgcc circular dependency 2021-01-20 09:25:38 -05:00
misc
modules modules: mcux: add support for indicating the presence of PWT 2021-01-20 08:05:57 -06:00
samples samples: drivers: gpio: remove stray board file 2021-01-20 09:15:53 -05:00
scripts cmake: zephyr modules: sanitize all module name when used as variable 2021-01-20 12:59:19 +01:00
share
soc drivers: pwm: add driver for the NXP Kinetis Pulse Width Timer (PWT) 2021-01-20 08:05:57 -06:00
subsys Bluetooth: controller: Fix error when max ant. pattern len not defined 2021-01-20 14:55:24 +01:00
tests tests: drivers: pwm: loopback: add support for twr_ke18f board 2021-01-20 08:05:57 -06:00
.checkpatch.conf checkpatch: ignore TRAILING_SEMICOLON and COMPLEX_MACRO 2021-01-19 10:17:23 -05:00
.clang-format
.codecov.yml
.editorconfig
.gitattributes
.gitignore gitignore: add twister-out 2020-12-11 14:13:02 -05:00
.gitlint
.mailmap
.uncrustify.cfg
CMakeLists.txt cmake: zephyr modules: sanitize all module name when used as variable 2021-01-20 12:59:19 +01:00
CODE_OF_CONDUCT.md
CODEOWNERS ipc: RPMsg service to register multiple endpoints 2021-01-19 22:07:09 +01:00
CONTRIBUTING.rst
Kconfig
Kconfig.zephyr modules: introducing MODULE_EXT_ROOT to allow glue code in Zephyr repo 2021-01-18 18:02:46 +01:00
LICENSE
MAINTAINERS.yml drivers: PSCI: Add driver and subsystem 2021-01-18 19:06:53 +01:00
Makefile doc Makefile: convert to a real Makefile to get rid of duplication 2021-01-11 19:27:06 -05:00
README.rst
VERSION release: Update patch level to 99 after the 2.4.0 release 2020-09-27 15:15:49 -05:00
version.h.in
west.yml manifest: update hal_nxp to support the Pulse Width Timer 2021-01-20 08:05:57 -06:00
zephyr-env.cmd
zephyr-env.sh

.. raw:: html

   <a href="https://www.zephyrproject.org">
     <p align="center">
       <img src="doc/images/Zephyr-Project.png">
     </p>
   </a>

   <a href="https://bestpractices.coreinfrastructure.org/projects/74"><img
   src="https://bestpractices.coreinfrastructure.org/projects/74/badge"></a>
   <a href="https://buildkite.com/zephyr/zephyr">
   <img
   src="https://badge.buildkite.com/f5bd0dc88306cee17c9b38e78d11bb74a6291e3f40e7d13f31.svg?branch=master"></a>


The Zephyr Project is a scalable real-time operating system (RTOS) supporting
multiple hardware architectures, optimized for resource constrained devices,
and built with security in mind.

The Zephyr OS is based on a small-footprint kernel designed for use on
resource-constrained systems: from simple embedded environmental sensors and
LED wearables to sophisticated smart watches and IoT wireless gateways.

The Zephyr kernel supports multiple architectures, including ARM Cortex-M,
Intel x86, ARC, Nios II, Tensilica Xtensa, and RISC-V, and a large number of
`supported boards`_.

.. below included in doc/introduction/introduction.rst

.. start_include_here

Getting Started
***************

Welcome to Zephyr! See the `Introduction to Zephyr`_ for a high-level overview,
and the documentation's `Getting Started Guide`_ to start developing.

Community Support
*****************

Community support is provided via mailing lists and Slack; see the Resources
below for details.

.. _project-resources:

Resources
*********

Here's a quick summary of resources to help you find your way around:

* **Help**: `Asking for Help Tips`_
* **Documentation**: http://docs.zephyrproject.org (`Getting Started Guide`_)
* **Source Code**: https://github.com/zephyrproject-rtos/zephyr is the main
  repository; https://elixir.bootlin.com/zephyr/latest/source contains a
  searchable index
* **Releases**: https://github.com/zephyrproject-rtos/zephyr/releases
* **Samples and example code**: see `Sample and Demo Code Examples`_
* **Mailing Lists**: users@lists.zephyrproject.org and
  devel@lists.zephyrproject.org are the main user and developer mailing lists,
  respectively. You can join the developer's list and search its archives at
  `Zephyr Development mailing list`_. The other `Zephyr mailing list
  subgroups`_ have their own archives and sign-up pages.
* **Nightly CI Build Status**: https://lists.zephyrproject.org/g/builds
  The builds@lists.zephyrproject.org mailing list archives the CI
  (shippable) nightly build results.
* **Chat**: Zephyr's Slack workspace is https://zephyrproject.slack.com.  Use
  this `Slack Invite`_ to register.
* **Contributing**: see the `Contribution Guide`_
* **Wiki**: `Zephyr GitHub wiki`_
* **Issues**: https://github.com/zephyrproject-rtos/zephyr/issues
* **Security Issues**: Email vulnerabilities@zephyrproject.org to report
  security issues; also see our `Security`_ documentation. Security issues are
  tracked separately at https://zephyrprojectsec.atlassian.net.
* **Zephyr Project Website**: https://zephyrproject.org

.. _Slack Invite: https://tinyurl.com/y5glwylp
.. _supported boards: http://docs.zephyrproject.org/latest/boards/index.html
.. _Zephyr Documentation: http://docs.zephyrproject.org
.. _Introduction to Zephyr: http://docs.zephyrproject.org/latest/introduction/index.html
.. _Getting Started Guide: http://docs.zephyrproject.org/latest/getting_started/index.html
.. _Contribution Guide: http://docs.zephyrproject.org/latest/contribute/index.html
.. _Zephyr GitHub wiki: https://github.com/zephyrproject-rtos/zephyr/wiki
.. _Zephyr Development mailing list: https://lists.zephyrproject.org/g/devel
.. _Zephyr mailing list subgroups: https://lists.zephyrproject.org/g/main/subgroups
.. _Sample and Demo Code Examples: http://docs.zephyrproject.org/latest/samples/index.html
.. _Security: http://docs.zephyrproject.org/latest/security/index.html
.. _Asking for Help Tips: https://docs.zephyrproject.org/latest/guides/getting-help.html