* [patch] vxworks; Fix the vx_crtstuff handling of kernel/rtp variations
@ 2020-10-16 16:19 Olivier Hainque
0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2020-10-16 16:19 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]
Hello,
The VxWorks ports come with specific crtstuff objects to cope
with the variety of possible means to load code on a target, as
kernel modules or RTPS (Real Time Processes).
Compilation of those objects is currently explicitly replicated
for the two modes, through t-vxcrtstuff:
EXTRA_PARTS += vx_crtbegin-kernel.o vx_crtbegin-rtp.o vx_crtend.o
... where the difference between "-kernel" and "-rtp" is to pass -mrtp
in the compilation options.
But the ports that support RTPs already achieve that distinction
through the multilib mechanism, so we end up with nonsensical
object sets like:
./lib/gcc/powerpc-wrs-vxworks7r2/10.2.1/mrtp/vx_crtbegin-rtp.o
./lib/gcc/powerpc-wrs-vxworks7r2/10.2.1/mrtp/vx_crtend.o
./lib/gcc/powerpc-wrs-vxworks7r2/10.2.1/mrtp/vx_crtbegin-kernel.o
./lib/gcc/powerpc-wrs-vxworks7r2/10.2.1/vx_crtbegin-rtp.o
./lib/gcc/powerpc-wrs-vxworks7r2/10.2.1/vx_crtend.o
./lib/gcc/powerpc-wrs-vxworks7r2/10.2.1/vx_crtbegin-kernel.o
This patch just removes the bogus explicit distinction and
leaves it all to the multilib circuitry.
Tested by verifying that our gcc-10 based toolchain behave as
intended after the change, both for VxWorks 6.9 and 7.2, and by
a sanity check build of mainline for VxWorks 6.9.
Olivier
2020-10-15 Olivier Hainque <hainque@adacore.com>
libgcc/
* config/t-vxcrtstuff: Remove the -kernel/-rtp specialization.
gcc/
* config/vxworks.h (VX_CRTBEGIN_SPEC): Likewise.
[-- Attachment #2: vxcrt_multilib.txt --]
[-- Type: text/plain, Size: 1447 bytes --]
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index d3c417e7f5ae..5b1538085e9e 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -158,8 +158,7 @@ along with GCC; see the file COPYING3. If not see
/* Setup the crtstuff begin/end we might need for dwarf EH registration. */
#if !defined(CONFIG_SJLJ_EXCEPTIONS) && DWARF2_UNWIND_INFO
-#define VX_CRTBEGIN_SPEC \
- "%{!mrtp:vx_crtbegin-kernel.o%s} %{mrtp:vx_crtbegin-rtp.o%s}"
+#define VX_CRTBEGIN_SPEC "vx_crtbegin.o%s"
#define VX_CRTEND_SPEC "-l:vx_crtend.o"
#else
#define VX_CRTBEGIN_SPEC ""
diff --git a/libgcc/config/t-vxcrtstuff b/libgcc/config/t-vxcrtstuff
index 96b728525e04..ef64951c9038 100644
--- a/libgcc/config/t-vxcrtstuff
+++ b/libgcc/config/t-vxcrtstuff
@@ -1,12 +1,12 @@
-# crtbegin/crtend for VxWorks (DKM or RTP)
+# crtbegin/crtend for VxWorks
-vx_crtbegin-kernel.o: $(srcdir)/config/vxcrtstuff.c
+vx_crtbegin.o: $(srcdir)/config/vxcrtstuff.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_BEGIN -c $<
-vx_crtbegin-rtp.o: $(srcdir)/config/vxcrtstuff.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_BEGIN -c $< -mrtp
-
vx_crtend.o: $(srcdir)/config/vxcrtstuff.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_END -c $<
-EXTRA_PARTS += vx_crtbegin-kernel.o vx_crtbegin-rtp.o vx_crtend.o
+# We do pretty different things for kernel vs rtp modes, all
+# controlled thanks to __RTP__ and (optional) multilibs.
+
+EXTRA_PARTS += vx_crtbegin.o vx_crtend.o
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-16 16:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 16:19 [patch] vxworks; Fix the vx_crtstuff handling of kernel/rtp variations Olivier Hainque
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).