diff --git a/frontends/liberty/liberty.cc b/frontends/liberty/liberty.cc
index 7a74c5fc..398e7a30 100644
--- a/frontends/liberty/liberty.cc
+++ b/frontends/liberty/liberty.cc
@@ -528,6 +528,9 @@ struct LibertyFrontend : public Frontend {
 			RTLIL::Module *module = new RTLIL::Module;
 			module->name = cell_name;
 
+			if (flag_lib)
+				module->set_bool_attribute("\\blackbox");
+
 			for (auto &attr : attributes)
 				module->attributes[attr] = 1;