Takashi Yamamiya | 2 Apr 23:39

Compile idst with SELinux

Hi,

I just noticed that you have to take care about SELinux issue when you
build idst on linux. An easy way is to run:

chcon -t texrel_shlib_t *.so

wherever error occurs, or to rewrite Makefile. Real problem is this
error message (st80.so: No such file or directory) means nothing. I
spend about this issue half day with gdb so I send the email if it
helps someone.

Cheers,
- Takashi

Index: object/Makefile
===================================================================
--- object/Makefile	(revision 400)
+++ object/Makefile	(working copy)
@@ -8,18 +8,22 @@

 boot : .config-stamp .FORCE
 	-$(SHELL) -ec '( cd boot; $(MAKE) )'
+	-chcon -t texrel_shlib_t boot/*.so

 stage1 : .FORCE
 	-$(SHELL) -ec '[ -d stage1 ] || mkdir stage1'
 	$(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir;
$(MAKE) IDC="../boot/idc -B../boot/ -O" BIN="../stage1/" ); done'
+	-chcon -t texrel_shlib_t stage1/*.so
(Continue reading)

Dan Amelang | 3 Apr 00:50
Picon

Re: Compile idst with SELinux

On Wed, Apr 2, 2008 at 2:43 PM, Takashi Yamamiya <tak@...> wrote:
> Hi,
>
>  I just noticed that you have to take care about SELinux issue when you
>  build idst on linux. An easy way is to run:
>
>  chcon -t texrel_shlib_t *.so
>
>  wherever error occurs, or to rewrite Makefile. Real problem is this
>  error message (st80.so: No such file or directory) means nothing. I
>  spend about this issue half day with gdb so I send the email if it
>  helps someone.

What a coincidence, I just spent 3 hours tracking down the cause of a
"No such file or directory", too. Needless to say, the problem wasn't
that there was no such file (nor that the search path was wrong).
Although I did bark up that tree for while :(

Basically any library load problem results in that message. To track
down the problem, I usually fall back to using the OS-level loader to
get descriptive error messages.

Dan

Takashi Yamamiya | 3 Apr 09:27

Re: Compile idst with SELinux

> What a coincidence, I just spent 3 hours tracking down the cause of a
> "No such file or directory", too. Needless to say, the problem wasn't
> that there was no such file (nor that the search path was wrong).
> Although I did bark up that tree for while :(

hehe, 3 hours is better than my half day.

> Basically any library load problem results in that message. To track
> down the problem, I usually fall back to using the OS-level loader to
> get descriptive error messages.

I inserted printf() and dlerror() everywhere to know the clue.
Maybe it is better to do file existing test before dlopen(),
and then report dlerror() if something wrong at _object___import_().

Cheers,
- Takashi


Gmane