Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with CFLAGS and LDFLAGS #22

Closed
dubo-dubon-duponey opened this issue Aug 9, 2021 · 4 comments · Fixed by #23
Closed

Issues with CFLAGS and LDFLAGS #22

dubo-dubon-duponey opened this issue Aug 9, 2021 · 4 comments · Fixed by #23

Comments

@dubo-dubon-duponey
Copy link
Contributor

dubo-dubon-duponey commented Aug 9, 2021

Hey @AlbanSeurat

This https://github.com/openairplay/goplay2/blob/main/codec/aac.go#L27-L30 is problematic.

  • on linux, the use of a static version of libfdk is forced
  • on mac & linux, the path information (-I, -L) may or may not work / make sense, override proper system values to something undesirable

Both points are problematic for cross-compilation and for systems that do not ship a static version of libfdk - typically Debian Buster in the Dockerfile already requires live-patching the source (https://github.com/openairplay/goplay2/pull/19/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R9)

Suggestion would be to leave the responsibility of picking these to the build system / command (eg: "-extldflags -static(-pie)") for people who would really want to be specific about these.

For most normal people, things will just continue building by default, and this should make life easier for advanced users (looking for cross-compilation, or more control over static vs. dynamic).

Let me know your thoughts and if you agree I can send a small PR to change that.

@AlbanSeurat
Copy link
Member

I saw your patch on your docker file and I do understand why you would like to get rid of it.

However, I had link issue at startup with the dynamic lib on Ubuntu ( or raspbian) with missing symbols.

I do not want to have “-static” as it static link the libc as well and it does not work with cgo.

If you can find a simple cross platform solution (ubuntu, raspian, debian, macOS), I am happy to let you do it.

Just for Info, I had remove the makefile to keep thing simple at build time with just “go build”.

@dubo-dubon-duponey
Copy link
Contributor Author

Ok. I'll have a deeper look into this and see if there is a good way to accommodate all use cases.

@dubo-dubon-duponey
Copy link
Contributor Author

Static linking against glibc with CGO should still work fine (Would require the same version of glibc dyn lib to be there at runtime because NSS), but then if you do not require NSS, building with netgo should fix that. Musl static should work fine as well.
More later if I can get something nice in.

@AlbanSeurat
Copy link
Member

Exactly it was related to dns and how libc handle it.

Again, I have a simple “go build” solution to help me focus on audio features. And again, happy to receive help to improve the rest :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants