Skip to contentSkip to conversation

Issue Building New Package cmus

Buildroot Dylan via buildroot 1 participant 5 messages May 5, 2024 – May 6, 2024

lore
Share & tools
lore
#0 lore raw

Hello,

I have added a new package, cmus, to my buildroot package list, but when I try to compile it during a full rebuild, it returns an error message,

input.c: In function 'do_http_get':
input.c:223:54: error: expected ')' before 'VERSION'
CC lib.o
make[2]: *** [scripts/lib.mk:66: input.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [package/pkg-generic.mk:283: buildroot/output/build/cmus-2.10.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

I can build the cmus package outside of buildroot, so I think it may be related to my cmus.mk file, but I am not sure what is wrong with the file.

I've uploaded the contents of the cmus.mk file here:
https://paste.ack.tf/8471de

If the mailing list supports it, I have the hash and config files attached, as well.

I'm using buildroot version 2024.02 and have tried running "make clean all". Is anyone else able to reproduce the same error, or can tell me what I've done incorrectly?

Thank you,
Dylan

# Locally computed

sha256  ff40068574810a7de3990f4f69c9c47ef49e37bd31d298d372e8bcdafb973fff  cmus-2.10.0.tar.gz
sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING

config BR2_PACKAGE_CMUS
bool "cmus"
select BR2_PACKAGE_NCURSES
help
Small, fast and powerful console music player for Unix-like operating systems.

https://cmus.github.io/

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw
Quoted 13 lines · Dylan via buildroot

Hello,

I have added a new package, cmus, to my buildroot package list, but when I try to compile it during a full rebuild, it returns an error message,

input.c: In function 'do_http_get':
input.c:223:54: error: expected ')' before 'VERSION'
CC lib.o
make[2]: *** [scripts/lib.mk:66: input.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [package/pkg-generic.mk:283: buildroot/output/build/cmus-2.10.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

Quoted 4 lines

I can build the cmus package outside of buildroot, so I think it may be related to my cmus.mk file, but I am not sure what is wrong with the file.

I've uploaded the contents of the cmus.mk file here:
https://paste.ack.tf/8471de

You have:

$(MAKE) $(TARGET_CONFIGURE_OPTS)

This forces an override of all variables defined in TARGET_CONFIGURE_OPTS. One
of those is CFLAGS, and in the Makefile itself the definition of VERSION is added to CFLAGS.

The solution is typically to use

$(TARGET_CONFIGURE_OPTS) $(MAKE)

i.e. pass everything in the environment. But then you have to make sure that the Makefile properly handles that - e.g. that it uses += for CFLAGS (which it does).

Regards,
Arnout

Quoted 7 lines

If the mailing list supports it, I have the hash and config files attached, as well.

I'm using buildroot version 2024.02 and have tried running "make clean all". Is anyone else able to reproduce the same error, or can tell me what I've done incorrectly?

Quoted 8 lines

Thank you,
Dylan

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hello Arnout,

Thank you for the prompt reply. I moved the $(TARGET_CONFIGURE_OPTS) variable behind the ./configure and MAKE invocations and it has solved that issue (pasted below).

define CMUS_CONFIGURE_CMDS
(cd $(@D); \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
./configure $(CMUS_CONFIGURE_OPTS))
endef

define CMUS_BUILD_CMDS
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(MAKE) -C $(@D) all
endef

define CMUS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(MAKE) -C $(@D) install \
DESTDIR="$(TARGET_DIR)/usr/bin"
endef

I'm now receiving errors related to "undefined references", which by their names, seem rather essential:

main.c:(.text+0x4): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x14): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x4c): undefined reference to read' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x64): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x68): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x80): undefined reference to __stack_chk_fail' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.o: in function `write_line':
main.c:(.text+0x138): undefined reference to `strlen'

Specifically, right after the line,
LD cmus-remote

Do you have any suggestions for resources I could dive deeper into this? I've been combing through the buildroot and bootlin docs, but it seems there are some specifics that I am missing.

I have the full build log here, if you're so inclined: https://paste.ack.tf/f86eab

Thank you for your assistance!
Dylan

Quoted 28 lines · Arnout Vandecappelle
Quoted 13 lines · Dylan via buildroot

Hello,

I have added a new package, cmus, to my buildroot package list, but when I try to compile it during a full rebuild, it returns an error message,

input.c: In function 'do_http_get':
input.c:223:54: error: expected ')' before 'VERSION'
CC lib.o
make[2]: *** [scripts/lib.mk:66: input.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [package/pkg-generic.mk:283: buildroot/output/build/cmus-2.10.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

Quoted 4 lines

I can build the cmus package outside of buildroot, so I think it may be related to my cmus.mk file, but I am not sure what is wrong with the file.

I've uploaded the contents of the cmus.mk file here:
https://paste.ack.tf/8471de

You have:

$(MAKE) $(TARGET_CONFIGURE_OPTS)

This forces an override of all variables defined in
TARGET_CONFIGURE_OPTS. One of those is CFLAGS, and in the Makefile itself the definition of VERSION is added to CFLAGS.

Quoted 24 lines

The solution is typically to use

$(TARGET_CONFIGURE_OPTS) $(MAKE)

i.e. pass everything in the environment. But then you have to make sure that the Makefile properly handles that - e.g. that it uses += for CFLAGS (which it does).

Regards,
Arnout

Quoted 15 lines

If the mailing list supports it, I have the hash and config files attached, as well.

I'm using buildroot version 2024.02 and have tried running "make clean all". Is anyone else able to reproduce the same error, or can tell me what I've done incorrectly?

Thank you,
Dylan

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 27 lines · Dylan

Hello Arnout,

Thank you for the prompt reply. I moved the $(TARGET_CONFIGURE_OPTS) variable behind the ./configure and MAKE invocations and it has solved that issue (pasted below).

define CMUS_CONFIGURE_CMDS
(cd $(@D); \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
./configure $(CMUS_CONFIGURE_OPTS))
endef

define CMUS_BUILD_CMDS
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(MAKE) -C $(@D) all
endef

define CMUS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(MAKE) -C $(@D) install \
DESTDIR="$(TARGET_DIR)/usr/bin"
endef

Quoted 8 lines

I'm now receiving errors related to "undefined references", which by their names, seem rather essential:

main.c:(.text+0x4): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x14): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x4c): undefined reference to read' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x64): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x68): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x80): undefined reference to __stack_chk_fail'

Sounds like the Makefile unconditionally enables stack smashing protection,
but it's disabled in your Buildroot configuration. Check in the Makefile how it's done and then either patch it out, or give whatever config option is needed to disable it. If you disable it, it will still be enabled by Buildroot when it's enabled in the Buildroot configuration (through the CFLAGS that Buildroot passes in).

Quoted 2 lines

buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.o: in function `write_line':
main.c:(.text+0x138): undefined reference to `strlen'

This is most likely a similar situation but with FORTIFY.

Regards,
Arnout

Quoted 4 lines

Specifically, right after the line,
    LD    cmus-remote

Quoted 61 lines

Do you have any suggestions for resources I could dive deeper into this? I've been combing through the buildroot and bootlin docs, but it seems there are some specifics that I am missing.

I have the full build log here, if you're so inclined: https://paste.ack.tf/f86eab

Thank you for your assistance!
Dylan

Quoted 51 lines · Arnout Vandecappelle
Quoted 13 lines · Dylan via buildroot

Hello,

I have added a new package, cmus, to my buildroot package list, but when I try to compile it during a full rebuild, it returns an error message,

input.c: In function 'do_http_get':
input.c:223:54: error: expected ')' before 'VERSION'
CC lib.o
make[2]: *** [scripts/lib.mk:66: input.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [package/pkg-generic.mk:283: buildroot/output/build/cmus-2.10.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

Quoted 4 lines

I can build the cmus package outside of buildroot, so I think it may be related to my cmus.mk file, but I am not sure what is wrong with the file.

I've uploaded the contents of the cmus.mk file here:
https://paste.ack.tf/8471de

 You have:

$(MAKE) $(TARGET_CONFIGURE_OPTS)

 This forces an override of all variables defined in TARGET_CONFIGURE_OPTS. One of those is CFLAGS, and in the Makefile itself the definition of VERSION is added to CFLAGS.

 The solution is typically to use

$(TARGET_CONFIGURE_OPTS) $(MAKE)

i.e. pass everything in the environment. But then you have to make sure that the Makefile properly handles that - e.g. that it uses += for CFLAGS (which it does).

 Regards,
 Arnout

Quoted 15 lines

If the mailing list supports it, I have the hash and config files attached, as well.

I'm using buildroot version 2024.02 and have tried running "make clean all". Is anyone else able to reproduce the same error, or can tell me what I've done incorrectly?

Thank you,
Dylan

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hi Arnout,

I will try that out. I appreciate your assistance!

Thank you,
Dylan

Quoted 42 lines · Arnout Vandecappelle
Quoted 27 lines · Dylan

Hello Arnout,

Thank you for the prompt reply. I moved the $(TARGET_CONFIGURE_OPTS) variable behind the ./configure and MAKE invocations and it has solved that issue (pasted below).

define CMUS_CONFIGURE_CMDS
(cd $(@D); \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
./configure $(CMUS_CONFIGURE_OPTS))
endef

define CMUS_BUILD_CMDS
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(MAKE) -C $(@D) all
endef

define CMUS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(MAKE) -C $(@D) install \
DESTDIR="$(TARGET_DIR)/usr/bin"
endef

Quoted 8 lines

I'm now receiving errors related to "undefined references", which by their names, seem rather essential:

main.c:(.text+0x4): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x14): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x4c): undefined reference to read' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x64): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x68): undefined reference to __stack_chk_guard' buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.c:(.text+0x80): undefined reference to __stack_chk_fail'

Sounds like the Makefile unconditionally enables stack smashing
protection, but it's disabled in your Buildroot configuration. Check in the Makefile how it's done and then either patch it out, or give whatever config option is needed to disable it. If you disable it, it will still be enabled by Buildroot when it's enabled in the Buildroot configuration (through the CFLAGS that Buildroot passes in).

Quoted 75 lines
Quoted 2 lines

buildroot/output/host/bin/aarch64-buildroot-linux-gnu-ld: main.o: in function `write_line':
main.c:(.text+0x138): undefined reference to `strlen'

This is most likely a similar situation but with FORTIFY.

Regards,
Arnout

Quoted 67 lines

Specifically, right after the line,
LD cmus-remote

Do you have any suggestions for resources I could dive deeper into this? I've been combing through the buildroot and bootlin docs, but it seems there are some specifics that I am missing.

I have the full build log here, if you're so inclined: https://paste.ack.tf/f86eab

Thank you for your assistance!
Dylan

Quoted 53 lines · On Sun, May 5 2024 at 09:33:22 PM +0200, Arnout Vandecappelle <[email protected]>…
Quoted 13 lines · Dylan via buildroot

Hello,

I have added a new package, cmus, to my buildroot package list, but when I try to compile it during a full rebuild, it returns an error message,

input.c: In function 'do_http_get':
input.c:223:54: error: expected ')' before 'VERSION'
CC lib.o
make[2]: *** [scripts/lib.mk:66: input.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [package/pkg-generic.mk:283: buildroot/output/build/cmus-2.10.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

Quoted 4 lines

I can build the cmus package outside of buildroot, so I think it may be related to my cmus.mk file, but I am not sure what is wrong with the file.

I've uploaded the contents of the cmus.mk file here:
https://paste.ack.tf/8471de

You have:

$(MAKE) $(TARGET_CONFIGURE_OPTS)

This forces an override of all variables defined in
TARGET_CONFIGURE_OPTS. One of those is CFLAGS, and in the Makefile itself the definition of VERSION is added to CFLAGS.

The solution is typically to use

$(TARGET_CONFIGURE_OPTS) $(MAKE)

i.e. pass everything in the environment. But then you have to make sure that the Makefile properly handles that - e.g. that it uses += for CFLAGS (which it does).

Regards,
Arnout

Quoted 15 lines

If the mailing list supports it, I have the hash and config files attached, as well.

I'm using buildroot version 2024.02 and have tried running "make clean all".
Is anyone else able to reproduce the same error, or can tell me what I've done incorrectly?

Thank you,
Dylan

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot