Bug #614

Multi-platform support is broken

Added by Orion about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:2014-09-04
Priority:NormalDue date:
Assignee:Florian% Done:

0%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:

Description

In src/gmt_config.h.in:

/* Architecture type (32/64 bits) */
#if !defined(__x86_64__) && !defined(__i386__) && SIZEOF_VOID_P == 4 /* on i386 */
#       define __i386__ 1
#elif !defined(__x86_64__) && !defined(__i386__) && SIZEOF_VOID_P == 8 /* on x86_64 */
#       define __x86_64__ 1
#endif

This horribly breaks trying to support architectures other than i386 or x86_64 by mistakenly re-purposing the i386 and x86_64 defines. Spefically trying to determine the proper macros in common_sighandler.c:

cd /builddir/build/BUILD/gmt-5.1.1/build/src && /usr/bin/cc  -DLIBRARY_EXPORTS -std=gnu99 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mcpu=power7 -mtune=power7  -fopenmp -DNDEBUG -fPIC -I/builddir/build/BUILD/gmt-5.1.1/build/src -I/builddir/build/BUILD/gmt-5.1.1/src -I/usr/include/gdal -I/builddir/build/BUILD/gmt-5.1.1/build/src/gshhg -I/builddir/build/BUILD/gmt-5.1.1/build/src/img -I/builddir/build/BUILD/gmt-5.1.1/build/src/meca -I/builddir/build/BUILD/gmt-5.1.1/build/src/mgd77 -I/builddir/build/BUILD/gmt-5.1.1/build/src/misc -I/builddir/build/BUILD/gmt-5.1.1/build/src/potential -I/builddir/build/BUILD/gmt-5.1.1/build/src/segy -I/builddir/build/BUILD/gmt-5.1.1/build/src/spotter -I/builddir/build/BUILD/gmt-5.1.1/build/src/x2sys    -o CMakeFiles/gmtlib.dir/gmt_shore.c.o   -c /builddir/build/BUILD/gmt-5.1.1/src/gmt_shore.c
/builddir/build/BUILD/gmt-5.1.1/src/common_sighandler.c: In function 'sig_handler':
/builddir/build/BUILD/gmt-5.1.1/src/common_sighandler.c:85:48: error: 'mcontext_t' has no member named 'rip'
 #  define UC_IP(uc) ((void *) (uc)->uc_mcontext.rip)
                                                ^

This is on ppc64.

The attached patch hopefully fixes for ppc32/64 and aarch64.

gmt-arch.patch Magnifier - Patch for multi-arch support (1.43 KB) Orion, 2014-09-04 12:19

gmt-arch.patch Magnifier - Updated patch to trunk (1.3 KB) Orion, 2014-10-06 06:44

Associated revisions

Revision 13514
Added by Paul about 3 years ago

Address issue #614

Revision 13588
Added by Paul about 3 years ago

Applied latest patch from Orion, see issue #614

History

#1 Updated by Paul about 3 years ago

  • Status changed from New to In Progress
  • Assignee set to Florian
  • Target version set to Candidate for next bugfix release

Florian, since this is related to your sig handler, could you please have a look at adding this patch?

#2 Updated by Paul about 3 years ago

  • Status changed from In Progress to Resolved

In Florian's absence I have applied Orion's patch. Orion, please let me know if there are any other issues. Florian, please review when you get back. In r13514.

#3 Updated by Orion about 3 years ago

Here's an updated patch for trunk to fix some aarch64 issues and add s390 support.

#4 Updated by Paul about 3 years ago

Thanks, applied in r13588.

#5 Updated by Paul about 3 years ago

  • Status changed from Resolved to Closed

I am closing this issue. Feel free to add another should similar problems surface.

Also available in: Atom PDF