public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, alpha] Move linux-specific specfile definitions to linux.h
@ 2017-09-03 15:47 Maya Rashish
  2017-10-13 17:14 ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Maya Rashish @ 2017-09-03 15:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: coypu, krister.walfridsson, rth

Hi, in my first attempt to fix a build issue I found that the order of
tm files matters, would prefer to move linux-looking parts of elf.h to
linux.h.

other targets that include alpha/elf.h besides linux:
openbsd:  provides their own STARTFILE_SPEC and ENDFILE_SPEC in later file:
https://github.com/openbsd/ports/blob/master/lang/gcc/6/patches/patch-gcc_config_alpha_openbsd_h
freebsd:  dropped alpha in freebsd 7.0 (2008)

Built trunk on netbsd/alpha (until I out of spaced with a working stage3
after two days :-)) with some extra modifications.

---
 gcc/config/alpha/elf.h   | 26 --------------------------
 gcc/config/alpha/linux.h | 26 ++++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index c109b07c5..8a435dbc0 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -100,32 +100,6 @@ do {									\
     ASM_OUTPUT_DEF (FILE, alias, name);				\
   } while (0)
 
-/* Provide a STARTFILE_SPEC appropriate for ELF.  Here we add the
-   (even more) magical crtbegin.o file which provides part of the
-   support for getting C++ file-scope static object constructed
-   before entering `main'.  */
-
-#undef	STARTFILE_SPEC
-#ifdef HAVE_LD_PIE
-#define STARTFILE_SPEC \
-  "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-#else
-#define STARTFILE_SPEC \
-  "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-#endif
-
-/* Provide a ENDFILE_SPEC appropriate for ELF.  Here we tack on the
-   magical crtend.o file which provides part of the support for
-   getting C++ file-scope static object constructed before entering
-   `main', followed by a normal ELF "finalizer" file, `crtn.o'.  */
-
-#undef	ENDFILE_SPEC
-#define ENDFILE_SPEC \
-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
-   %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
-
 /* This variable should be set to 'true' if the target ABI requires
    unwinding tables even when exceptions are not used.  */
 #define TARGET_UNWIND_TABLES_DEFAULT true
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index e15013eb9..cd0099779 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -78,6 +78,32 @@ along with GCC; see the file COPYING3.  If not see
 
 #define TARGET_POSIX_IO
 
+/* Provide a STARTFILE_SPEC appropriate for ELF.  Here we add the
+   (even more) magical crtbegin.o file which provides part of the
+   support for getting C++ file-scope static object constructed
+   before entering `main'.  */
+
+#undef	STARTFILE_SPEC
+#ifdef HAVE_LD_PIE
+#define STARTFILE_SPEC \
+  "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
+   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#else
+#define STARTFILE_SPEC \
+  "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
+   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#endif
+
+/* Provide a ENDFILE_SPEC appropriate for ELF.  Here we tack on the
+   magical crtend.o file which provides part of the support for
+   getting C++ file-scope static object constructed before entering
+   `main', followed by a normal ELF "finalizer" file, `crtn.o'.  */
+
+#undef	ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
 #define LINK_GCC_C_SEQUENCE_SPEC \
   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
 
-- 
2.14.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, alpha] Move linux-specific specfile definitions to linux.h
  2017-09-03 15:47 [PATCH, alpha] Move linux-specific specfile definitions to linux.h Maya Rashish
@ 2017-10-13 17:14 ` Jeff Law
  2017-10-25  2:24   ` coypu
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Law @ 2017-10-13 17:14 UTC (permalink / raw)
  To: Maya Rashish, gcc-patches; +Cc: krister.walfridsson, rth

On 09/03/2017 09:47 AM, Maya Rashish wrote:
> Hi, in my first attempt to fix a build issue I found that the order of
> tm files matters, would prefer to move linux-looking parts of elf.h to
> linux.h.
> 
> other targets that include alpha/elf.h besides linux:
> openbsd:  provides their own STARTFILE_SPEC and ENDFILE_SPEC in later file:
> https://github.com/openbsd/ports/blob/master/lang/gcc/6/patches/patch-gcc_config_alpha_openbsd_h
> freebsd:  dropped alpha in freebsd 7.0 (2008)
> 
> Built trunk on netbsd/alpha (until I out of spaced with a working stage3
> after two days :-)) with some extra modifications.
So we can't depend on patches that OpenBSD applies.  What's important is
what is in the official GCC sources.

I'd like to see some discussion about what these macros should look like
for the *bsd ports.  Merely removing them from elf.h without providing
something for the *bsd ports seems wrong to me.


Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, alpha] Move linux-specific specfile definitions to linux.h
  2017-10-13 17:14 ` Jeff Law
@ 2017-10-25  2:24   ` coypu
  2017-11-19 23:28     ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: coypu @ 2017-10-25  2:24 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, krister.walfridsson, rth

On Fri, Oct 13, 2017 at 11:13:52AM -0600, Jeff Law wrote:
> So we can't depend on patches that OpenBSD applies.  What's important is
> what is in the official GCC sources.
> 
> I'd like to see some discussion about what these macros should look like
> for the *bsd ports.  Merely removing them from elf.h without providing
> something for the *bsd ports seems wrong to me.

Hi Jeff,

OpenBSD has no crt1.o, crtn.o, and crtfastmath.o Linking to those
would fail.  As testimony: they are overriding it locally.

And journalists may say, "OpenBSD has declined to comment on this patch".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, alpha] Move linux-specific specfile definitions to linux.h
  2017-10-25  2:24   ` coypu
@ 2017-11-19 23:28     ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2017-11-19 23:28 UTC (permalink / raw)
  To: coypu; +Cc: gcc-patches, krister.walfridsson, rth

On 10/24/2017 07:26 PM, coypu@sdf.org wrote:
> On Fri, Oct 13, 2017 at 11:13:52AM -0600, Jeff Law wrote:
>> So we can't depend on patches that OpenBSD applies.  What's important is
>> what is in the official GCC sources.
>>
>> I'd like to see some discussion about what these macros should look like
>> for the *bsd ports.  Merely removing them from elf.h without providing
>> something for the *bsd ports seems wrong to me.
> 
> Hi Jeff,
> 
> OpenBSD has no crt1.o, crtn.o, and crtfastmath.o Linking to those
> would fail.  As testimony: they are overriding it locally.
> 
> And journalists may say, "OpenBSD has declined to comment on this patch".
But it does have other crt files such as crt0.o, crtend.o, crtbegin.o
that are supposed to be handled by the SPEC files.

Pulling these out of elf.h *may* still be sensible, but it really
doesn't seem to address the problem of what the proper definition should
be for OpenBSD.

jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-19 23:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-03 15:47 [PATCH, alpha] Move linux-specific specfile definitions to linux.h Maya Rashish
2017-10-13 17:14 ` Jeff Law
2017-10-25  2:24   ` coypu
2017-11-19 23:28     ` Jeff Law

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).