This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

help with new DejaGNU feature


Hello.

Before describing the patch, it might help to describe the problem I am
trying to solve.  I think the idea may be applicable to other multilibbed
targets if generalized.

EGCS/GCC on SCO OpenServer supports both COFF and ELF.   Several of the
testsuite entries on that product explictly add "-fPIC" to the compile 
line.   PIC doesn't work with COFF, so those test cases fail.

My idea was to add a 'nopic' flag into the board_info array, then test
if we're adding a PIC flag to the flags.   The idea could certainly
be generalized.   This patch isn't final, it's background in my plea
for help.   

*** target.exp_ Mon Jun 29 23:20:03 1998
--- target.exp Sat Jul 18 23:10:08 1998
*** 405,410 ****
      if [board_info $dest exists multilib_flags] {
        append add_flags " [board_info $dest multilib_flags]";
      }

      verbose "doing compile"
      set sources ""
--- 406,419 ----
      if [board_info $dest exists multilib_flags] {
        append add_flags " [board_info $dest multilib_flags]";
      }
+
+    if [board_info $dest exists nopic] {
+      if [regexp -- "-fPIC" $add_flags] {
+      send_user "**** $add_flags\n"
+          unsupported "-fPIC is not supported on this target"
+       return
+       }
+    }

      verbose "doing compile"
      set sources ""


What is less clear to me is the right place to add the setting of that
flag.  If I add it to baseboards/unix.exp, it seems to work right but I
know that isn't the right place for it.  I created a baseboards/sco5.exp
but that was generally unproductive.

What would be the correct way to add:

 if [regexp -- "-mcoff" [board_info $board multilib_flags]] {
       set_board_info nopic 1
 }

To an x86-pc-sco3.2v5* target so that it'll run when dejagnu is invoked
via:
	make check-g++ RUNTESTFLAGS='--target_board=unix{-mcoff,-melf} 


Am I on a correct path here?   Can you help me beat this into shape
suitable for submission?   If you'd like the more general case, let 
me know what you think the best form for that would be.

Thank you,
RJL

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]