[API-NEXT,PATCHv5] api: make only the API visible

Message ID CAK--WWM0=gjxm7hgiuuthO1n03gVA0AVjJ+9mPQxBkROcR9sCQ@mail.gmail.com
State New
Headers show

Commit Message

Anders Roxell April 18, 2016, 7:35 p.m.
On 18 April 2016 at 18:47, Bill Fischofer <bill.fischofer@linaro.org> wrote:
> From: Anders Roxell <anders.roxell@linaro.org>
>
> Internal functions should not be part of symbols that are visible
> outside the library. Using -fvisibility=hidden hides all internal
> functions from the public ABI.
>
> Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>  include/odp/api/spec/align.h                       |  2 ++
>  include/odp/api/spec/atomic.h                      |  2 ++
>  include/odp/api/spec/barrier.h                     |  2 ++
>  include/odp/api/spec/buffer.h                      |  3 ++-
>  include/odp/api/spec/byteorder.h                   |  2 ++
>  include/odp/api/spec/classification.h              |  3 ++-
>  include/odp/api/spec/compiler.h                    |  2 ++
>  include/odp/api/spec/config.h                      |  2 ++
>  include/odp/api/spec/cpu.h                         |  2 ++
>  include/odp/api/spec/cpumask.h                     |  2 ++
>  include/odp/api/spec/crypto.h                      |  2 ++
>  include/odp/api/spec/debug.h                       |  3 ++-
>  include/odp/api/spec/errno.h                       |  2 ++
>  include/odp/api/spec/event.h                       |  3 ++-
>  include/odp/api/spec/hash.h                        |  2 ++
>  include/odp/api/spec/hints.h                       |  2 ++
>  include/odp/api/spec/init.h                        |  4 ++--
>  include/odp/api/spec/packet.h                      |  2 ++
>  include/odp/api/spec/packet_flags.h                |  2 ++
>  include/odp/api/spec/packet_io.h                   |  2 ++
>  include/odp/api/spec/packet_io_stats.h             |  2 ++
>  include/odp/api/spec/pool.h                        |  4 ++--
>  include/odp/api/spec/queue.h                       |  2 ++
>  include/odp/api/spec/random.h                      |  3 ++-
>  include/odp/api/spec/rwlock.h                      |  2 ++
>  include/odp/api/spec/rwlock_recursive.h            |  2 ++
>  include/odp/api/spec/schedule.h                    |  3 ++-
>  include/odp/api/spec/schedule_types.h              |  2 ++
>  include/odp/api/spec/shared_memory.h               |  3 ++-
>  include/odp/api/spec/spinlock.h                    |  2 ++
>  include/odp/api/spec/spinlock_recursive.h          |  2 ++
>  include/odp/api/spec/std_clib.h                    |  2 ++
>  include/odp/api/spec/std_types.h                   |  3 ++-
>  include/odp/api/spec/sync.h                        |  2 ++
>  include/odp/api/spec/system_info.h                 |  3 ++-
>  include/odp/api/spec/thread.h                      |  2 ++
>  include/odp/api/spec/thrmask.h                     |  2 ++
>  include/odp/api/spec/ticketlock.h                  |  2 ++
>  include/odp/api/spec/time.h                        |  3 ++-
>  include/odp/api/spec/timer.h                       |  2 ++
>  include/odp/api/spec/traffic_mngr.h                |  2 ++
>  include/odp/api/spec/version.h                     |  2 ++
>  platform/Makefile.inc                              |  1 +
>  platform/linux-generic/include/odp/api/abi_begin.h |  3 +++
>  platform/linux-generic/include/odp/api/abi_end.h   |  3 +++
>  platform/linux-generic/m4/configure.m4             | 12 ++++++++++++
>  46 files changed, 103 insertions(+), 14 deletions(-)
>  create mode 100644 platform/linux-generic/include/odp/api/abi_begin.h
>  create mode 100644 platform/linux-generic/include/odp/api/abi_end.h
>

Looks good, except that I think you missed this:



make distcheck finds this wee problem:
make[1]: Entering directory
'/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build'
Making all in platform/linux-generic
make[2]: Entering directory
'/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build/platform/linux-generic'
  CC       odp_atomic.lo
In file included from
../../../platform/linux-generic/include/odp/api/align.h:54:0,
                 from
../../../platform/linux-generic/include/odp/api/atomic.h:20,
                 from ../../../platform/linux-generic/odp_atomic.c:7:
../../../include/odp/api/spec/align.h:16:31: fatal error:
odp/api/abi_begin.h: No such file or directory
 #include <odp/api/abi_begin.h>
                               ^
