Skip to content

Commit

Permalink
Fix building on ppc64
Browse files Browse the repository at this point in the history
The type definitions on ppc64 has two forms, the older one that uses long
for 64-bit types and the newer one that uses long long for 64-bit types.

The long long version is what other architectures use and what libbpfgo
expects in e.g. bpfMapCreateOptsToC.

All that's required to enable the latter ABI is to define
__SANE_USERSPACE_TYPES__ when including the type headers.

Fixes: #274
  • Loading branch information
jeffmahoney authored and rafaeldtinoco committed Dec 12, 2022
1 parent 688787f commit 55b5ac3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libbpfgo.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef __LIBBPF_GO_H__
#define __LIBBPF_GO_H__

#ifdef __powerpc64__
#define __SANE_USERSPACE_TYPES__ 1
#endif

#include <errno.h>
#include <stdlib.h>
#include <string.h>
Expand Down

0 comments on commit 55b5ac3

Please sign in to comment.