public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] Add HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc target
@ 2010-11-19  2:04 Marc Jones
  2010-11-19  2:40 ` Joseph S. Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Jones @ 2010-11-19  2:04 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

Hi,

This small patch adds HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc
target. We use the i386-elf-gcc for the coreboot cross compiler. I
have some code that builds under several compilers and uses #pragma
pack to save ROM space. By adding the HANDLE_PRAGMA_PACK_PUSH_POP, I
can build in coreboot without the #pragma pack warnings.

Signed-off-by: Marc Jones <marcj303@gmail.com>

Marc
-- 
http://se-eng.com

[-- Attachment #2: gcc-4.5.1_pragma.patch --]
[-- Type: application/octet-stream, Size: 530 bytes --]

diff -ur gcc-4.5.1.orig/gcc/config/i386/i386elf.h gcc-4.5.1/gcc/config/i386/i386elf.h
--- gcc-4.5.1.orig/gcc/config/i386/i386elf.h	2010-11-17 19:48:16.184401200 -0700
+++ gcc-4.5.1/gcc/config/i386/i386elf.h	2010-11-17 20:52:54.443969900 -0700
@@ -123,3 +123,6 @@
 #undef ASM_OUTPUT_ALIGNED_BSS
 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop).  */
+#define HANDLE_PRAGMA_PACK_PUSH_POP 1

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

* Re: [Patch] Add HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc target
  2010-11-19  2:04 [Patch] Add HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc target Marc Jones
@ 2010-11-19  2:40 ` Joseph S. Myers
  2010-11-19  3:44   ` Mike Stump
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph S. Myers @ 2010-11-19  2:40 UTC (permalink / raw)
  To: Marc Jones; +Cc: gcc-patches

I think we should just enable HANDLE_PRAGMA_PACK_PUSH_POP unconditionally.  
That eliminates a target macro - one used in front ends, where we would 
particularly like to eliminate them - and simplifies the testsuite (no 
need for tests of this pragma to be conditional), as well as improving 
portability of code between supported targets; I don't see any reason to 
restrict this feature to some targets only.  This in turn obsoletes 
HANDLE_SYSV_PRAGMA as well (the documentation claiming it also affects 
#pragma weak is wrong), so two target macros can die.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [Patch] Add HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc target
  2010-11-19  2:40 ` Joseph S. Myers
@ 2010-11-19  3:44   ` Mike Stump
  2010-11-19  4:02     ` Dave Korn
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Stump @ 2010-11-19  3:44 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Marc Jones, gcc-patches

On Nov 18, 2010, at 5:15 PM, Joseph S. Myers wrote:
> I think we should just enable HANDLE_PRAGMA_PACK_PUSH_POP unconditionally.  
> That eliminates a target macro - one used in front ends, where we would 
> particularly like to eliminate them - and simplifies the testsuite (no 
> need for tests of this pragma to be conditional), as well as improving 
> portability of code between supported targets; I don't see any reason to 
> restrict this feature to some targets only.  This in turn obsoletes 
> HANDLE_SYSV_PRAGMA as well (the documentation claiming it also affects 
> #pragma weak is wrong), so two target macros can die.

I endorse this as well.

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

* Re: [Patch] Add HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc target
  2010-11-19  3:44   ` Mike Stump
@ 2010-11-19  4:02     ` Dave Korn
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Korn @ 2010-11-19  4:02 UTC (permalink / raw)
  To: Mike Stump; +Cc: Joseph S. Myers, Marc Jones, gcc-patches

On 19/11/2010 02:20, Mike Stump wrote:
> On Nov 18, 2010, at 5:15 PM, Joseph S. Myers wrote:
>> I think we should just enable HANDLE_PRAGMA_PACK_PUSH_POP unconditionally.  
>> That eliminates a target macro - one used in front ends, where we would 
>> particularly like to eliminate them - and simplifies the testsuite (no 
>> need for tests of this pragma to be conditional), as well as improving 
>> portability of code between supported targets; I don't see any reason to 
>> restrict this feature to some targets only.  This in turn obsoletes 
>> HANDLE_SYSV_PRAGMA as well (the documentation claiming it also affects 
>> #pragma weak is wrong), so two target macros can die.
> 
> I endorse this as well.

  Thirded!

    cheers,
      DaveK

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

end of thread, other threads:[~2010-11-19  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19  2:04 [Patch] Add HANDLE_PRAGMA_PACK_PUSH_POP to the i386-elf gcc target Marc Jones
2010-11-19  2:40 ` Joseph S. Myers
2010-11-19  3:44   ` Mike Stump
2010-11-19  4:02     ` Dave Korn

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