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

glib2: fix mips16 build, add size reducing static link, fpic CFLAGS #10780

Merged
merged 1 commit into from Jan 15, 2020

Conversation

Andy2244
Copy link
Contributor

@Andy2244 Andy2244 commented Dec 13, 2019

Maintainer: @tripolar
Compile tested: mips/arm (master)
Run tested: mips/lantiq, arm/mvebu (master)

Description:

  • allows building as mips16 (fixes broken mips16/32 mixed static linking)
  • add some static link related flags to reduce target binary size

PS: I did test static glib2 via cifsd static build and shared via Midnight Commander package on both platforms and had no issues.

libs/glib2/Makefile Outdated Show resolved Hide resolved
@Andy2244 Andy2244 changed the title glib2: fix mips16 build glib2: fix mips16 build, add size reducing static link, fpic CFLAGS Dec 13, 2019
@dengqf6
Copy link
Contributor

dengqf6 commented Dec 13, 2019

There is a newer version available (2.63.2) and it contains security fixes
Think you can update it?

@Andy2244
Copy link
Contributor Author

Andy2244 commented Dec 13, 2019

Think you can update it?

Sorry i'm not the maintainer, i just try to get my cifsd package ready for prime-time, to replace the ancient samba36 or at least offer a tiny alternative to samba4.

I already suspect that this PR might sit here for a while, so i'm not adding any more changes, sorry.

@neheb
Copy link
Contributor

neheb commented Dec 13, 2019

@dengqf6 is 2.58 EOL?

@Andy2244
Copy link
Contributor Author

Andy2244 commented Dec 18, 2019

@neheb Why was this submitted and committed, this does not actually solve the issue and fails the same way as before?

What's going on here?

/root/openwrt/tmp/ccMsra2k.s: Assembler messages:
/root/openwrt/tmp/ccMsra2k.s:13239: Error: invalid operands `srl $0,$0,13'
/root/openwrt/tmp/ccMsra2k.s:13240: Error: invalid operands `srl $0,$0,29'
/root/openwrt/tmp/ccMsra2k.s:13241: Error: invalid operands `srl $0,$0,3'
/root/openwrt/tmp/ccMsra2k.s:13242: Error: invalid operands `srl $0,$0,19'
/root/openwrt/tmp/ccMsra2k.s:13243: Error: invalid operands `or $13,$13,$13'
lto-wrapper: fatal error: mips-openwrt-linux-musl-gcc returned 1 exit status
compilation terminated.
/root/openwrt/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/lib/gcc/mips-openwrt-linux-musl/8.3.0/../../../../mips-openwrt-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Makefile:1327: recipe for target 'libglib-2.0.la' failed
make[7]: *** [libglib-2.0.la] Error 1
make[7]: Leaving directory '/root/openwrt/build_dir/target-mips_24kc_musl/glib-2.58.3/glib'
Makefile:2510: recipe for target 'all-recursive' failed

verify i used the new patch:

root@debian9-vm:~/openwrt# cat ./build_dir/target-mips_24kc_musl/glib-2.58.3/glib/valgrind.h | grep -B3 -A3 "define PLAT_mips32_linux"
#elif defined(__linux__) && defined(__mips__) && (__mips==64)
#  define PLAT_mips64_linux 1
#elif defined(__linux__) && defined(__mips__) && (__mips==32)
#  define PLAT_mips32_linux 1
#elif defined(__sun) && defined(__i386__)
#  define PLAT_x86_solaris 1
#elif defined(__sun) && defined(__x86_64__)

@neheb
Copy link
Contributor

neheb commented Dec 18, 2019

Bah it seems I sent something without properly testing. I tested running the toolchain GCC and trying out multiple command line options to see the effects.

no options: __mips = 1
-mips16: __mips = 1

I will retest. I suspect the mcpu or mtune settings are turning __mips to 32, even with -mips16

@neheb
Copy link
Contributor

neheb commented Dec 18, 2019

Yep that's exactly it. Will send another patch upstream.

@neheb
Copy link
Contributor

neheb commented Dec 31, 2019

ping @tripolar This is blocking the cifsd update.

@neheb
Copy link
Contributor

neheb commented Dec 31, 2019

This must be rebased.

* allows building as mips16 (fixes broken mips16/32 mixed static linking)
* add some static link related flags to reduce target binary size

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
@neheb
Copy link
Contributor

neheb commented Jan 1, 2020

ping @tripolar this is ready.

@neheb
Copy link
Contributor

neheb commented Jan 15, 2020

Merging as this is needed for smbd.

@neheb neheb merged commit ec9b38e into openwrt:master Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants