1 /* Copyright (C) 2022-2023 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING3. If not see
17 <http://www.gnu.org/licenses/>. */
21 #include "coretypes.h"
25 /* Perform early driver flags initializations that can't be achieved
26 with specs. In particular, we need to explicitly request a static
27 link for rtps by default before lang_specific_driver gets control. */
29 void vxworks_driver_init (unsigned int *in_decoded_options_count
,
30 struct cl_decoded_option
**in_decoded_options
)
33 struct cl_decoded_option
*decoded_options
= *in_decoded_options
;
35 /* Arrange to add -static if we are going to link a rtp and there is no
36 trace of any explicit request for a specific kind of link. */
37 bool wont_link
= false;
39 bool link_kind_indication
= false;
41 /* The new argument list will be contained in this. */
42 struct cl_decoded_option
*new_decoded_options
;
43 unsigned int num_options
= *in_decoded_options_count
;
45 for (i
= 1; i
< num_options
; i
++)
47 if (decoded_options
[i
].errors
& CL_ERR_MISSING_ARG
)
50 switch (decoded_options
[i
].opt_index
)
57 link_kind_indication
= true;
66 case OPT_fsyntax_only
:
79 if (!wont_link
&& mrtp
&& !link_kind_indication
)
82 new_decoded_options
= XNEWVEC(struct cl_decoded_option
, num_options
);
84 for (i
= 0; i
< num_options
- 1; i
++)
85 new_decoded_options
[i
] = decoded_options
[i
];
87 generate_option(OPT_static
, NULL
, 1, CL_DRIVER
,
88 &new_decoded_options
[num_options
- 1]);
90 *in_decoded_options
= new_decoded_options
;
91 *in_decoded_options_count
= num_options
;