Grub compilation in OpenWrt fails with GLOBAL_OFFSET_TABLE undefined error

Hi Guys!
Working on integrating grub package to my SDK, and finding an issue as below while compiling it for ARCH X86. Any pointers to get through this would really help.
Already tried using -f-no-pic / -f-no-PIE / -f-no-PIC / -f-no-pie and also no-PIE while linking.

mv syminfo.lst.new syminfo.lst
cat syminfo.lst | sort | gawk -f ./genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1)
_GLOBAL_OFFSET_TABLE_ in acpi is not defined
_GLOBAL_OFFSET_TABLE_ in adler32 is not defined
_GLOBAL_OFFSET_TABLE_ in affs is not defined
_GLOBAL_OFFSET_TABLE_ in afs is not defined
_GLOBAL_OFFSET_TABLE_ in ahci is not defined
_GLOBAL_OFFSET_TABLE_ in aout is not defined
_GLOBAL_OFFSET_TABLE_ in archelp is not defined
_GLOBAL_OFFSET_TABLE_ in at_keyboard is not defined
_GLOBAL_OFFSET_TABLE_ in ata is not defined
_GLOBAL_OFFSET_TABLE_ in backtrace is not defined
_GLOBAL_OFFSET_TABLE_ in bfs is not defined
_GLOBAL_OFFSET_TABLE_ in biosdisk is not defined
_GLOBAL_OFFSET_TABLE_ in bitmap is not defined
_GLOBAL_OFFSET_TABLE_ in bitmap_scale is not defined
_GLOBAL_OFFSET_TABLE_ in blocklist is not defined
_GLOBAL_OFFSET_TABLE_ in boot is not defined
_GLOBAL_OFFSET_TABLE_ in bsd is not defined
_GLOBAL_OFFSET_TABLE_ in bswap_test is not defined
_GLOBAL_OFFSET_TABLE_ in btrfs is not defined
_GLOBAL_OFFSET_TABLE_ in bufio is not defined
_GLOBAL_OFFSET_TABLE_ in cat is not defined
_GLOBAL_OFFSET_TABLE_ in cbfs is not defined
_GLOBAL_OFFSET_TABLE_ in cbls is not defined
_GLOBAL_OFFSET_TABLE_ in cbmemc is not defined
_GLOBAL_OFFSET_TABLE_ in cbtable is not defined
_GLOBAL_OFFSET_TABLE_ in cbtime is not defined
_GLOBAL_OFFSET_TABLE_ in chain is not defined
_GLOBAL_OFFSET_TABLE_ in cmdline_cat_test is not defined
_GLOBAL_OFFSET_TABLE_ in cmosdump is not defined
_GLOBAL_OFFSET_TABLE_ in cmostest is not defined
_GLOBAL_OFFSET_TABLE_ in cmp is not defined
_GLOBAL_OFFSET_TABLE_ in cmp_test is not defined
_GLOBAL_OFFSET_TABLE_ in configfile is not defined
_GLOBAL_OFFSET_TABLE_ in cpio is not defined
_GLOBAL_OFFSET_TABLE_ in cpio_be is not defined
_GLOBAL_OFFSET_TABLE_ in cpuid is not defined
_GLOBAL_OFFSET_TABLE_ in crc64 is not defined
_GLOBAL_OFFSET_TABLE_ in crypto is not defined
_GLOBAL_OFFSET_TABLE_ in cryptodisk is not defined
_GLOBAL_OFFSET_TABLE_ in cs5536 is not defined
_GLOBAL_OFFSET_TABLE_ in ctz_test is not defined
_GLOBAL_OFFSET_TABLE_ in date is not defined
_GLOBAL_OFFSET_TABLE_ in datehook is not defined
_GLOBAL_OFFSET_TABLE_ in disk is not defined
_GLOBAL_OFFSET_TABLE_ in diskfilter is not defined
_GLOBAL_OFFSET_TABLE_ in div is not defined
_GLOBAL_OFFSET_TABLE_ in div_test is not defined
_GLOBAL_OFFSET_TABLE_ in dm_nv is not defined
_GLOBAL_OFFSET_TABLE_ in drivemap is not defined
_GLOBAL_OFFSET_TABLE_ in echo is not defined
_GLOBAL_OFFSET_TABLE_ in efiemu is not defined
_GLOBAL_OFFSET_TABLE_ in ehci is not defined
_GLOBAL_OFFSET_TABLE_ in elf is not defined
_GLOBAL_OFFSET_TABLE_ in eval is not defined
_GLOBAL_OFFSET_TABLE_ in exfat is not defined
_GLOBAL_OFFSET_TABLE_ in exfctest is not defined
_GLOBAL_OFFSET_TABLE_ in ext2 is not defined
_GLOBAL_OFFSET_TABLE_ in extcmd is not defined
_GLOBAL_OFFSET_TABLE_ in f2fs is not defined
_GLOBAL_OFFSET_TABLE_ in fat is not defined
_GLOBAL_OFFSET_TABLE_ in file is not defined
_GLOBAL_OFFSET_TABLE_ in font is not defined
_GLOBAL_OFFSET_TABLE_ in freedos is not defined
_GLOBAL_OFFSET_TABLE_ in fshelp is not defined
_GLOBAL_OFFSET_TABLE_ in functional_test is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_arcfour is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_blowfish is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_camellia is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_cast5 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_crc is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_des is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_dsa is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_idea is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_md4 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_md5 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_rfc2268 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_rijndael is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_rmd160 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_rsa is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_seed is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_serpent is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_sha1 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_sha256 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_sha512 is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_tiger is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_twofish is not defined
_GLOBAL_OFFSET_TABLE_ in gcry_whirlpool is not defined
_GLOBAL_OFFSET_TABLE_ in gdb is not defined
_GLOBAL_OFFSET_TABLE_ in geli is not defined
_GLOBAL_OFFSET_TABLE_ in gettext is not defined
_GLOBAL_OFFSET_TABLE_ in gfxmenu is not defined
_GLOBAL_OFFSET_TABLE_ in gfxterm is not defined
_GLOBAL_OFFSET_TABLE_ in gfxterm_background is not defined
_GLOBAL_OFFSET_TABLE_ in gfxterm_menu is not defined
_GLOBAL_OFFSET_TABLE_ in gptsync is not defined
_GLOBAL_OFFSET_TABLE_ in gzio is not defined
_GLOBAL_OFFSET_TABLE_ in halt is not defined
_GLOBAL_OFFSET_TABLE_ in hashsum is not defined
_GLOBAL_OFFSET_TABLE_ in hdparm is not defined
_GLOBAL_OFFSET_TABLE_ in hello is not defined
_GLOBAL_OFFSET_TABLE_ in help is not defined
_GLOBAL_OFFSET_TABLE_ in hexdump is not defined
_GLOBAL_OFFSET_TABLE_ in hfs is not defined
_GLOBAL_OFFSET_TABLE_ in hfsplus is not defined
_GLOBAL_OFFSET_TABLE_ in hfspluscomp is not defined
_GLOBAL_OFFSET_TABLE_ in http is not defined
_GLOBAL_OFFSET_TABLE_ in iorw is not defined
_GLOBAL_OFFSET_TABLE_ in iso9660 is not defined
_GLOBAL_OFFSET_TABLE_ in jfs is not defined
_GLOBAL_OFFSET_TABLE_ in jpeg is not defined
_GLOBAL_OFFSET_TABLE_ in keylayouts is not defined
_GLOBAL_OFFSET_TABLE_ in keystatus is not defined
_GLOBAL_OFFSET_TABLE_ in ldm is not defined
_GLOBAL_OFFSET_TABLE_ in legacy_password_test is not defined
_GLOBAL_OFFSET_TABLE_ in legacycfg is not defined
_GLOBAL_OFFSET_TABLE_ in linux is not defined
_GLOBAL_OFFSET_TABLE_ in linux16 is not defined
_GLOBAL_OFFSET_TABLE_ in loadenv is not defined
_GLOBAL_OFFSET_TABLE_ in loopback is not defined
_GLOBAL_OFFSET_TABLE_ in ls is not defined
_GLOBAL_OFFSET_TABLE_ in lsacpi is not defined
_GLOBAL_OFFSET_TABLE_ in lsapm is not defined
_GLOBAL_OFFSET_TABLE_ in lsmmap is not defined
_GLOBAL_OFFSET_TABLE_ in lspci is not defined
_GLOBAL_OFFSET_TABLE_ in luks is not defined
_GLOBAL_OFFSET_TABLE_ in lvm is not defined
_GLOBAL_OFFSET_TABLE_ in lzopio is not defined
_GLOBAL_OFFSET_TABLE_ in macbless is not defined
_GLOBAL_OFFSET_TABLE_ in macho is not defined
_GLOBAL_OFFSET_TABLE_ in mda_text is not defined
_GLOBAL_OFFSET_TABLE_ in mdraid09 is not defined
_GLOBAL_OFFSET_TABLE_ in mdraid09_be is not defined
_GLOBAL_OFFSET_TABLE_ in mdraid1x is not defined
_GLOBAL_OFFSET_TABLE_ in memdisk is not defined
_GLOBAL_OFFSET_TABLE_ in memrw is not defined
_GLOBAL_OFFSET_TABLE_ in minicmd is not defined
_GLOBAL_OFFSET_TABLE_ in minix is not defined
_GLOBAL_OFFSET_TABLE_ in minix2 is not defined
_GLOBAL_OFFSET_TABLE_ in minix2_be is not defined
_GLOBAL_OFFSET_TABLE_ in minix3 is not defined
_GLOBAL_OFFSET_TABLE_ in minix3_be is not defined
_GLOBAL_OFFSET_TABLE_ in minix_be is not defined
_GLOBAL_OFFSET_TABLE_ in mmap is not defined
_GLOBAL_OFFSET_TABLE_ in morse is not defined
_GLOBAL_OFFSET_TABLE_ in mpi is not defined
_GLOBAL_OFFSET_TABLE_ in msdospart is not defined
_GLOBAL_OFFSET_TABLE_ in mul_test is not defined
_GLOBAL_OFFSET_TABLE_ in multiboot is not defined
_GLOBAL_OFFSET_TABLE_ in multiboot2 is not defined
_GLOBAL_OFFSET_TABLE_ in nativedisk is not defined
_GLOBAL_OFFSET_TABLE_ in net is not defined
_GLOBAL_OFFSET_TABLE_ in newc is not defined
_GLOBAL_OFFSET_TABLE_ in nilfs2 is not defined
_GLOBAL_OFFSET_TABLE_ in normal is not defined
_GLOBAL_OFFSET_TABLE_ in ntfs is not defined
_GLOBAL_OFFSET_TABLE_ in ntfscomp is not defined
_GLOBAL_OFFSET_TABLE_ in ntldr is not defined
_GLOBAL_OFFSET_TABLE_ in odc is not defined
_GLOBAL_OFFSET_TABLE_ in offsetio is not defined
_GLOBAL_OFFSET_TABLE_ in ohci is not defined
_GLOBAL_OFFSET_TABLE_ in part_acorn is not defined
_GLOBAL_OFFSET_TABLE_ in part_amiga is not defined
_GLOBAL_OFFSET_TABLE_ in part_apple is not defined
_GLOBAL_OFFSET_TABLE_ in part_bsd is not defined
_GLOBAL_OFFSET_TABLE_ in part_dfly is not defined
_GLOBAL_OFFSET_TABLE_ in part_dvh is not defined
_GLOBAL_OFFSET_TABLE_ in part_gpt is not defined
_GLOBAL_OFFSET_TABLE_ in part_msdos is not defined
_GLOBAL_OFFSET_TABLE_ in part_plan is not defined
_GLOBAL_OFFSET_TABLE_ in part_sun is not defined
_GLOBAL_OFFSET_TABLE_ in part_sunpc is not defined
_GLOBAL_OFFSET_TABLE_ in parttool is not defined
_GLOBAL_OFFSET_TABLE_ in password is not defined
_GLOBAL_OFFSET_TABLE_ in password_pbkdf2 is not defined
_GLOBAL_OFFSET_TABLE_ in pata is not defined
_GLOBAL_OFFSET_TABLE_ in pbkdf2 is not defined
_GLOBAL_OFFSET_TABLE_ in pbkdf2_test is not defined
_GLOBAL_OFFSET_TABLE_ in pci is not defined
_GLOBAL_OFFSET_TABLE_ in pcidump is not defined
_GLOBAL_OFFSET_TABLE_ in pgp is not defined
_GLOBAL_OFFSET_TABLE_ in plan9 is not defined
_GLOBAL_OFFSET_TABLE_ in play is not defined
_GLOBAL_OFFSET_TABLE_ in png is not defined
_GLOBAL_OFFSET_TABLE_ in priority_queue is not defined
_GLOBAL_OFFSET_TABLE_ in probe is not defined
_GLOBAL_OFFSET_TABLE_ in procfs is not defined
_GLOBAL_OFFSET_TABLE_ in progress is not defined
_GLOBAL_OFFSET_TABLE_ in pxe is not defined
_GLOBAL_OFFSET_TABLE_ in pxechain is not defined
_GLOBAL_OFFSET_TABLE_ in raid5rec is not defined
_GLOBAL_OFFSET_TABLE_ in raid6rec is not defined
_GLOBAL_OFFSET_TABLE_ in random is not defined
_GLOBAL_OFFSET_TABLE_ in rdmsr is not defined
_GLOBAL_OFFSET_TABLE_ in read is not defined
_GLOBAL_OFFSET_TABLE_ in reboot is not defined
_GLOBAL_OFFSET_TABLE_ in regexp is not defined
_GLOBAL_OFFSET_TABLE_ in reiserfs is not defined
_GLOBAL_OFFSET_TABLE_ in relocator is not defined
_GLOBAL_OFFSET_TABLE_ in romfs is not defined
_GLOBAL_OFFSET_TABLE_ in scsi is not defined
_GLOBAL_OFFSET_TABLE_ in search is not defined
_GLOBAL_OFFSET_TABLE_ in search_fs_file is not defined
_GLOBAL_OFFSET_TABLE_ in search_fs_uuid is not defined
_GLOBAL_OFFSET_TABLE_ in search_label is not defined
_GLOBAL_OFFSET_TABLE_ in sendkey is not defined
_GLOBAL_OFFSET_TABLE_ in serial is not defined
_GLOBAL_OFFSET_TABLE_ in setjmp_test is not defined
_GLOBAL_OFFSET_TABLE_ in setpci is not defined
_GLOBAL_OFFSET_TABLE_ in sfs is not defined
_GLOBAL_OFFSET_TABLE_ in shift_test is not defined
_GLOBAL_OFFSET_TABLE_ in signature_test is not defined
_GLOBAL_OFFSET_TABLE_ in sleep is not defined
_GLOBAL_OFFSET_TABLE_ in sleep_test is not defined
_GLOBAL_OFFSET_TABLE_ in spkmodem is not defined
_GLOBAL_OFFSET_TABLE_ in squash4 is not defined
_GLOBAL_OFFSET_TABLE_ in strtoull_test is not defined
_GLOBAL_OFFSET_TABLE_ in syslinuxcfg is not defined
_GLOBAL_OFFSET_TABLE_ in tar is not defined
_GLOBAL_OFFSET_TABLE_ in terminal is not defined
_GLOBAL_OFFSET_TABLE_ in terminfo is not defined
_GLOBAL_OFFSET_TABLE_ in test is not defined
_GLOBAL_OFFSET_TABLE_ in test_blockarg is not defined
_GLOBAL_OFFSET_TABLE_ in testload is not defined
_GLOBAL_OFFSET_TABLE_ in testspeed is not defined
_GLOBAL_OFFSET_TABLE_ in tftp is not defined
_GLOBAL_OFFSET_TABLE_ in tga is not defined
_GLOBAL_OFFSET_TABLE_ in time is not defined
_GLOBAL_OFFSET_TABLE_ in tr is not defined
_GLOBAL_OFFSET_TABLE_ in true is not defined
_GLOBAL_OFFSET_TABLE_ in truecrypt is not defined
_GLOBAL_OFFSET_TABLE_ in udf is not defined
_GLOBAL_OFFSET_TABLE_ in ufs1 is not defined
_GLOBAL_OFFSET_TABLE_ in ufs1_be is not defined
_GLOBAL_OFFSET_TABLE_ in ufs2 is not defined
_GLOBAL_OFFSET_TABLE_ in uhci is not defined
_GLOBAL_OFFSET_TABLE_ in usb is not defined
_GLOBAL_OFFSET_TABLE_ in usb_keyboard is not defined
_GLOBAL_OFFSET_TABLE_ in usbms is not defined
_GLOBAL_OFFSET_TABLE_ in usbserial_common is not defined
_GLOBAL_OFFSET_TABLE_ in usbserial_ftdi is not defined
_GLOBAL_OFFSET_TABLE_ in usbserial_pl2303 is not defined
_GLOBAL_OFFSET_TABLE_ in usbserial_usbdebug is not defined
_GLOBAL_OFFSET_TABLE_ in usbtest is not defined
_GLOBAL_OFFSET_TABLE_ in vbe is not defined
_GLOBAL_OFFSET_TABLE_ in verifiers is not defined
_GLOBAL_OFFSET_TABLE_ in vga is not defined
_GLOBAL_OFFSET_TABLE_ in vga_text is not defined
_GLOBAL_OFFSET_TABLE_ in video is not defined
_GLOBAL_OFFSET_TABLE_ in video_bochs is not defined
_GLOBAL_OFFSET_TABLE_ in video_cirrus is not defined
_GLOBAL_OFFSET_TABLE_ in video_colors is not defined
_GLOBAL_OFFSET_TABLE_ in video_fb is not defined
_GLOBAL_OFFSET_TABLE_ in videoinfo is not defined
_GLOBAL_OFFSET_TABLE_ in videotest is not defined
_GLOBAL_OFFSET_TABLE_ in videotest_checksum is not defined
_GLOBAL_OFFSET_TABLE_ in wrmsr is not defined
_GLOBAL_OFFSET_TABLE_ in xfs is not defined
_GLOBAL_OFFSET_TABLE_ in xnu is not defined
_GLOBAL_OFFSET_TABLE_ in xnu_uuid is not defined
_GLOBAL_OFFSET_TABLE_ in xnu_uuid_test is not defined
_GLOBAL_OFFSET_TABLE_ in xzio is not defined
_GLOBAL_OFFSET_TABLE_ in zfs is not defined
_GLOBAL_OFFSET_TABLE_ in zfscrypt is not defined
_GLOBAL_OFFSET_TABLE_ in zfsinfo is not defined
_GLOBAL_OFFSET_TABLE_ in zstd is not defined
make[6]: *** [moddep.lst] Error 1

grub != openwrt

there's however https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=fcd14017007db35a4a41ef4fd6b69a5e02edbd5e

1 Like

Thanks @frollic, the reference you shared helped fix my issue!!

TARGET_CFLAGS := $(filter-out -fno-plt,$(TARGET_CFLAGS))

Thanks much!
Divya

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.