source: rtems/cpukit/include/link_elf.h @ 2afb22b

5
Last change on this file since 2afb22b was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*      $NetBSD: link_elf.h,v 1.8 2009/11/04 19:28:03 pooka Exp $       */
2
3/*
4 * This only exists for GDB.
5 */
6
7#ifndef _LINK_ELF_H_
8#define _LINK_ELF_H_
9
10#include <sys/types.h>
11
12#include <machine/elf_machdep.h>
13#include <stdint.h>
14#include <rtems/rtl/rtl-obj-fwd.h>
15
16enum sections
17{
18  rap_text = 0,
19  rap_const = 1,
20  rap_ctor = 2,
21  rap_dtor = 3,
22  rap_data = 4,
23  rap_bss = 5,
24  rap_secs = 6
25};
26
27/**
28 * Object details.
29 */
30typedef struct
31{
32  const char* name;   /**< Section name. */
33  uint32_t    offset; /**< The offset in the elf file. */
34  uint32_t    size;   /**< The size of the section. */
35  uint32_t    rap_id; /**< Which obj does this section belongs to. */
36}section_detail;
37
38/**
39 * link map structure will be used for GDB support.
40 */
41struct link_map {
42  const char*       name;                 /**< Name of the obj. */
43  uint32_t          sec_num;              /**< The count of section. */
44  section_detail*   sec_detail;           /**< The section details. */
45  uint32_t*         sec_addr[rap_secs];   /**< The RAP section addr. */
46  uint32_t          rpathlen;             /**< The length of the path. */
47  char*             rpath;                /**< The path of object files. */
48  struct link_map*  l_next;               /**< Linked list of mapped libs. */
49  struct link_map*  l_prev;
50};
51
52/**
53 * r_debug is used to manage the debug related structures.
54 */
55struct r_debug {
56        int r_version;                        /* not used */
57        struct link_map *r_map;         /* list of loaded images */
58        enum {
59                RT_CONSISTENT,                /* things are stable */
60                RT_ADD,                             /* adding a shared library */
61                RT_DELETE                           /* removing a shared library */
62        } r_state;
63};
64
65/*
66 * stub function. It is empty.
67 */
68void _rtld_debug_state (void);
69
70/*
71 * add link map to the list.
72 */
73int _rtld_linkmap_add (rtems_rtl_obj_t* obj);
74
75/*
76 * Remove link map from the list.
77 */
78void _rtld_linkmap_delete (rtems_rtl_obj_t* obj);
79#endif  /* _LINK_ELF_H_ */
Note: See TracBrowser for help on using the repository browser.