Skip to content

Commit

Permalink
MDEV-9128 - Compiling on IBM System Z fails
Browse files Browse the repository at this point in the history
Provided IBM System Z have outdated compiler version, which supports gcc sync
builtins but not gcc atomic builtins. It also has weak memory model.

InnoDB attempted to verify if __sync_lock_test_and_set() is available by
checking IB_STRONG_MEMORY_MODEL. This macro has nothing to do with availability
of __sync_lock_test_and_set(), the right one is HAVE_ATOMIC_BUILTINS.
  • Loading branch information
svoj committed Nov 23, 2015
1 parent f00d765 commit edf6354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/innobase/include/os0sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ os_atomic_clear(volatile lock_word_t* ptr)
__atomic_clear(ptr, __ATOMIC_RELEASE);
}

# elif defined(IB_STRONG_MEMORY_MODEL)
# elif defined(HAVE_ATOMIC_BUILTINS)

/** Do an atomic test and set.
@param[in,out] ptr Memory location to set to non-zero
Expand Down

4 comments on commit edf6354

@brad0
Copy link
Contributor

@brad0 brad0 commented on edf6354 Dec 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be copied over to storage/xtradb/include/os0sync.h.

@svoj
Copy link
Contributor Author

@svoj svoj commented on edf6354 Dec 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't have this code in XtraDB at the time of fixing. Now we have it and indeed it has to be fixed. Thanks for pointing this out!

@brad0
Copy link
Contributor

@brad0 brad0 commented on edf6354 Dec 28, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also back port this fix for both InnoDB and XtraDB to the 10.0 branch and ensure it goes into 10.2.

@spheroid
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also fixes building 5.5 series on my FreeBSD 9.3 box on sparc64, please backport it there as well.

Please sign in to comment.