[sane-devel] [RFC] On libsane symbols visibility

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Wed May 9 01:17:22 UTC 2007


Julien BLACHE <jb at jblache.org> writes:

> "Ilia Sotnikov" <hostcc at gmail.com> wrote:
>
>> My suggestion is to mark the functions which are part of SANE API as
>> exportable (__attribute__ ((visibility("default"))) symbol attribute
>> and its companion, -fvisibility=hidden). It will give us the necessary
>> result - only explicitly marked symbols will be visible. In ideal
>> case, 'make libcheck' wouldn't be necessary anymore. The above
>> mentioned attribute and command line switch is a GCC extension.
>>
>> Any thoughts?
>
> SANE traditionally builds with non-gcc compilers too, so this is kind
> of a no-go for the gcc-deprived (or the gcc-sucks-no-way-I-use-it,
> YMMV) :)

Seconded, but sane-backends uses libtool so I think you can achieve
what you are trying to quite easily without modifying sources using
one of the following options:

  -export-symbols SYMFILE
                    try to export only the symbols listed in SYMFILE
  -export-symbols-regex REGEX
                    try to export only the symbols matching REGEX

Haven't tried this myself so YMMV.

Hope this helps,
-- 
Olaf Meeuwissen             FLOSS Engineer -- EPSON AVASYS Corporation
FSF Associate Member #1962           sign up at http://member.fsf.org/
GnuPG key: 6BE37D90/AB6B 0D1F 99E7 1BF5 EB97  976A 16C7 F27D 6BE3 7D90
Penguin's lib!       -- I hack, therefore I am --               LPIC-2



More information about the sane-devel mailing list