i386 -fPIC requires `%ebx`
authorMichael Lee <mzlee@fb.com>
Wed, 2 Mar 2016 01:32:43 +0000 (17:32 -0800)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Wed, 2 Mar 2016 01:35:26 +0000 (17:35 -0800)
commit3d90e8634da590a171151aadd2191e6fea8111e3
treeae9256b1a297454d9a6c8d671d7a507aedbc4491
parent76344f7be3c36b0b0fdf66dafd9e5898d60f368e
i386 -fPIC requires `%ebx`

Summary:On i368 (until, I'm lead to believe i686) `%ebx` is used for the PIC register. Thus, when we use cpuid, we clobber that register and gcc loudly complains:

  folly/CpuId.h: In member function 'virtual void CpuId_Simple_Test::TestBody()':
  folly/CpuId.h:67:61: error: PIC register clobbered by 'ebx' in 'asm'
       __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "edx", "ecx");

Reviewed By: yfeldblum

Differential Revision: D2991229

fb-gh-sync-id: ee8795e36a4c173147d61e26c9590ec5da1d02b5
shipit-source-id: ee8795e36a4c173147d61e26c9590ec5da1d02b5
folly/CpuId.h