Bug 13001 - openjdk-bin replaces libfreetype.so from host-freetype
Summary: openjdk-bin replaces libfreetype.so from host-freetype
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2020.02.3
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Adam Duskett
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-09 16:38 UTC by Jared Bents
Modified: 2020-06-18 11:41 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:


Attachments
proposed patch to fix (1.94 KB, patch)
2020-06-11 13:29 UTC, Jared Bents
Details
proposed patch to fix v2 (3.93 KB, patch)
2020-06-15 13:09 UTC, Jared Bents
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Bents 2020-06-09 16:38:20 UTC
openjdk-bin creates libfreetype.so and places it into $(HOST_DIR)/lib/. This causes host-xapp_mkfontscale to fail to build due to the libfreetype.so from host-freetype being overwritten.

mkfontscale.o: In function `doDirectory':
mkfontscale.c:(.text+0x1a80): undefined reference to `FT_Get_BDF_Property'
collect2: error: ld returned 1 exit status

This can be reproduced by doing the following steps.

make host-freetype
make host-openjdk-bin
make host-xapp_mkfontscale
Comment 1 Jared Bents 2020-06-11 13:29:56 UTC
Created attachment 8501 [details]
proposed patch to fix

The proposed patch to fix the issue removes libfreetype.so and adds host-freetype dependency
Comment 2 Yann E. MORIN 2020-06-14 09:06:49 UTC
Jared, All,

Thanks for the report and the proposed patch.

I think the removal of that file should be done in a post-extract hook instead.

Additionally, it would also be better to do the removal of unpack200 in that same post-extract hook as well.

Can you send it to the list with those changes, please?

But note that ythere are a few other libraries that may be provided by other packages:

- libzip.so, by package libzip, for which we do have a host variant, and so may well start clashing too
- libnet.so, by package libnet; thats OK so far as we have no host variant for it, but that should be fixed as well I think
- libsctp.so, by package lksctp-tools; thats OK so far as we have no host variant for it, but that should be fixed as well I think

Could you also have a look into those, please?

Adam, some more feedback, please?

Regards,
Yann E. MORIN.
Comment 3 Jared Bents 2020-06-15 13:09:54 UTC
Created attachment 8506 [details]
proposed patch to fix v2

Updated proposed patch to use post extract hook and include three more libraries

- libzip.so, by package libzip
- libnet.so, by package libnet; added host variant
- libsctp.so, by package lksctp-tools; added host variant
Comment 4 Yann E. MORIN 2020-06-15 16:32:10 UTC
Jared, All,

Thanks for the proposed patch. Please submit it to the mailing
list, which is where we discuss all the patches.

Regards,
Yann E. MORIN.
Comment 5 Jared Bents 2020-06-15 20:08:35 UTC
Yann,

I'll send it to the mailing list once I finish testing. It looks like some of the libraries in the v2 patch will have to stay as the included binaries instead of building from source because they either cause an issue with openjdk or with other packages (for example, host-libzip causes host-zip to fail to build).

I'll include everything in the description once finished.

Thank you,
Jared
Comment 6 Adam Duskett 2020-06-17 18:13:26 UTC
Sorry for the delayed response, as this ticket is mine.

I would propose doing what we did with OpenJDK, which is installing host-openjdk-bin to /usr/lib/jvm. This directory structure provides two advantages:

1) The directory structure is consistent with how we handle the target OpenJDK.
2) I have been spending some time with OpenJDK and Buildroot as of late. Part of what I have had to do was set up Maven with Buildroot, and in doing so I found that the host-openjdk-bin install step does not copy the conf file from the source directory to the host directory.

This lack of copying causes Maven to crash with the error "Can't read cryptographic policy directory: unlimited."

After some research, I found that Maven looks for conf files in $(JAVA_HOME)/conf, which Buildroot does not provide.

Maven also searched for $(JAVA_HOME)/bin and $(JAVA_HOME)/lib which do exist.

So there are two options to fix this issue:

Copy the conf directory to $(HOST_DIR), which would result in a $(HOST_DIR)/conf directory.

OR

Follow the standard practice of installing the entire JVM to /usr/lib/jvm


I would propose the second option as it also looks nicer and allows us not to have a $(HOST_DIR)/conf directory.


Yann, thoughts?
Comment 7 Adam Duskett 2020-06-17 22:02:08 UTC
(In reply to Jared Bents from comment #5)

After talking with Thomas and Yann I have created and submitted a patch that impliments the above:

https://patchwork.ozlabs.org/project/buildroot/patch/20200617215520.3600744-1-aduskett@gmail.com/

If anybody wants to test the patch it would be very much appreciated!
Comment 8 Yann E. MORIN 2020-06-18 11:41:43 UTC
Jared, All,

This is now supposedly fixed with the patch from Adam, committed as e9a02417f3.

Thanks for the report, and the proposed patch (I'll reply to that on the list).

Regards,
Yann E. MORIN.