Opened 11 years ago

Closed 11 years ago

Last modified 6 years ago

#41614 closed defect (fixed)

gmp: always build from source? (Fix SIGILL on Core2Du)

Reported by: kurtjaeke@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: cooljeanius (Eric Gallager), yan12125 (Chih-Hsuan Yen)
Port: gmp

Description

There have been a number of issues with gmp failing with SIGILL when installed from binary archives: #40439, #40621, #41364, #41555. These issues are difficult to debug, since the symptoms are, amongst others, strange crashes during compilation.

Background: gmp detects available CPU instructions during "configure". This information is used in the build process to conditionally enable assembler code. In the bugs mentioned above, the affected architecture seems to be Core2Duo, the first x86_64 CPUs Apple shipped (IIRC) (the MacPorts build farm is supposedly more modern).

This brings up the question: should gmp always be built from source? Is this a viable approach to solving this issue? Thanks for discussing.

Attached is a piece of Fortran code which triggers this issue. Run your favorite Fortran compiler with the -v flag, and if the compiler backend (f951 for any gcc) crashes with SIGILL, this problem affects you.

Attachments (1)

test.f (96 bytes) - added by kurtjaeke@… 11 years ago.
Fortran code to trigger SIGILL on Core2Duo.

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by kurtjaeke@…

Attachment: test.f added

Fortran code to trigger SIGILL on Core2Duo.

comment:1 Changed 11 years ago by kurtjaeke@…

Cc: kurtjaeke@… added

Cc Me!

comment:2 in reply to:  description ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: kurtjaeke@… removed
Owner: changed from macports-tickets@… to mcalhoun@…
Port: gmp added
Summary: always build gmp from source? (Fix SIGILL on Core2Du)gmp: always build from source? (Fix SIGILL on Core2Du)

Replying to kurtjaeke@…:

This brings up the question: should gmp always be built from source? Is this a viable approach to solving this issue? Thanks for discussing.

Sure, we could do that. We'd just have to clear archive_sites. We did that for atlas awhile back (as part of r104549).

comment:3 in reply to:  2 Changed 11 years ago by kurtjaeke@…

Replying to ryandesign@…:

Replying to kurtjaeke@…:

This brings up the question: should gmp always be built from source? Is this a viable approach to solving this issue? Thanks for discussing.

Sure, we could do that. We'd just have to clear archive_sites. We did that for atlas awhile back (as part of r104549).

Awesome. #41364 and #41555 now have debug data that show the failure in gmp. #40439 is closed, but was supposedly fixed for OP by reinstalling gmp from source. Data is pending for #40621.

What needs to be done to clear the archive_sites? When this is done, gmp will need a revision bump, right?

comment:4 Changed 11 years ago by kurtjaeke@…

#41364 is (was) also the same issue. What needs to be done to proceed?

comment:5 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

Fixed in r118605.

comment:6 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:7 Changed 10 years ago by jmroot (Joshua Root)

It’s kind of lame not allowing binaries to be used at all. Better would be to do a lowest common denominator build normally, and provide a variant to build optimised for the local machine for users who really need the performance.

comment:8 in reply to:  7 ; Changed 10 years ago by Ionic (Mihai Moldovan)

Replying to jmr@…:

users who really need the performance.

Yeah, because it really makes any difference... and we're not even using -march=native...

comment:9 in reply to:  8 Changed 10 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to ionic@…:

Replying to jmr@…:

users who really need the performance.

Yeah, because it really makes any difference... and we're not even using -march=native...

gmp goes to a great deal of trouble to compile itself for a very specific processor (using -mtune, -march, and quite a bit of assembly).
I am not sure how good an idea it is to try to work around that.

comment:10 Changed 6 years ago by yan12125 (Chih-Hsuan Yen)

Cc: yan12125 added
Note: See TracTickets for help on using tickets.