Skip to content

Commit

Permalink
plymouth-lite: fix linking with glibc-2.23, this fixes #4727 this fixes
Browse files Browse the repository at this point in the history
#4732

Signed-off-by: Stephan Raue <stephan@openelec.tv>
  • Loading branch information
sraue committed Feb 20, 2016
1 parent d307296 commit c59439e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index 6ab27ef..17d12a0 100644

ply-image: ply-image.c ply-frame-buffer.c Makefile
- $(CC) $(CFLAGS) `pkg-config --cflags libpng` ply-image.c ply-frame-buffer.c -o ply-image -lm `pkg-config --libs libpng` -lm -lz
+ $(CC) $(CFLAGS) -Wl,-Bstatic `pkg-config --cflags libpng` ply-image.c ply-frame-buffer.c -o ply-image -lm `pkg-config --libs libpng` -lm -lz -Wl,-Bdynamic -lc $(LDFLAGS)
+ $(CC) $(CFLAGS) -Wl,-Bstatic `pkg-config --cflags libpng` ply-image.c ply-frame-buffer.c -o ply-image `pkg-config --libs libpng` -lz -Wl,-Bdynamic -lc -lm $(LDFLAGS)

clean:
rm -f ply-image *~ gmon.out
Expand Down

10 comments on commit c59439e

@stefansaraev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ive done this long time ago to avoid adding libm to initrd. why is this needed now. it still builds fine for me. does it fail only on x86?

@vpeter4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there is some issue with glibc 2.23 and this ply-image can't be build anymore like before. With libm linking it is bigger (~ 800 kB) and the other option is to include libm in initrd.
Not sure for other projects but at least happens to Generic.

@stefansaraev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static linking with -lm -ldl should be enough. beware of library order.

@vpeter4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't find the way.

../sysdeps/x86_64/fpu/multiarch/s_floor.S:27: error: undefined reference to '_dl_x86_cpu_features'
../sysdeps/x86_64/fpu/multiarch/e_pow.c:8: error: undefined reference to '_dl_x86_cpu_features'
../sysdeps/x86_64/fpu/multiarch/s_rint.S:27: error: undefined reference to '_dl_x86_cpu_features'
../sysdeps/x86_64/fpu/multiarch/e_exp.c:9: error: undefined reference to '_dl_x86_cpu_features'

@stefansaraev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check grep -ri _dl_x86_cpu_features ./ in glibc build dir ?

@vpeter4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefansaraev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, indeed. no way to have it "partialy" static.

libm is > 1.1mb. plymouth compiled fully static is < 1mb. I'd say force static compile if libm is needed only for plymouth. http://sprunge.us/FAVc

@vpeter4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, something in latest glibc changed this option we were using for now.

@MilhouseVH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess for the sake of 200-300 KB, a shared libm may pay dividends if it's ever needed by something else in future...

@stefansaraev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bug. but shared libm is ok.

Please sign in to comment.