bugmake - Bugs: bug #62175, Port tests to big endian.

 
 

bug #62175: Port tests to big endian.

Submitter:  Dmitry Goncharov <dgoncharov>
Submitted:  Sat 12 Mar 2022 11:21:32 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.4 Operating System:  None
Fixed Release:  4.4 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 24 Apr 2022 10:09:42 PM UTC, comment #3: 

Fixed, thanks!

Paul D. Smith <psmith>
Group administrator
Sun 24 Apr 2022 06:53:21 PM UTC, comment #2: 

Oh, I see.  It's not that the targets are rebuilt in the wrong order, it's that the expansion of the secondary prerequisites isn't happening in the order in which targets are rebuilt.

That's probably OK.  I don't think we need to guarantee that the order in which secondary expansion happens across targets is any particular way.

In theory it should be the same way they are listed in the makefile since that's how non-secondary expansion prerequisites are expanded, but I don't think we need to guarantee that.

Paul D. Smith <psmith>
Group administrator
Sat 23 Apr 2022 09:02:59 PM UTC, comment #1: 

I think there's a deeper problem here.  POSIX requires that prerequisites be built in the order they are specified.

If we have a target all: 1.x 2.x then it's required by the standard that 1.x be built by make before 2.x.

If that is not happening when .SECONDEXPANSION is enabled, then that's wrong and is a more serious issue.  I'll take a look at it.

The order that intermediate files appear in the removal line is, of course not defined and so might be different.

Paul D. Smith <psmith>
Group administrator
Sat 12 Mar 2022 11:21:32 PM UTC, original submission:  

Certain tests assume that make builds prerequisites in a specific order.

E.g. test features/se_explicit.diff.13 assumes that makes builds prerequisite 2.x before 1.x.



features/se_explicit .................................... FAILED (14/18 passed)

4 Tests in 1 Category Failed (See .diff* files in work dir for details) :-(

$ cat work/features/se_explicit.diff
se_explicit.diff.13  se_explicit.diff.14  se_explicit.diff.15  se_explicit.diff.17
$ cat work/features/se_explicit.diff.13
*** work/features/se_explicit.base.13   Sat Mar 12 16:37:19 2022
--- work/features/se_explicit.log.13    Sat Mar 12 16:37:19 2022
***************
*** 1,3 ****
- @=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=,%=
  @=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=,%=
  make: Nothing to be done for 'all'.
--- 1,3 ----
  @=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=,%=
+ @=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=,%=
  make: Nothing to be done for 'all'.
$
$ cat work/features/se_explicit.mk.12

.SECONDEXPANSION:
all: 2.x 1.x
2.x: 5.z 6.z 5.z | 7.z 7.z 8.z
1.x: 1.z 2.z 2.z | 3.z 4.z
2.x 1.x: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ;
%.z: ;
$

features/se_implicit .................................... FAILED (24/25 passed)

1 Test in 1 Category Failed (See .diff* files in work dir for details) :-(

features/se_implicit .................................... FAILED (24/25 passed)

1 Test in 1 Category Failed (See .diff* files in work dir for details) :-(

$ cat work/features/se_implicit.diff.21
*** work/features/se_implicit.base.21   Sat Mar 12 16:41:59 2022
--- work/features/se_implicit.log.21    Sat Mar 12 16:41:59 2022
***************
*** 1,3 ****
- @=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=2
  @=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=1
  make: Nothing to be done for 'all'.
--- 1,3 ----
  @=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=1
+ @=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=2
  make: Nothing to be done for 'all'.
$


This happens, because when second expansion is enabled, snap_deps obtains the list of prerequisites from hash_dump.
Those filenames hash to different buckets on different architectures and this causes make to process prerequisites in the order determined by hashing.
i observed these failures on big endian sparc-sun and powerpc-aix


This patch uses prerequisite names intentionally chosen to hash in the same order on both little and big endian.
Tested on big endian sparc-sun and powerpc-aix and little endian intel-linux, all in 64 and 32 bit modes.

Some other tests assume that make removes intermediate files in a specific order.


features/patternrules ................................... FAILED (26/31 passed)

5 Tests in 1 Category Failed (See .diff* files in work dir for details) :-(

$ cat work/features/patternrules.diff.21
*** work/features/patternrules.base.21  Sat Mar 12 16:36:25 2022
--- work/features/patternrules.log.21   Sat Mar 12 16:36:25 2022
***************
*** 1,3 ****
  touch a.1 a.2
  cat a.1 a.2 >a.4
! rm a.1 a.2
--- 1,3 ----
  touch a.1 a.2
  cat a.1 a.2 >a.4
! rm a.2 a.1


Dmitry Goncharov <dgoncharov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by dgoncharov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-24 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4
    2022-03-12 dgoncharov Attached File- Added port_tests_to_big_endian.diff, #52984

    Back to the top

    Powered by Savane 3.13-da57.
    Corresponding source code