crda-Fix-the-linking-order-to-avoid-compilation-erro.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From: Krishna Chaitanya <chaitanya.mgit@gmail.com>
  2. Date: Mon, 16 Dec 2013 21:57:39 +0530
  3. Subject: [PATCH] crda: Fix the linking order to avoid compilation error
  4. Origin: https://git.kernel.org/?p=linux/kernel/git/mcgrof/crda.git/commit?id=fefefdb2c52c8fbedbb339b4badb8226cad7e7e0
  5. While linking the crda.o and libreg.so, first put crda.o
  6. and then -lreg. This fixed the below error:
  7. GEN keys-gcrypt.c
  8. Trusted pubkeys: pubkeys/linville.key.pub.pem
  9. CC libreg.so
  10. CC crda.o
  11. LD crda
  12. crda.o: In function `main':
  13. crda/crda.c:196: undefined reference to `reglib_get_rd_alpha2'
  14. collect2: ld returned 1 exit status
  15. make: *** [crda] Error 1
  16. Note: This still doesn't fix the below error (will send another mail)
  17. CHK /usr/lib/crda/regulatory.bin
  18. Database signature verification failed.
  19. Invalid or empty regulatory file, note: a binary regulatory file should be used.
  20. make: *** [verify] Error 234
  21. Upstream-Status: Backport
  22. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
  23. Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
  24. ---
  25. Makefile | 5 +++--
  26. 1 file changed, 3 insertions(+), 2 deletions(-)
  27. diff --git a/Makefile b/Makefile
  28. index 4a351c6..0b2f0d7 100644
  29. --- a/Makefile
  30. +++ b/Makefile
  31. @@ -28,10 +28,11 @@ RUNTIME_PUBKEY_DIR?=/etc/wireless-regdb/pubkeys
  32. CFLAGS += -O2 -fpic
  33. CFLAGS += -std=gnu99 -Wall -Werror -pedantic
  34. CFLAGS += -Wall -g
  35. -LDLIBS += -lm
  36. LDLIBREG += -lreg
  37. +LDLIBS += $(LDLIBREG)
  38. +LDLIBS += -lm
  39. LIBREG += libreg.so
  40. -LDFLAGS += -L ./ $(LDLIBREG)
  41. +LDFLAGS += -L ./
  42. all: all_noverify verify