compilation terminated.
Makefile:809: recipe for target 'odp_atomic.lo' failed
make[2]: *** [odp_atomic.lo] Error 1
make[2]: Leaving directory
'/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build/platform/linux-generic'
Makefile:457: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
'/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build'
Makefile:663: recipe for target 'distcheck' failed
make: *** [distcheck] Error 1


Cheers,
Anders

Comments

Bill Fischofer April 18, 2016, 10:17 p.m. | #1
Thanks.  I'll add that.  I suspect the 2nd error is a fallout of the first
since that it works for me. Will double-check and send a v6.



On Mon, Apr 18, 2016 at 2:35 PM, Anders Roxell <anders.roxell@linaro.org>
wrote:

> On 18 April 2016 at 18:47, Bill Fischofer <bill.fischofer@linaro.org>

> wrote:

> > From: Anders Roxell <anders.roxell@linaro.org>

> >

> > Internal functions should not be part of symbols that are visible

> > outside the library. Using -fvisibility=hidden hides all internal

> > functions from the public ABI.

> >

> > Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>

> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

> > ---

> >  include/odp/api/spec/align.h                       |  2 ++

> >  include/odp/api/spec/atomic.h                      |  2 ++

> >  include/odp/api/spec/barrier.h                     |  2 ++

> >  include/odp/api/spec/buffer.h                      |  3 ++-

> >  include/odp/api/spec/byteorder.h                   |  2 ++

> >  include/odp/api/spec/classification.h              |  3 ++-

> >  include/odp/api/spec/compiler.h                    |  2 ++

> >  include/odp/api/spec/config.h                      |  2 ++

> >  include/odp/api/spec/cpu.h                         |  2 ++

> >  include/odp/api/spec/cpumask.h                     |  2 ++

> >  include/odp/api/spec/crypto.h                      |  2 ++

> >  include/odp/api/spec/debug.h                       |  3 ++-

> >  include/odp/api/spec/errno.h                       |  2 ++

> >  include/odp/api/spec/event.h                       |  3 ++-

> >  include/odp/api/spec/hash.h                        |  2 ++

> >  include/odp/api/spec/hints.h                       |  2 ++

> >  include/odp/api/spec/init.h                        |  4 ++--

> >  include/odp/api/spec/packet.h                      |  2 ++

> >  include/odp/api/spec/packet_flags.h                |  2 ++

> >  include/odp/api/spec/packet_io.h                   |  2 ++

> >  include/odp/api/spec/packet_io_stats.h             |  2 ++

> >  include/odp/api/spec/pool.h                        |  4 ++--

> >  include/odp/api/spec/queue.h                       |  2 ++

> >  include/odp/api/spec/random.h                      |  3 ++-

> >  include/odp/api/spec/rwlock.h                      |  2 ++

> >  include/odp/api/spec/rwlock_recursive.h            |  2 ++

> >  include/odp/api/spec/schedule.h                    |  3 ++-

> >  include/odp/api/spec/schedule_types.h              |  2 ++

> >  include/odp/api/spec/shared_memory.h               |  3 ++-

> >  include/odp/api/spec/spinlock.h                    |  2 ++

> >  include/odp/api/spec/spinlock_recursive.h          |  2 ++

> >  include/odp/api/spec/std_clib.h                    |  2 ++

> >  include/odp/api/spec/std_types.h                   |  3 ++-

> >  include/odp/api/spec/sync.h                        |  2 ++

> >  include/odp/api/spec/system_info.h                 |  3 ++-

> >  include/odp/api/spec/thread.h                      |  2 ++

> >  include/odp/api/spec/thrmask.h                     |  2 ++

> >  include/odp/api/spec/ticketlock.h                  |  2 ++

> >  include/odp/api/spec/time.h                        |  3 ++-

> >  include/odp/api/spec/timer.h                       |  2 ++

> >  include/odp/api/spec/traffic_mngr.h                |  2 ++

> >  include/odp/api/spec/version.h                     |  2 ++

> >  platform/Makefile.inc                              |  1 +

> >  platform/linux-generic/include/odp/api/abi_begin.h |  3 +++

> >  platform/linux-generic/include/odp/api/abi_end.h   |  3 +++

> >  platform/linux-generic/m4/configure.m4             | 12 ++++++++++++

> >  46 files changed, 103 insertions(+), 14 deletions(-)

> >  create mode 100644 platform/linux-generic/include/odp/api/abi_begin.h

> >  create mode 100644 platform/linux-generic/include/odp/api/abi_end.h

> >

>

> Looks good, except that I think you missed this:

>

> diff --git a/platform/linux-generic/Makefile.am

> b/platform/linux-generic/Makefile.am

> index 5eb8cbc..bc5573d 100644

> --- a/platform/linux-generic/Makefile.am

> +++ b/platform/linux-generic/Makefile.am

> @@ -16,6 +16,8 @@ include_HEADERS = \

>  odpapiincludedir= $(includedir)/odp/api

>  odpapiinclude_HEADERS = \

>                   $(srcdir)/include/odp/api/align.h \

> +                 $(srcdir)/include/odp/api/abi_begin.h \

> +                 $(srcdir)/include/odp/api/abi_end.h \

>                   $(srcdir)/include/odp/api/atomic.h \

>                   $(srcdir)/include/odp/api/barrier.h \

>                   $(srcdir)/include/odp/api/buffer.h \

>

>

> make distcheck finds this wee problem:

> make[1]: Entering directory

>

> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build'

> Making all in platform/linux-generic

> make[2]: Entering directory

>

> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build/platform/linux-generic'

>   CC       odp_atomic.lo

> In file included from

> ../../../platform/linux-generic/include/odp/api/align.h:54:0,

>                  from

> ../../../platform/linux-generic/include/odp/api/atomic.h:20,

>                  from ../../../platform/linux-generic/odp_atomic.c:7:

> ../../../include/odp/api/spec/align.h:16:31: fatal error:

> odp/api/abi_begin.h: No such file or directory

>  #include <odp/api/abi_begin.h>

>                                ^

> compilation terminated.

> Makefile:809: recipe for target 'odp_atomic.lo' failed

> make[2]: *** [odp_atomic.lo] Error 1

> make[2]: Leaving directory

>

> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build/platform/linux-generic'

> Makefile:457: recipe for target 'all-recursive' failed

> make[1]: *** [all-recursive] Error 1

> make[1]: Leaving directory

>

> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build'

> Makefile:663: recipe for target 'distcheck' failed

> make: *** [distcheck] Error 1

>

>

> Cheers,

> Anders

>
Bill Fischofer April 18, 2016, 10:36 p.m. | #2
v6 sent. It passed make distcheck for me.

On Mon, Apr 18, 2016 at 5:17 PM, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

> Thanks.  I'll add that.  I suspect the 2nd error is a fallout of the first

> since that it works for me. Will double-check and send a v6.

>

>

>

> On Mon, Apr 18, 2016 at 2:35 PM, Anders Roxell <anders.roxell@linaro.org>

> wrote:

>

>> On 18 April 2016 at 18:47, Bill Fischofer <bill.fischofer@linaro.org>

>> wrote:

>> > From: Anders Roxell <anders.roxell@linaro.org>

>> >

>> > Internal functions should not be part of symbols that are visible

>> > outside the library. Using -fvisibility=hidden hides all internal

>> > functions from the public ABI.

>> >

>> > Suggested-by: Ricardo Salveti <ricardo.salveti@linaro.org>

>> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

>> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

>> > ---

>> >  include/odp/api/spec/align.h                       |  2 ++

>> >  include/odp/api/spec/atomic.h                      |  2 ++

>> >  include/odp/api/spec/barrier.h                     |  2 ++

>> >  include/odp/api/spec/buffer.h                      |  3 ++-

>> >  include/odp/api/spec/byteorder.h                   |  2 ++

>> >  include/odp/api/spec/classification.h              |  3 ++-

>> >  include/odp/api/spec/compiler.h                    |  2 ++

>> >  include/odp/api/spec/config.h                      |  2 ++

>> >  include/odp/api/spec/cpu.h                         |  2 ++

>> >  include/odp/api/spec/cpumask.h                     |  2 ++

>> >  include/odp/api/spec/crypto.h                      |  2 ++

>> >  include/odp/api/spec/debug.h                       |  3 ++-

>> >  include/odp/api/spec/errno.h                       |  2 ++

>> >  include/odp/api/spec/event.h                       |  3 ++-

>> >  include/odp/api/spec/hash.h                        |  2 ++

>> >  include/odp/api/spec/hints.h                       |  2 ++

>> >  include/odp/api/spec/init.h                        |  4 ++--

>> >  include/odp/api/spec/packet.h                      |  2 ++

>> >  include/odp/api/spec/packet_flags.h                |  2 ++

>> >  include/odp/api/spec/packet_io.h                   |  2 ++

>> >  include/odp/api/spec/packet_io_stats.h             |  2 ++

>> >  include/odp/api/spec/pool.h                        |  4 ++--

>> >  include/odp/api/spec/queue.h                       |  2 ++

>> >  include/odp/api/spec/random.h                      |  3 ++-

>> >  include/odp/api/spec/rwlock.h                      |  2 ++

>> >  include/odp/api/spec/rwlock_recursive.h            |  2 ++

>> >  include/odp/api/spec/schedule.h                    |  3 ++-

>> >  include/odp/api/spec/schedule_types.h              |  2 ++

>> >  include/odp/api/spec/shared_memory.h               |  3 ++-

>> >  include/odp/api/spec/spinlock.h                    |  2 ++

>> >  include/odp/api/spec/spinlock_recursive.h          |  2 ++

>> >  include/odp/api/spec/std_clib.h                    |  2 ++

>> >  include/odp/api/spec/std_types.h                   |  3 ++-

>> >  include/odp/api/spec/sync.h                        |  2 ++

>> >  include/odp/api/spec/system_info.h                 |  3 ++-

>> >  include/odp/api/spec/thread.h                      |  2 ++

>> >  include/odp/api/spec/thrmask.h                     |  2 ++

>> >  include/odp/api/spec/ticketlock.h                  |  2 ++

>> >  include/odp/api/spec/time.h                        |  3 ++-

>> >  include/odp/api/spec/timer.h                       |  2 ++

>> >  include/odp/api/spec/traffic_mngr.h                |  2 ++

>> >  include/odp/api/spec/version.h                     |  2 ++

>> >  platform/Makefile.inc                              |  1 +

>> >  platform/linux-generic/include/odp/api/abi_begin.h |  3 +++

>> >  platform/linux-generic/include/odp/api/abi_end.h   |  3 +++

>> >  platform/linux-generic/m4/configure.m4             | 12 ++++++++++++

>> >  46 files changed, 103 insertions(+), 14 deletions(-)

>> >  create mode 100644 platform/linux-generic/include/odp/api/abi_begin.h

>> >  create mode 100644 platform/linux-generic/include/odp/api/abi_end.h

>> >

>>

>> Looks good, except that I think you missed this:

>>

>> diff --git a/platform/linux-generic/Makefile.am

>> b/platform/linux-generic/Makefile.am

>> index 5eb8cbc..bc5573d 100644

>> --- a/platform/linux-generic/Makefile.am

>> +++ b/platform/linux-generic/Makefile.am

>> @@ -16,6 +16,8 @@ include_HEADERS = \

>>  odpapiincludedir= $(includedir)/odp/api

>>  odpapiinclude_HEADERS = \

>>                   $(srcdir)/include/odp/api/align.h \

>> +                 $(srcdir)/include/odp/api/abi_begin.h \

>> +                 $(srcdir)/include/odp/api/abi_end.h \

>>                   $(srcdir)/include/odp/api/atomic.h \

>>                   $(srcdir)/include/odp/api/barrier.h \

>>                   $(srcdir)/include/odp/api/buffer.h \

>>

>>

>> make distcheck finds this wee problem:

>> make[1]: Entering directory

>>

>> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build'

>> Making all in platform/linux-generic

>> make[2]: Entering directory

>>

>> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build/platform/linux-generic'

>>   CC       odp_atomic.lo

>> In file included from

>> ../../../platform/linux-generic/include/odp/api/align.h:54:0,

>>                  from

>> ../../../platform/linux-generic/include/odp/api/atomic.h:20,

>>                  from ../../../platform/linux-generic/odp_atomic.c:7:

>> ../../../include/odp/api/spec/align.h:16:31: fatal error:

>> odp/api/abi_begin.h: No such file or directory

>>  #include <odp/api/abi_begin.h>

>>                                ^

>> compilation terminated.

>> Makefile:809: recipe for target 'odp_atomic.lo' failed

>> make[2]: *** [odp_atomic.lo] Error 1

>> make[2]: Leaving directory

>>

>> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build/platform/linux-generic'

>> Makefile:457: recipe for target 'all-recursive' failed

>> make[1]: *** [all-recursive] Error 1

>> make[1]: Leaving directory

>>

>> '/media/data/src/odp/crap/opendataplane-1.8.0.1.git574.g91c3d48.dirty/_build'

>> Makefile:663: recipe for target 'distcheck' failed

>> make: *** [distcheck] Error 1

>>

>>

>> Cheers,

>> Anders

>>

>

>

Patch

diff --git a/platform/linux-generic/Makefile.am
b/platform/linux-generic/Makefile.am
index 5eb8cbc..bc5573d 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -16,6 +16,8 @@  include_HEADERS = \
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
                  $(srcdir)/include/odp/api/align.h \
+                 $(srcdir)/include/odp/api/abi_begin.h \
+                 $(srcdir)/include/odp/api/abi_end.h \
                  $(srcdir)/include/odp/api/atomic.h \
                  $(srcdir)/include/odp/api/barrier.h \
                  $(srcdir)/include/odp/api/buffer.h \