Re: [PATCH] Btrfs-progs: add static compile target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 09, 2013 at 12:19:29AM +0100, Ian Kumlien wrote:
> +# Define static compilation flags
> +STATIC_CFLAGS = $(CFLAGS) -static -ffunction-sections -fdata-sections
> +STATIC_LDFLAGS = -Wl,--gc-sections
> +STATIC_LIBS = $(LIBS) -lpthread

> +btrfs.static: $(static_objects) btrfs.static.o help.static.o $(static_cmds_objects)
> +	@echo "    [LD]     $@"
> +	$(Q)$(CC) $(STATIC_CFLAGS) -o btrfs.static btrfs.static.o help.static.o $(static_cmds_objects) \
> +		$(static_objects) $(STATIC_LDFLAGS) $(STATIC_LIBS)

-static belongs into LDFLAGS, it's propagated to the link phase through
CFLAGS which is not IMO clean. As the point is to make the static
version as small as possible I think it's ok to separate the built
objects and name the binary differently from the normal one. Also, from
distro side, I can build both targets from within one package without
nonstandard build steps (make, copy, clean, make, copy/rename).

I'll fix the -static flag locally and add this patch to integration.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux